OSDN Git Service

(split) LDP: Update original to LDP v3.40.
[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 .\" 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.
12 .\"
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.
20 .\"
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 .\"
27 .TH RAISE 3  2012-04-20 "GNU" "Linux Programmer's Manual"
28 .SH NAME
29 raise \- send a signal to the caller
30 .SH SYNOPSIS
31 .nf
32 .B #include <signal.h>
33 .sp
34 .BI "int raise(int " sig );
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR raise ()
39 function sends a signal to the calling process or thread.
40 In a single-threaded program it is equivalent to
41 .sp
42 .in +4n
43 .nf
44 kill(getpid(), sig);
45 .fi
46 .in
47 .PP
48 In a multithreaded program it is equivalent to
49 .sp
50 .in +4n
51 .nf
52 pthread_kill(pthread_self(), sig);
53 .fi
54 .in
55 .PP
56 If the signal causes a handler to be called,
57 .BR raise ()
58 will only return after the signal handler has returned.
59 .SH "RETURN VALUE"
60 .BR raise ()
61 returns 0 on success, and nonzero for failure.
62 .SH "CONFORMING TO"
63 C89, C99, POSIX.1-2001.
64 .SH NOTES
65 Since version 2.3.3, glibc implements
66 .BR raise ()
67 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)