OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / sysv_signal.3
1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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_END
24 .\"
25 .TH SYSV_SIGNAL 3 2014-01-06 "" "Linux Programmer's Manual"
26 .SH NAME
27 sysv_signal \- signal handling with System V semantics
28 .SH SYNOPSIS
29 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
30 .br
31 .B #include <signal.h>
32 .sp
33 .B typedef void (*sighandler_t)(int);
34 .sp
35 .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
36 .SH DESCRIPTION
37 The
38 .BR sysv_signal ()
39 function takes the same arguments, and performs the same task, as
40 .BR signal (2).
41
42 However
43 .BR sysv_signal ()
44 provides the System V unreliable signal semantics, that is:
45 a) the disposition of the signal is reset to the default
46 when the handler is invoked;
47 b) delivery of further instances of the signal is not blocked while
48 the signal handler is executing; and
49 c) if the handler interrupts (certain) blocking system calls,
50 then the system call is not automatically restarted.
51 .SH RETURN VALUE
52 The
53 .BR sysv_signal ()
54 function returns the previous value of the signal handler, or
55 .B SIG_ERR
56 on error.
57 .SH ERRORS
58 As for
59 .BR signal (2).
60 .SH ATTRIBUTES
61 .SS Multithreading (see pthreads(7))
62 The
63 .BR sysv_signal ()
64 function is thread-safe.
65 .SH CONFORMING TO
66 This function is nonstandard.
67 .SH NOTES
68 Use of
69 .BR sysv_signal ()
70 should be avoided; use
71 .BR sigaction (2)
72 instead.
73
74 On older Linux systems,
75 .BR sysv_signal ()
76 and
77 .BR signal (2)
78 were equivalent.
79 But on newer systems,
80 .BR signal (2)
81 provides reliable signal semantics; see
82 .BR signal (2)
83 for details.
84
85 The use of
86 .I sighandler_t
87 is a GNU extension;
88 this type is defined only if
89 the
90 .B _GNU_SOURCE
91 feature test macro is defined.
92 .SH SEE ALSO
93 .BR sigaction (2),
94 .BR signal (2),
95 .BR bsd_signal (3),
96 .BR signal (7)
97 .SH COLOPHON
98 This page is part of release 3.79 of the Linux
99 .I man-pages
100 project.
101 A description of the project,
102 information about reporting bugs,
103 and the latest version of this page,
104 can be found at
105 \%http://www.kernel.org/doc/man\-pages/.