| 1 |
'\" t |
| 2 |
.\" Copyright 2002, Andries E. Brouwer <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH gsignal 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
gsignal, ssignal \- software signal facility |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <signal.h> |
| 16 |
.P |
| 17 |
.B "typedef typeof(void (int)) *sighandler_t;" |
| 18 |
.P |
| 19 |
.BI "[[deprecated]] int gsignal(int " signum ); |
| 20 |
.P |
| 21 |
.BI "[[deprecated]] sighandler_t ssignal(int " signum ", sighandler_t " action ); |
| 22 |
.fi |
| 23 |
.P |
| 24 |
.RS -4 |
| 25 |
Feature Test Macro Requirements for glibc (see |
| 26 |
.BR feature_test_macros (7)): |
| 27 |
.RE |
| 28 |
.P |
| 29 |
.BR gsignal (), |
| 30 |
.BR ssignal (): |
| 31 |
.nf |
| 32 |
Since glibc 2.19: |
| 33 |
_DEFAULT_SOURCE |
| 34 |
glibc 2.19 and earlier: |
| 35 |
_SVID_SOURCE |
| 36 |
.fi |
| 37 |
.SH DESCRIPTION |
| 38 |
Don't use these functions under Linux. |
| 39 |
Due to a historical mistake, under Linux these functions are |
| 40 |
aliases for |
| 41 |
.BR raise (3) |
| 42 |
and |
| 43 |
.BR signal (2), |
| 44 |
respectively. |
| 45 |
.P |
| 46 |
Elsewhere, on System V-like systems, these functions implement |
| 47 |
software signaling, entirely independent of the classical |
| 48 |
.BR signal (2) |
| 49 |
and |
| 50 |
.BR kill (2) |
| 51 |
functions. |
| 52 |
The function |
| 53 |
.BR ssignal () |
| 54 |
defines the action to take when the software signal with |
| 55 |
number |
| 56 |
.I signum |
| 57 |
is raised using the function |
| 58 |
.BR gsignal (), |
| 59 |
and returns the previous such action or |
| 60 |
.BR SIG_DFL . |
| 61 |
The function |
| 62 |
.BR gsignal () |
| 63 |
does the following: if no action (or the action |
| 64 |
.BR SIG_DFL ) |
| 65 |
was |
| 66 |
specified for |
| 67 |
.IR signum , |
| 68 |
then it does nothing and returns 0. |
| 69 |
If the action |
| 70 |
.B SIG_IGN |
| 71 |
was specified for |
| 72 |
.IR signum , |
| 73 |
then it does nothing and returns 1. |
| 74 |
Otherwise, it resets the action to |
| 75 |
.B SIG_DFL |
| 76 |
and calls |
| 77 |
the action function with argument |
| 78 |
.IR signum , |
| 79 |
and returns the value returned by that function. |
| 80 |
The range of possible values |
| 81 |
.I signum |
| 82 |
varies (often 1\[en]15 or 1\[en]17). |
| 83 |
.SH ATTRIBUTES |
| 84 |
For an explanation of the terms used in this section, see |
| 85 |
.BR attributes (7). |
| 86 |
.TS |
| 87 |
allbox; |
| 88 |
lbx lb lb |
| 89 |
l l l. |
| 90 |
Interface Attribute Value |
| 91 |
T{ |
| 92 |
.na |
| 93 |
.nh |
| 94 |
.BR gsignal () |
| 95 |
T} Thread safety MT-Safe |
| 96 |
T{ |
| 97 |
.na |
| 98 |
.nh |
| 99 |
.BR ssignal () |
| 100 |
T} Thread safety MT-Safe sigintr |
| 101 |
.TE |
| 102 |
.SH STANDARDS |
| 103 |
None. |
| 104 |
.SH HISTORY |
| 105 |
AIX, DG/UX, HP-UX, SCO, Solaris, Tru64. |
| 106 |
They are called obsolete under most of these systems, and are |
| 107 |
broken under |
| 108 |
.\" Linux libc and |
| 109 |
glibc. |
| 110 |
Some systems also have |
| 111 |
.BR gsignal_r () |
| 112 |
and |
| 113 |
.BR ssignal_r (). |
| 114 |
.SH SEE ALSO |
| 115 |
.BR kill (2), |
| 116 |
.BR signal (2), |
| 117 |
.BR raise (3) |