OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / raise.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified Sat Jul 24 18:40:56 1993 by Rik Faith (faith@cs.unc.edu)
27 .\" Modified 1995 by Mike Battersby (mib@deakin.edu.au)
28 .\"
29 .TH RAISE 3  2014-03-10 "GNU" "Linux Programmer's Manual"
30 .SH NAME
31 raise \- send a signal to the caller
32 .SH SYNOPSIS
33 .nf
34 .B #include <signal.h>
35 .sp
36 .BI "int raise(int " sig );
37 .fi
38 .SH DESCRIPTION
39 The
40 .BR raise ()
41 function sends a signal to the calling process or thread.
42 In a single-threaded program it is equivalent to
43 .sp
44 .in +4n
45 .nf
46 kill(getpid(), sig);
47 .fi
48 .in
49 .PP
50 In a multithreaded program it is equivalent to
51 .sp
52 .in +4n
53 .nf
54 pthread_kill(pthread_self(), sig);
55 .fi
56 .in
57 .PP
58 If the signal causes a handler to be called,
59 .BR raise ()
60 will return only after the signal handler has returned.
61 .SH RETURN VALUE
62 .BR raise ()
63 returns 0 on success, and nonzero for failure.
64 .SH ATTRIBUTES
65 .SS Multithreading (see pthreads(7))
66 The
67 .BR raise ()
68 function is thread-safe.
69 .SH CONFORMING TO
70 C89, C99, POSIX.1-2001.
71 .SH NOTES
72 Since version 2.3.3, glibc implements
73 .BR raise ()
74 by calling
75 .BR tgkill (2),
76 .\" 2.3.2 used the obsolete tkill(), if available.
77 if the kernel supports that system call.
78 Older glibc versions implemented
79 .BR raise ()
80 using
81 .BR kill (2).
82 .SH SEE ALSO
83 .BR getpid (2),
84 .BR kill (2),
85 .BR sigaction (2),
86 .BR signal (2),
87 .BR pthread_kill (3),
88 .BR signal (7)
89 .SH COLOPHON
90 This page is part of release 3.79 of the Linux
91 .I man-pages
92 project.
93 A description of the project,
94 information about reporting bugs,
95 and the latest version of this page,
96 can be found at
97 \%http://www.kernel.org/doc/man\-pages/.