]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/raise.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / raise.3
CommitLineData
f37855d1 1.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
031cb604 2.\" and Copyright (C) 2008 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
3.\"
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\" License.
24.\" Modified Sat Jul 24 18:40:56 1993 by Rik Faith (faith@cs.unc.edu)
25.\" Modified 1995 by Mike Battersby (mib@deakin.edu.au)
26.\"
f24766e3 27.TH RAISE 3 2012-04-20 "GNU" "Linux Programmer's Manual"
fea681da 28.SH NAME
031cb604 29raise \- send a signal to the caller
fea681da
MK
30.SH SYNOPSIS
31.nf
32.B #include <signal.h>
33.sp
34.BI "int raise(int " sig );
35.fi
36.SH DESCRIPTION
c13182ef 37The
63aa9df0 38.BR raise ()
031cb604
MK
39function sends a signal to the calling process or thread.
40In a single-threaded program it is equivalent to
fea681da 41.sp
031cb604
MK
42.in +4n
43.nf
44kill(getpid(), sig);
45.fi
46.in
47.PP
48In a multithreaded program it is equivalent to
49.sp
50.in +4n
51.nf
52pthread_kill(pthread_self(), sig);
53.fi
54.in
55.PP
56If the signal causes a handler to be called,
2737254c 57.BR raise ()
031cb604 58will only return after the signal handler has returned.
47297adb 59.SH RETURN VALUE
2737254c 60.BR raise ()
c7094399 61returns 0 on success, and nonzero for failure.
47297adb 62.SH CONFORMING TO
031cb604 63C89, C99, POSIX.1-2001.
f24766e3
MK
64.SH NOTES
65Since version 2.3.3, glibc implements
66.BR raise ()
67by calling
68.BR tgkill (2),
69.\" 2.3.2 used the obsolete tkill(), if available.
70if the kernel supports that system call.
71Older glibc versions implemented
72.BR raise ()
73using
74.BR kill (2).
47297adb 75.SH SEE ALSO
fea681da
MK
76.BR getpid (2),
77.BR kill (2),
031cb604 78.BR sigaction (2),
f0c34053 79.BR signal (2),
baf17bc4 80.BR pthread_kill (3),
031cb604 81.BR signal (7)