]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
f37855d1 | 2 | .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) |
031cb604 | 3 | .\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 4 | .\" |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
c08df37a | 6 | .\" |
fea681da MK |
7 | .\" Modified Sat Jul 24 18:40:56 1993 by Rik Faith (faith@cs.unc.edu) |
8 | .\" Modified 1995 by Mike Battersby (mib@deakin.edu.au) | |
9 | .\" | |
4c1c5274 | 10 | .TH raise 3 (date) "Linux man-pages (unreleased)" |
fea681da | 11 | .SH NAME |
031cb604 | 12 | raise \- send a signal to the caller |
bf71dc19 AC |
13 | .SH LIBRARY |
14 | Standard C library | |
8fc3b2cf | 15 | .RI ( libc ", " \-lc ) |
fea681da MK |
16 | .SH SYNOPSIS |
17 | .nf | |
18 | .B #include <signal.h> | |
c6d039a3 | 19 | .P |
fea681da MK |
20 | .BI "int raise(int " sig ); |
21 | .fi | |
22 | .SH DESCRIPTION | |
c13182ef | 23 | The |
63aa9df0 | 24 | .BR raise () |
031cb604 MK |
25 | function sends a signal to the calling process or thread. |
26 | In a single-threaded program it is equivalent to | |
c6d039a3 | 27 | .P |
031cb604 | 28 | .in +4n |
bdd915e2 | 29 | .EX |
031cb604 | 30 | kill(getpid(), sig); |
bdd915e2 | 31 | .EE |
031cb604 | 32 | .in |
c6d039a3 | 33 | .P |
031cb604 | 34 | In a multithreaded program it is equivalent to |
c6d039a3 | 35 | .P |
031cb604 | 36 | .in +4n |
bdd915e2 | 37 | .EX |
031cb604 | 38 | pthread_kill(pthread_self(), sig); |
bdd915e2 | 39 | .EE |
031cb604 | 40 | .in |
c6d039a3 | 41 | .P |
031cb604 | 42 | If the signal causes a handler to be called, |
2737254c | 43 | .BR raise () |
33a0ccb2 | 44 | will return only after the signal handler has returned. |
47297adb | 45 | .SH RETURN VALUE |
2737254c | 46 | .BR raise () |
c7094399 | 47 | returns 0 on success, and nonzero for failure. |
3e722e9e | 48 | .SH ATTRIBUTES |
866807a6 PH |
49 | For an explanation of the terms used in this section, see |
50 | .BR attributes (7). | |
51 | .TS | |
52 | allbox; | |
c466875e | 53 | lbx lb lb |
866807a6 PH |
54 | l l l. |
55 | Interface Attribute Value | |
56 | T{ | |
9e54434e BR |
57 | .na |
58 | .nh | |
3e722e9e | 59 | .BR raise () |
866807a6 PH |
60 | T} Thread safety MT-Safe |
61 | .TE | |
3113c7f3 | 62 | .SH STANDARDS |
4131356c AC |
63 | C11, POSIX.1-2008. |
64 | .SH HISTORY | |
65 | POSIX.1-2001, C89. | |
c6d039a3 | 66 | .P |
b324e17d | 67 | Since glibc 2.3.3, |
f24766e3 | 68 | .BR raise () |
b324e17d | 69 | is implemented by calling |
f24766e3 MK |
70 | .BR tgkill (2), |
71 | .\" 2.3.2 used the obsolete tkill(), if available. | |
72 | if the kernel supports that system call. | |
73 | Older glibc versions implemented | |
74 | .BR raise () | |
75 | using | |
76 | .BR kill (2). | |
47297adb | 77 | .SH SEE ALSO |
fea681da MK |
78 | .BR getpid (2), |
79 | .BR kill (2), | |
031cb604 | 80 | .BR sigaction (2), |
f0c34053 | 81 | .BR signal (2), |
baf17bc4 | 82 | .BR pthread_kill (3), |
031cb604 | 83 | .BR signal (7) |