]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sigpause.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / sigpause.3
CommitLineData
fea681da
MK
1.\" Copyright (C) 2004 Andries Brouwer (aeb@cwi.nl)
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
c13182ef 11.\"
fea681da
MK
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
c13182ef 19.\"
fea681da
MK
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
4468d2b7 23.TH SIGPAUSE 3 2010-09-12 "Linux" "Linux Programmer's Manual"
fea681da
MK
24.SH NAME
25sigpause \- atomically release blocked signals and wait for interrupt
26.SH SYNOPSIS
27.nf
28.B #include <signal.h>
29.sp
30.BI "int sigpause(int " sigmask "); /* BSD */"
31.sp
008f1ecc 32.BI "int sigpause(int " sig "); /* System V / UNIX 95 */"
fea681da
MK
33.fi
34.SH DESCRIPTION
c13182ef
MK
35Don't use this function.
36Use
fea681da
MK
37.BR sigsuspend (2)
38instead.
39.LP
40The function
e511ffb6 41.BR sigpause ()
fea681da 42is designed to wait for some signal.
40f54839 43It changes the process's signal mask (set of blocked signals),
fea681da
MK
44and then waits for a signal to arrive.
45Upon arrival of a signal, the original signal mask is restored.
47297adb 46.SH RETURN VALUE
fea681da 47If
e511ffb6 48.BR sigpause ()
fea681da
MK
49returns, it was interrupted by a signal and the return value is \-1
50with
51.I errno
52set to
53.BR EINTR .
1b1a3c6e
MK
54.SH CONFORMING TO
55The System V version of
56.BR sigpause ()
57is standardized in POSIX.1-2001.
889829be
MK
58.SH NOTES
59.SS History
fea681da 60The classical BSD version of this function appeared in 4.2BSD.
40f54839 61It sets the process's signal mask to
fea681da 62.IR sigmask .
008f1ecc 63UNIX 95 standardized the incompatible System V version of
7145b9a9 64this function, which removes only the specified signal
fea681da 65.I sig
fc7ba057 66from the process's signal mask.
008f1ecc 67.\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
fea681da
MK
68The unfortunate situation with two incompatible functions with the
69same name was solved by the
70.BR \%sigsuspend (2)
71function, that takes a
40f54839 72.I "sigset_t *"
c4bb193f 73argument (instead of an
40f54839 74.IR int ).
c634028a 75.SS Linux notes
fea681da 76On Linux, this routine is a system call only on the Sparc (sparc64)
c13182ef 77architecture.
98817d83 78
c13182ef 79Libc4 and libc5 only know about the BSD version.
98817d83 80
db4e96b7
MK
81Glibc uses the BSD version if the
82.B _BSD_SOURCE
2f0af33b
MK
83feature test macro is defined and none of
84.BR _POSIX_SOURCE ,
85.BR _POSIX_C_SOURCE ,
86.BR _XOPEN_SOURCE ,
87.BR _GNU_SOURCE ,
88or
c3dfd2c8
MK
89.B _SVID_SOURCE
90is defined.
4468d2b7 91Otherwise, the System V version is used.
988db661 92.\"
fea681da
MK
93.\" For the BSD version, one usually uses a zero
94.\" .I sigmask
95.\" to indicate that no signals are to be blocked.
47297adb 96.SH SEE ALSO
fea681da
MK
97.BR kill (2),
98.BR sigaction (2),
fea681da
MK
99.BR sigprocmask (2),
100.BR sigsuspend (2),
30ecea55 101.BR sigblock (3),
98817d83
MK
102.BR sigvec (3),
103.BR feature_test_macros (7)