Debian Codegraph @

upstream/debian-trixie/man3/raise.3

raw
1 '\" t
2 .\" Copyright (c) 1993 by Thomas Koenig ([email protected])
3 .\" and Copyright (C) 2008 Michael Kerrisk <[email protected]>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .\" Modified Sat Jul 24 18:40:56 1993 by Rik Faith ([email protected])
8 .\" Modified 1995 by Mike Battersby ([email protected])
9 .\"
10 .TH raise 3 2024-05-02 "Linux man-pages 6.9.1"
11 .SH NAME
12 raise \- send a signal to the caller
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <signal.h>
19 .P
20 .BI "int raise(int " sig );
21 .fi
22 .SH DESCRIPTION
23 The
24 .BR raise ()
25 function sends a signal to the calling process or thread.
26 In a single-threaded program it is equivalent to
27 .P
28 .in +4n
29 .EX
30 kill(getpid(), sig);
31 .EE
32 .in
33 .P
34 In a multithreaded program it is equivalent to
35 .P
36 .in +4n
37 .EX
38 pthread_kill(pthread_self(), sig);
39 .EE
40 .in
41 .P
42 If the signal causes a handler to be called,
43 .BR raise ()
44 will return only after the signal handler has returned.
45 .SH RETURN VALUE
46 .BR raise ()
47 returns 0 on success, and nonzero for failure.
48 .SH ATTRIBUTES
49 For an explanation of the terms used in this section, see
50 .BR attributes (7).
51 .TS
52 allbox;
53 lbx lb lb
54 l l l.
55 Interface Attribute Value
56 T{
57 .na
58 .nh
59 .BR raise ()
60 T} Thread safety MT-Safe
61 .TE
62 .SH STANDARDS
63 C11, POSIX.1-2008.
64 .SH HISTORY
65 POSIX.1-2001, C89.
66 .P
67 Since glibc 2.3.3,
68 .BR raise ()
69 is implemented by calling
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).
77 .SH SEE ALSO
78 .BR getpid (2),
79 .BR kill (2),
80 .BR sigaction (2),
81 .BR signal (2),
82 .BR pthread_kill (3),
83 .BR signal (7)