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