| 1 |
'\" t |
| 2 |
.\" Copyright 2007, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH sysv_signal 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
sysv_signal \- signal handling with System V semantics |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
| 16 |
.B #include <signal.h> |
| 17 |
.P |
| 18 |
.B "typedef typeof(void (int)) *sighandler_t;" |
| 19 |
.P |
| 20 |
.BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); |
| 21 |
.fi |
| 22 |
.SH DESCRIPTION |
| 23 |
The |
| 24 |
.BR sysv_signal () |
| 25 |
function takes the same arguments, and performs the same task, as |
| 26 |
.BR signal (2). |
| 27 |
.P |
| 28 |
However |
| 29 |
.BR sysv_signal () |
| 30 |
provides the System V unreliable signal semantics, |
| 31 |
that is: |
| 32 |
a) the disposition of the signal is reset to the default |
| 33 |
when the handler is invoked; |
| 34 |
b) delivery of further instances of the signal |
| 35 |
is not blocked while the signal handler is executing; |
| 36 |
and |
| 37 |
c) if the handler interrupts (certain) blocking system calls, |
| 38 |
then the system call is not automatically restarted. |
| 39 |
.SH RETURN VALUE |
| 40 |
The |
| 41 |
.BR sysv_signal () |
| 42 |
function returns the previous value of the signal handler, or |
| 43 |
.B SIG_ERR |
| 44 |
on error. |
| 45 |
.SH ERRORS |
| 46 |
As for |
| 47 |
.BR signal (2). |
| 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 sysv_signal () |
| 60 |
T} Thread safety MT-Safe |
| 61 |
.TE |
| 62 |
.SH VERSIONS |
| 63 |
Use of |
| 64 |
.BR sysv_signal () |
| 65 |
should be avoided; |
| 66 |
use |
| 67 |
.BR sigaction (2) |
| 68 |
instead. |
| 69 |
.P |
| 70 |
On older Linux systems, |
| 71 |
.BR sysv_signal () |
| 72 |
and |
| 73 |
.BR signal (2) |
| 74 |
were equivalent. |
| 75 |
But on newer systems, |
| 76 |
.BR signal (2) |
| 77 |
provides reliable signal semantics; |
| 78 |
see |
| 79 |
.BR signal (2) |
| 80 |
for details. |
| 81 |
.P |
| 82 |
The use of |
| 83 |
.I sighandler_t |
| 84 |
is a GNU extension; |
| 85 |
this type is defined only if |
| 86 |
the |
| 87 |
.B _GNU_SOURCE |
| 88 |
feature test macro is defined. |
| 89 |
.SH STANDARDS |
| 90 |
None. |
| 91 |
.SH SEE ALSO |
| 92 |
.BR sigaction (2), |
| 93 |
.BR signal (2), |
| 94 |
.BR bsd_signal (3), |
| 95 |
.BR signal (7) |