OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / sigpause.3
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.
11 .\"
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.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH SIGPAUSE 3 2010-09-12 "Linux" "Linux Programmer's Manual"
24 .SH NAME
25 sigpause \- 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
32 .BI "int sigpause(int " sig ");      /* System V / UNIX 95 */"
33 .fi
34 .SH DESCRIPTION
35 Don't use this function.
36 Use
37 .BR sigsuspend (2)
38 instead.
39 .LP
40 The function
41 .BR sigpause ()
42 is designed to wait for some signal.
43 It changes the process's signal mask (set of blocked signals),
44 and then waits for a signal to arrive.
45 Upon arrival of a signal, the original signal mask is restored.
46 .SH "RETURN VALUE"
47 If
48 .BR sigpause ()
49 returns, it was interrupted by a signal and the return value is \-1
50 with
51 .I errno
52 set to
53 .BR EINTR .
54 .SH CONFORMING TO
55 The System V version of
56 .BR sigpause ()
57 is standardized in POSIX.1-2001.
58 .SH NOTES
59 .SS History
60 The classical BSD version of this function appeared in 4.2BSD.
61 It sets the process's signal mask to
62 .IR sigmask .
63 UNIX 95 standardized the incompatible System V version of
64 this function, which removes only the specified signal
65 .I sig
66 from the process's signal mask.
67 .\" __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
68 The unfortunate situation with two incompatible functions with the
69 same name was solved by the
70 .BR \%sigsuspend (2)
71 function, that takes a
72 .I "sigset_t *"
73 argument (instead of an
74 .IR int ).
75 .SS Linux Notes
76 On Linux, this routine is a system call only on the Sparc (sparc64)
77 architecture.
78
79 Libc4 and libc5 only know about the BSD version.
80
81 Glibc uses the BSD version if the
82 .B _BSD_SOURCE
83 feature test macro is defined and none of
84 .BR _POSIX_SOURCE ,
85 .BR _POSIX_C_SOURCE ,
86 .BR _XOPEN_SOURCE ,
87 .BR _GNU_SOURCE ,
88 or
89 .B _SVID_SOURCE
90 is defined.
91 Otherwise, the System V version is used.
92 .\"
93 .\" For the BSD version, one usually uses a zero
94 .\" .I sigmask
95 .\" to indicate that no signals are to be blocked.
96 .SH "SEE ALSO"
97 .BR kill (2),
98 .BR sigaction (2),
99 .BR sigprocmask (2),
100 .BR sigsuspend (2),
101 .BR sigblock (3),
102 .BR sigvec (3),
103 .BR feature_test_macros (7)