OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.41.
[linuxjm/LDP_man-pages.git] / po4a / signal / po / signal.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-05-28 07:17+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/bsd_signal.3:23
21 #, no-wrap
22 msgid "BSD_SIGNAL"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/bsd_signal.3:23 build/C/man2/getitimer.2:7
27 #, no-wrap
28 msgid "2009-03-15"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/bsd_signal.3:23 build/C/man2/eventfd.2:21 build/C/man2/getitimer.2:7 build/C/man3/gsignal.3:25 build/C/man2/kill.2:44 build/C/man2/killpg.2:40 build/C/man2/pause.2:30 build/C/man2/prctl.2:48 build/C/man3/profil.3:28 build/C/man3/psignal.3:28 build/C/man3/raise.3:27 build/C/man2/rt_sigqueueinfo.2:23 build/C/man2/sgetmask.2:24 build/C/man2/sigaction.2:45 build/C/man2/sigaltstack.2:25 build/C/man7/sigevent.7:24 build/C/man3/siginterrupt.3:29 build/C/man2/signal.2:34 build/C/man7/signal.7:44 build/C/man2/signalfd.2:19 build/C/man3/sigpause.3:23 build/C/man2/sigpending.2:27 build/C/man2/sigprocmask.2:27 build/C/man3/sigqueue.3:26 build/C/man2/sigreturn.2:27 build/C/man3/sigset.3:24 build/C/man3/sigsetops.3:29 build/C/man2/sigsuspend.2:27 build/C/man3/sigvec.3:24 build/C/man3/sigwait.3:24 build/C/man2/sigwaitinfo.2:23 build/C/man3/sysv_signal.3:23 build/C/man2/timer_create.2:29 build/C/man2/timer_delete.2:23 build/C/man2/timer_getoverrun.2:23 build/C/man2/timer_settime.2:23 build/C/man2/timerfd_create.2:20 build/C/man2/tkill.2:29 build/C/man2/wait.2:50 build/C/man2/wait4.2:34
33 #, no-wrap
34 msgid "Linux Programmer's Manual"
35 msgstr ""
36
37 #. type: SH
38 #: build/C/man3/bsd_signal.3:24 build/C/man2/eventfd.2:22 build/C/man2/getitimer.2:8 build/C/man3/gsignal.3:26 build/C/man2/kill.2:45 build/C/man2/killpg.2:41 build/C/man2/pause.2:31 build/C/man2/prctl.2:49 build/C/man3/profil.3:29 build/C/man3/psignal.3:29 build/C/man3/raise.3:28 build/C/man2/rt_sigqueueinfo.2:24 build/C/man2/sgetmask.2:25 build/C/man2/sigaction.2:46 build/C/man2/sigaltstack.2:26 build/C/man7/sigevent.7:25 build/C/man3/siginterrupt.3:30 build/C/man2/signal.2:35 build/C/man7/signal.7:45 build/C/man2/signalfd.2:20 build/C/man3/sigpause.3:24 build/C/man2/sigpending.2:28 build/C/man2/sigprocmask.2:28 build/C/man3/sigqueue.3:27 build/C/man2/sigreturn.2:28 build/C/man3/sigset.3:25 build/C/man3/sigsetops.3:30 build/C/man2/sigsuspend.2:28 build/C/man3/sigvec.3:25 build/C/man3/sigwait.3:25 build/C/man2/sigwaitinfo.2:24 build/C/man3/sysv_signal.3:24 build/C/man2/timer_create.2:30 build/C/man2/timer_delete.2:24 build/C/man2/timer_getoverrun.2:24 build/C/man2/timer_settime.2:24 build/C/man2/timerfd_create.2:21 build/C/man2/tkill.2:30 build/C/man2/wait.2:51 build/C/man2/wait4.2:35
39 #, no-wrap
40 msgid "NAME"
41 msgstr ""
42
43 #. type: Plain text
44 #: build/C/man3/bsd_signal.3:26
45 msgid "bsd_signal - signal handling with BSD semantics"
46 msgstr ""
47
48 #. type: SH
49 #: build/C/man3/bsd_signal.3:26 build/C/man2/eventfd.2:24 build/C/man2/getitimer.2:10 build/C/man3/gsignal.3:28 build/C/man2/kill.2:47 build/C/man2/killpg.2:43 build/C/man2/pause.2:33 build/C/man2/prctl.2:51 build/C/man3/profil.3:31 build/C/man3/psignal.3:31 build/C/man3/raise.3:30 build/C/man2/rt_sigqueueinfo.2:26 build/C/man2/sgetmask.2:27 build/C/man2/sigaction.2:48 build/C/man2/sigaltstack.2:28 build/C/man7/sigevent.7:27 build/C/man3/siginterrupt.3:32 build/C/man2/signal.2:37 build/C/man2/signalfd.2:22 build/C/man3/sigpause.3:26 build/C/man2/sigpending.2:30 build/C/man2/sigprocmask.2:30 build/C/man3/sigqueue.3:29 build/C/man2/sigreturn.2:30 build/C/man3/sigset.3:27 build/C/man3/sigsetops.3:33 build/C/man2/sigsuspend.2:30 build/C/man3/sigvec.3:27 build/C/man3/sigwait.3:27 build/C/man2/sigwaitinfo.2:26 build/C/man3/sysv_signal.3:26 build/C/man2/timer_create.2:32 build/C/man2/timer_delete.2:26 build/C/man2/timer_getoverrun.2:26 build/C/man2/timer_settime.2:27 build/C/man2/timerfd_create.2:24 build/C/man2/tkill.2:32 build/C/man2/wait.2:53 build/C/man2/wait4.2:37
50 #, no-wrap
51 msgid "SYNOPSIS"
52 msgstr ""
53
54 #. type: Plain text
55 #: build/C/man3/bsd_signal.3:28
56 msgid "B<#define _XOPEN_SOURCE> /* See feature_test_macros(7) */"
57 msgstr ""
58
59 #. type: Plain text
60 #: build/C/man3/bsd_signal.3:30 build/C/man2/killpg.2:45 build/C/man2/sigaltstack.2:30 build/C/man2/signal.2:39 build/C/man2/sigpending.2:32 build/C/man2/sigprocmask.2:32 build/C/man3/sigqueue.3:31 build/C/man3/sigset.3:29 build/C/man3/sigsetops.3:35 build/C/man2/sigsuspend.2:32 build/C/man3/sigvec.3:29 build/C/man3/sysv_signal.3:30
61 msgid "B<#include E<lt>signal.hE<gt>>"
62 msgstr ""
63
64 #. type: Plain text
65 #: build/C/man3/bsd_signal.3:32 build/C/man2/signal.2:41 build/C/man3/sigset.3:31 build/C/man3/sysv_signal.3:32
66 msgid "B<typedef void (*sighandler_t)(int);>"
67 msgstr ""
68
69 #. type: Plain text
70 #: build/C/man3/bsd_signal.3:34
71 msgid "B<sighandler_t bsd_signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
72 msgstr ""
73
74 #. type: SH
75 #: build/C/man3/bsd_signal.3:34 build/C/man2/eventfd.2:28 build/C/man2/getitimer.2:19 build/C/man3/gsignal.3:47 build/C/man2/kill.2:65 build/C/man2/killpg.2:59 build/C/man2/pause.2:37 build/C/man2/prctl.2:58 build/C/man3/profil.3:44 build/C/man3/psignal.3:54 build/C/man3/raise.3:36 build/C/man2/rt_sigqueueinfo.2:33 build/C/man2/sgetmask.2:31 build/C/man2/sigaction.2:65 build/C/man2/sigaltstack.2:49 build/C/man7/sigevent.7:50 build/C/man3/siginterrupt.3:53 build/C/man2/signal.2:43 build/C/man7/signal.7:47 build/C/man2/signalfd.2:26 build/C/man3/sigpause.3:34 build/C/man2/sigpending.2:44 build/C/man2/sigprocmask.2:45 build/C/man3/sigqueue.3:41 build/C/man2/sigreturn.2:32 build/C/man3/sigset.3:56 build/C/man3/sigsetops.3:61 build/C/man2/sigsuspend.2:44 build/C/man3/sigvec.3:47 build/C/man3/sigwait.3:43 build/C/man2/sigwaitinfo.2:44 build/C/man3/sysv_signal.3:34 build/C/man2/timer_create.2:50 build/C/man2/timer_delete.2:42 build/C/man2/timer_getoverrun.2:42 build/C/man2/timer_settime.2:47 build/C/man2/timerfd_create.2:36 build/C/man2/tkill.2:38 build/C/man2/wait.2:82 build/C/man2/wait4.2:68
76 #, no-wrap
77 msgid "DESCRIPTION"
78 msgstr ""
79
80 #. type: Plain text
81 #: build/C/man3/bsd_signal.3:39
82 msgid ""
83 "The B<bsd_signal>()  function takes the same arguments, and performs the "
84 "same task, as B<signal>(2)."
85 msgstr ""
86
87 #. type: Plain text
88 #: build/C/man3/bsd_signal.3:52
89 msgid ""
90 "The difference between the two is that B<bsd_signal>()  is guaranteed to "
91 "provide reliable signal semantics, that is: a) the disposition of the signal "
92 "is not reset to the default when the handler is invoked; b) delivery of "
93 "further instances of the signal is blocked while the signal handler is "
94 "executing; and c) if the handler interrupts a blocking system call, then the "
95 "system call is automatically restarted.  A portable application cannot rely "
96 "on B<signal>(2)  to provide these guarantees."
97 msgstr ""
98
99 #. type: SH
100 #: build/C/man3/bsd_signal.3:52 build/C/man2/eventfd.2:222 build/C/man2/getitimer.2:117 build/C/man2/kill.2:99 build/C/man2/killpg.2:88 build/C/man2/pause.2:42 build/C/man2/prctl.2:546 build/C/man3/profil.3:66 build/C/man3/psignal.3:87 build/C/man3/raise.3:59 build/C/man2/rt_sigqueueinfo.2:124 build/C/man2/sgetmask.2:54 build/C/man2/sigaction.2:656 build/C/man2/sigaltstack.2:131 build/C/man3/siginterrupt.3:71 build/C/man2/signal.2:95 build/C/man2/signalfd.2:248 build/C/man3/sigpause.3:46 build/C/man2/sigpending.2:51 build/C/man2/sigprocmask.2:91 build/C/man3/sigqueue.3:81 build/C/man2/sigreturn.2:51 build/C/man3/sigset.3:127 build/C/man3/sigsetops.3:105 build/C/man2/sigsuspend.2:68 build/C/man3/sigvec.3:197 build/C/man3/sigwait.3:66 build/C/man2/sigwaitinfo.2:101 build/C/man3/sysv_signal.3:49 build/C/man2/timer_create.2:165 build/C/man2/timer_delete.2:50 build/C/man2/timer_getoverrun.2:79 build/C/man2/timer_settime.2:169 build/C/man2/timerfd_create.2:286 build/C/man2/tkill.2:69 build/C/man2/wait.2:354 build/C/man2/wait4.2:127
101 #, no-wrap
102 msgid "RETURN VALUE"
103 msgstr ""
104
105 #. type: Plain text
106 #: build/C/man3/bsd_signal.3:58
107 msgid ""
108 "The B<bsd_signal>()  function returns the previous value of the signal "
109 "handler, or B<SIG_ERR> on error."
110 msgstr ""
111
112 #. type: SH
113 #: build/C/man3/bsd_signal.3:58 build/C/man2/eventfd.2:229 build/C/man2/getitimer.2:122 build/C/man2/kill.2:104 build/C/man2/killpg.2:93 build/C/man2/pause.2:53 build/C/man2/prctl.2:563 build/C/man2/rt_sigqueueinfo.2:129 build/C/man2/sgetmask.2:59 build/C/man2/sigaction.2:659 build/C/man2/sigaltstack.2:135 build/C/man3/siginterrupt.3:76 build/C/man2/signal.2:100 build/C/man2/signalfd.2:262 build/C/man2/sigpending.2:54 build/C/man2/sigprocmask.2:94 build/C/man3/sigqueue.3:89 build/C/man3/sigset.3:152 build/C/man3/sigsetops.3:121 build/C/man2/sigsuspend.2:72 build/C/man3/sigvec.3:214 build/C/man3/sigwait.3:71 build/C/man2/sigwaitinfo.2:110 build/C/man3/sysv_signal.3:55 build/C/man2/timer_create.2:173 build/C/man2/timer_delete.2:57 build/C/man2/timer_getoverrun.2:87 build/C/man2/timer_settime.2:178 build/C/man2/timerfd_create.2:301 build/C/man2/tkill.2:73 build/C/man2/wait.2:383 build/C/man2/wait4.2:130
114 #, no-wrap
115 msgid "ERRORS"
116 msgstr ""
117
118 #. type: Plain text
119 #: build/C/man3/bsd_signal.3:61 build/C/man3/sysv_signal.3:58
120 msgid "As for B<signal>(2)."
121 msgstr ""
122
123 #. type: SH
124 #: build/C/man3/bsd_signal.3:61 build/C/man2/eventfd.2:266 build/C/man2/getitimer.2:143 build/C/man3/gsignal.3:93 build/C/man2/kill.2:120 build/C/man2/killpg.2:110 build/C/man2/pause.2:57 build/C/man2/prctl.2:725 build/C/man3/profil.3:68 build/C/man3/psignal.3:97 build/C/man3/raise.3:62 build/C/man2/rt_sigqueueinfo.2:171 build/C/man2/sgetmask.2:61 build/C/man2/sigaction.2:671 build/C/man2/sigaltstack.2:154 build/C/man7/sigevent.7:128 build/C/man3/siginterrupt.3:80 build/C/man2/signal.2:105 build/C/man7/signal.7:836 build/C/man2/signalfd.2:304 build/C/man3/sigpause.3:54 build/C/man2/sigpending.2:59 build/C/man2/sigprocmask.2:107 build/C/man3/sigqueue.3:112 build/C/man2/sigreturn.2:58 build/C/man3/sigset.3:171 build/C/man3/sigsetops.3:126 build/C/man2/sigsuspend.2:80 build/C/man3/sigvec.3:219 build/C/man3/sigwait.3:77 build/C/man2/sigwaitinfo.2:129 build/C/man3/sysv_signal.3:58 build/C/man2/timer_create.2:191 build/C/man2/timer_delete.2:64 build/C/man2/timer_getoverrun.2:94 build/C/man2/timer_settime.2:203 build/C/man2/timerfd_create.2:370 build/C/man2/tkill.2:90 build/C/man2/wait.2:421 build/C/man2/wait4.2:133
125 #, no-wrap
126 msgid "CONFORMING TO"
127 msgstr ""
128
129 #. type: Plain text
130 #: build/C/man3/bsd_signal.3:68
131 msgid ""
132 "4.2BSD, POSIX.1-2001.  POSIX.1-2008 removes the specification of "
133 "B<bsd_signal>(), recommending the use of B<sigaction>(2)  instead."
134 msgstr ""
135
136 #. type: SH
137 #: build/C/man3/bsd_signal.3:68 build/C/man2/eventfd.2:271 build/C/man2/getitimer.2:153 build/C/man2/kill.2:122 build/C/man2/killpg.2:114 build/C/man3/raise.3:64 build/C/man2/rt_sigqueueinfo.2:173 build/C/man2/sgetmask.2:63 build/C/man2/sigaction.2:674 build/C/man2/sigaltstack.2:156 build/C/man2/signal.2:107 build/C/man2/signalfd.2:309 build/C/man3/sigpause.3:58 build/C/man2/sigpending.2:61 build/C/man2/sigprocmask.2:109 build/C/man3/sigqueue.3:114 build/C/man2/sigreturn.2:62 build/C/man3/sigset.3:188 build/C/man3/sigsetops.3:128 build/C/man2/sigsuspend.2:82 build/C/man3/sigvec.3:225 build/C/man3/sigwait.3:79 build/C/man2/sigwaitinfo.2:131 build/C/man3/sysv_signal.3:60 build/C/man2/timer_create.2:193 build/C/man2/timer_getoverrun.2:96 build/C/man2/tkill.2:96 build/C/man2/wait.2:423 build/C/man2/wait4.2:135
138 #, no-wrap
139 msgid "NOTES"
140 msgstr ""
141
142 #. type: Plain text
143 #: build/C/man3/bsd_signal.3:74
144 msgid "Use of B<bsd_signal>()  should be avoided; use B<sigaction>(2)  instead."
145 msgstr ""
146
147 #. type: Plain text
148 #: build/C/man3/bsd_signal.3:85
149 msgid ""
150 "On modern Linux systems, B<bsd_signal>()  and B<signal>(2)  are equivalent.  "
151 "But on older systems, B<signal>(2)  provided unreliable signal semantics; "
152 "see B<signal>(2)  for details."
153 msgstr ""
154
155 #. type: Plain text
156 #: build/C/man3/bsd_signal.3:92 build/C/man3/sysv_signal.3:85
157 msgid ""
158 "The use of I<sighandler_t> is a GNU extension; this type is only defined if "
159 "the B<_GNU_SOURCE> feature test macro is defined."
160 msgstr ""
161
162 #. type: SH
163 #: build/C/man3/bsd_signal.3:92 build/C/man2/eventfd.2:417 build/C/man2/getitimer.2:219 build/C/man3/gsignal.3:101 build/C/man2/kill.2:170 build/C/man2/killpg.2:133 build/C/man2/pause.2:59 build/C/man2/prctl.2:739 build/C/man3/profil.3:79 build/C/man3/psignal.3:111 build/C/man3/raise.3:75 build/C/man2/rt_sigqueueinfo.2:183 build/C/man2/sgetmask.2:74 build/C/man2/sigaction.2:787 build/C/man2/sigaltstack.2:230 build/C/man7/sigevent.7:130 build/C/man3/siginterrupt.3:89 build/C/man2/signal.2:260 build/C/man7/signal.7:848 build/C/man2/signalfd.2:430 build/C/man3/sigpause.3:96 build/C/man2/sigpending.2:82 build/C/man2/sigprocmask.2:139 build/C/man3/sigqueue.3:147 build/C/man2/sigreturn.2:72 build/C/man3/sigset.3:264 build/C/man3/sigsetops.3:166 build/C/man2/sigsuspend.2:104 build/C/man3/sigvec.3:250 build/C/man3/sigwait.3:86 build/C/man2/sigwaitinfo.2:182 build/C/man3/sysv_signal.3:85 build/C/man2/timer_create.2:397 build/C/man2/timer_delete.2:66 build/C/man2/timer_getoverrun.2:128 build/C/man2/timer_settime.2:208 build/C/man2/timerfd_create.2:540 build/C/man2/tkill.2:105 build/C/man2/wait.2:605 build/C/man2/wait4.2:153
164 #, no-wrap
165 msgid "SEE ALSO"
166 msgstr ""
167
168 #. type: Plain text
169 #: build/C/man3/bsd_signal.3:97
170 msgid "B<sigaction>(2), B<signal>(2), B<sysv_signal>(3), B<signal>(7)"
171 msgstr ""
172
173 #. type: SH
174 #: build/C/man3/bsd_signal.3:97 build/C/man2/eventfd.2:428 build/C/man2/getitimer.2:226 build/C/man3/gsignal.3:105 build/C/man2/kill.2:180 build/C/man2/killpg.2:139 build/C/man2/pause.2:64 build/C/man2/prctl.2:742 build/C/man3/profil.3:84 build/C/man3/psignal.3:116 build/C/man3/raise.3:82 build/C/man2/rt_sigqueueinfo.2:191 build/C/man2/sgetmask.2:77 build/C/man2/sigaction.2:806 build/C/man2/sigaltstack.2:237 build/C/man7/sigevent.7:140 build/C/man3/siginterrupt.3:91 build/C/man2/signal.2:279 build/C/man7/signal.7:881 build/C/man2/signalfd.2:443 build/C/man3/sigpause.3:104 build/C/man2/sigpending.2:90 build/C/man2/sigprocmask.2:150 build/C/man3/sigqueue.3:155 build/C/man2/sigreturn.2:77 build/C/man3/sigset.3:274 build/C/man3/sigsetops.3:171 build/C/man2/sigsuspend.2:114 build/C/man3/sigvec.3:260 build/C/man3/sigwait.3:94 build/C/man2/sigwaitinfo.2:194 build/C/man3/sysv_signal.3:90 build/C/man2/timer_create.2:410 build/C/man2/timer_delete.2:72 build/C/man2/timer_getoverrun.2:138 build/C/man2/timer_settime.2:212 build/C/man2/timerfd_create.2:552 build/C/man2/tkill.2:110 build/C/man2/wait.2:617 build/C/man2/wait4.2:160
175 #, no-wrap
176 msgid "COLOPHON"
177 msgstr ""
178
179 #. type: Plain text
180 #: build/C/man3/bsd_signal.3:104 build/C/man2/eventfd.2:435 build/C/man2/getitimer.2:233 build/C/man3/gsignal.3:112 build/C/man2/kill.2:187 build/C/man2/killpg.2:146 build/C/man2/pause.2:71 build/C/man2/prctl.2:749 build/C/man3/profil.3:91 build/C/man3/psignal.3:123 build/C/man3/raise.3:89 build/C/man2/rt_sigqueueinfo.2:198 build/C/man2/sgetmask.2:84 build/C/man2/sigaction.2:813 build/C/man2/sigaltstack.2:244 build/C/man7/sigevent.7:147 build/C/man3/siginterrupt.3:98 build/C/man2/signal.2:286 build/C/man7/signal.7:888 build/C/man2/signalfd.2:450 build/C/man3/sigpause.3:111 build/C/man2/sigpending.2:97 build/C/man2/sigprocmask.2:157 build/C/man3/sigqueue.3:162 build/C/man2/sigreturn.2:84 build/C/man3/sigset.3:281 build/C/man3/sigsetops.3:178 build/C/man2/sigsuspend.2:121 build/C/man3/sigvec.3:267 build/C/man3/sigwait.3:101 build/C/man2/sigwaitinfo.2:201 build/C/man3/sysv_signal.3:97 build/C/man2/timer_create.2:417 build/C/man2/timer_delete.2:79 build/C/man2/timer_getoverrun.2:145 build/C/man2/timer_settime.2:219 build/C/man2/timerfd_create.2:559 build/C/man2/tkill.2:117 build/C/man2/wait.2:624 build/C/man2/wait4.2:167
181 msgid ""
182 "This page is part of release 3.41 of the Linux I<man-pages> project.  A "
183 "description of the project, and information about reporting bugs, can be "
184 "found at http://www.kernel.org/doc/man-pages/."
185 msgstr ""
186
187 #. type: TH
188 #: build/C/man2/eventfd.2:21
189 #, no-wrap
190 msgid "EVENTFD"
191 msgstr ""
192
193 #. type: TH
194 #: build/C/man2/eventfd.2:21
195 #, no-wrap
196 msgid "2010-08-30"
197 msgstr ""
198
199 #. type: TH
200 #: build/C/man2/eventfd.2:21 build/C/man2/getitimer.2:7 build/C/man2/kill.2:44 build/C/man2/killpg.2:40 build/C/man2/pause.2:30 build/C/man2/prctl.2:48 build/C/man3/profil.3:28 build/C/man2/rt_sigqueueinfo.2:23 build/C/man2/sgetmask.2:24 build/C/man2/sigaction.2:45 build/C/man2/sigaltstack.2:25 build/C/man2/signal.2:34 build/C/man7/signal.7:44 build/C/man2/signalfd.2:19 build/C/man3/sigpause.3:23 build/C/man2/sigpending.2:27 build/C/man2/sigprocmask.2:27 build/C/man3/sigqueue.3:26 build/C/man2/sigreturn.2:27 build/C/man3/sigset.3:24 build/C/man3/sigsetops.3:29 build/C/man2/sigsuspend.2:27 build/C/man3/sigvec.3:24 build/C/man3/sigwait.3:24 build/C/man2/sigwaitinfo.2:23 build/C/man2/timer_create.2:29 build/C/man2/timer_delete.2:23 build/C/man2/timer_getoverrun.2:23 build/C/man2/timer_settime.2:23 build/C/man2/timerfd_create.2:20 build/C/man2/tkill.2:29 build/C/man2/wait.2:50 build/C/man2/wait4.2:34
201 #, no-wrap
202 msgid "Linux"
203 msgstr ""
204
205 #. type: Plain text
206 #: build/C/man2/eventfd.2:24
207 msgid "eventfd - create a file descriptor for event notification"
208 msgstr ""
209
210 #. type: Plain text
211 #: build/C/man2/eventfd.2:26
212 msgid "B<#include E<lt>sys/eventfd.hE<gt>>"
213 msgstr ""
214
215 #. type: Plain text
216 #: build/C/man2/eventfd.2:28
217 msgid "B<int eventfd(unsigned int >I<initval>B<, int >I<flags>B<);>"
218 msgstr ""
219
220 #. type: Plain text
221 #: build/C/man2/eventfd.2:38
222 msgid ""
223 "B<eventfd>()  creates an \"eventfd object\" that can be used as an event "
224 "wait/notify mechanism by userspace applications, and by the kernel to notify "
225 "userspace applications of events.  The object contains an unsigned 64-bit "
226 "integer (I<uint64_t>)  counter that is maintained by the kernel.  This "
227 "counter is initialized with the value specified in the argument I<initval>."
228 msgstr ""
229
230 #. type: Plain text
231 #: build/C/man2/eventfd.2:43
232 msgid ""
233 "The following values may be bitwise ORed in I<flags> to change the behaviour "
234 "of B<eventfd>():"
235 msgstr ""
236
237 #. type: TP
238 #: build/C/man2/eventfd.2:43
239 #, no-wrap
240 msgid "B<EFD_CLOEXEC> (since Linux 2.6.27)"
241 msgstr ""
242
243 #. type: Plain text
244 #: build/C/man2/eventfd.2:53 build/C/man2/signalfd.2:94 build/C/man2/timerfd_create.2:102
245 msgid ""
246 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
247 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
248 "may be useful."
249 msgstr ""
250
251 #. type: TP
252 #: build/C/man2/eventfd.2:53
253 #, no-wrap
254 msgid "B<EFD_NONBLOCK> (since Linux 2.6.27)"
255 msgstr ""
256
257 #. type: Plain text
258 #: build/C/man2/eventfd.2:61 build/C/man2/signalfd.2:84 build/C/man2/timerfd_create.2:92
259 msgid ""
260 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
261 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same "
262 "result."
263 msgstr ""
264
265 #. type: TP
266 #: build/C/man2/eventfd.2:61
267 #, no-wrap
268 msgid "B<EFD_SEMAPHORE> (since Linux 2.6.30)"
269 msgstr ""
270
271 #. type: Plain text
272 #: build/C/man2/eventfd.2:65
273 msgid ""
274 "Provide semaphore-like semantics for reads from the new file descriptor.  "
275 "See below."
276 msgstr ""
277
278 #. type: Plain text
279 #: build/C/man2/eventfd.2:69 build/C/man2/signalfd.2:98
280 msgid ""
281 "In Linux up to version 2.6.26, the I<flags> argument is unused, and must be "
282 "specified as zero."
283 msgstr ""
284
285 #. type: Plain text
286 #: build/C/man2/eventfd.2:75
287 msgid ""
288 "As its return value, B<eventfd>()  returns a new file descriptor that can be "
289 "used to refer to the eventfd object.  The following operations can be "
290 "performed on the file descriptor:"
291 msgstr ""
292
293 #. type: TP
294 #: build/C/man2/eventfd.2:75 build/C/man2/signalfd.2:101 build/C/man2/timerfd_create.2:210
295 #, no-wrap
296 msgid "B<read>(2)"
297 msgstr ""
298
299 #. type: Plain text
300 #: build/C/man2/eventfd.2:85
301 msgid ""
302 "Each successful B<read>(2)  returns an 8-byte integer.  A B<read>(2)  will "
303 "fail with the error B<EINVAL> if the size of the supplied buffer is less "
304 "than 8 bytes."
305 msgstr ""
306
307 #. type: Plain text
308 #: build/C/man2/eventfd.2:90
309 msgid ""
310 "The value returned by B<read>(2)  is in host byte order, i.e., the native "
311 "byte order for integers on the host machine."
312 msgstr ""
313
314 #. type: Plain text
315 #: build/C/man2/eventfd.2:97
316 msgid ""
317 "The semantics of B<read>(2)  depend on whether the eventfd counter currently "
318 "has a nonzero value and whether the B<EFD_SEMAPHORE> flag was specified when "
319 "creating the eventfd file descriptor:"
320 msgstr ""
321
322 #. type: IP
323 #: build/C/man2/eventfd.2:98 build/C/man2/eventfd.2:105 build/C/man2/eventfd.2:112 build/C/man2/eventfd.2:157 build/C/man2/eventfd.2:167 build/C/man2/eventfd.2:177 build/C/man2/prctl.2:606 build/C/man2/prctl.2:611 build/C/man2/prctl.2:616 build/C/man2/prctl.2:626 build/C/man3/psignal.3:103 build/C/man3/psignal.3:107 build/C/man2/sigaction.2:294 build/C/man2/sigaction.2:309 build/C/man2/sigaction.2:325 build/C/man2/sigaction.2:340 build/C/man2/sigaction.2:387 build/C/man2/sigaction.2:423 build/C/man2/signal.2:66 build/C/man2/signal.2:71 build/C/man2/signal.2:78 build/C/man2/signal.2:206 build/C/man2/signal.2:210 build/C/man2/signal.2:249 build/C/man7/signal.7:147 build/C/man7/signal.7:155 build/C/man7/signal.7:613 build/C/man7/signal.7:615 build/C/man7/signal.7:636 build/C/man7/signal.7:651 build/C/man7/signal.7:655 build/C/man7/signal.7:662 build/C/man7/signal.7:678 build/C/man7/signal.7:684 build/C/man7/signal.7:691 build/C/man7/signal.7:696 build/C/man7/signal.7:715 build/C/man7/signal.7:734 build/C/man7/signal.7:741 build/C/man7/signal.7:750 build/C/man7/signal.7:758 build/C/man7/signal.7:764 build/C/man7/signal.7:769 build/C/man7/signal.7:789 build/C/man7/signal.7:808 build/C/man7/signal.7:811 build/C/man7/signal.7:814 build/C/man7/signal.7:817 build/C/man7/signal.7:822 build/C/man7/signal.7:828 build/C/man7/signal.7:832 build/C/man3/sigwait.3:59 build/C/man3/sigwait.3:64 build/C/man2/timer_create.2:214 build/C/man2/timer_create.2:217 build/C/man2/timer_create.2:220 build/C/man2/timer_create.2:224 build/C/man2/timer_create.2:227 build/C/man2/timer_create.2:233 build/C/man2/timer_create.2:237
324 #, no-wrap
325 msgid "*"
326 msgstr ""
327
328 #. type: Plain text
329 #: build/C/man2/eventfd.2:105
330 msgid ""
331 "If B<EFD_SEMAPHORE> was not specified and the eventfd counter has a nonzero "
332 "value, then a B<read>(2)  returns 8 bytes containing that value, and the "
333 "counter's value is reset to zero."
334 msgstr ""
335
336 #. type: Plain text
337 #: build/C/man2/eventfd.2:112
338 msgid ""
339 "If B<EFD_SEMAPHORE> was specified and the eventfd counter has a nonzero "
340 "value, then a B<read>(2)  returns 8 bytes containing the value 1, and the "
341 "counter's value is decremented by 1."
342 msgstr ""
343
344 #. type: Plain text
345 #: build/C/man2/eventfd.2:122
346 msgid ""
347 "If the eventfd counter is zero at the time of the call to B<read>(2), then "
348 "the call either blocks until the counter becomes nonzero (at which time, the "
349 "B<read>(2)  proceeds as described above)  or fails with the error B<EAGAIN> "
350 "if the file descriptor has been made nonblocking."
351 msgstr ""
352
353 #. type: TP
354 #: build/C/man2/eventfd.2:123
355 #, no-wrap
356 msgid "B<write>(2)"
357 msgstr ""
358
359 #. type: Plain text
360 #: build/C/man2/eventfd.2:140
361 msgid ""
362 "A B<write>(2)  call adds the 8-byte integer value supplied in its buffer to "
363 "the counter.  The maximum value that may be stored in the counter is the "
364 "largest unsigned 64-bit value minus 1 (i.e., 0xfffffffffffffffe).  If the "
365 "addition would cause the counter's value to exceed the maximum, then the "
366 "B<write>(2)  either blocks until a B<read>(2)  is performed on the file "
367 "descriptor, or fails with the error B<EAGAIN> if the file descriptor has "
368 "been made nonblocking."
369 msgstr ""
370
371 #. type: Plain text
372 #: build/C/man2/eventfd.2:147
373 msgid ""
374 "A B<write>(2)  will fail with the error B<EINVAL> if the size of the "
375 "supplied buffer is less than 8 bytes, or if an attempt is made to write the "
376 "value 0xffffffffffffffff."
377 msgstr ""
378
379 #. type: TP
380 #: build/C/man2/eventfd.2:147 build/C/man2/signalfd.2:139 build/C/man2/timerfd_create.2:243
381 #, no-wrap
382 msgid "B<poll>(2), B<select>(2) (and similar)"
383 msgstr ""
384
385 #. type: Plain text
386 #: build/C/man2/eventfd.2:156
387 msgid ""
388 "The returned file descriptor supports B<poll>(2)  (and analogously "
389 "B<epoll>(7))  and B<select>(2), as follows:"
390 msgstr ""
391
392 #. type: Plain text
393 #: build/C/man2/eventfd.2:167
394 msgid ""
395 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
396 "B<poll>(2)  B<POLLIN> flag)  if the counter has a value greater than 0."
397 msgstr ""
398
399 #. type: Plain text
400 #: build/C/man2/eventfd.2:177
401 msgid ""
402 "The file descriptor is writable (the B<select>(2)  I<writefds> argument; the "
403 "B<poll>(2)  B<POLLOUT> flag)  if it is possible to write a value of at least "
404 "\"1\" without blocking."
405 msgstr ""
406
407 #. type: Plain text
408 #: build/C/man2/eventfd.2:197
409 msgid ""
410 "If an overflow of the counter value was detected, then B<select>(2)  "
411 "indicates the file descriptor as being both readable and writable, and "
412 "B<poll>(2)  returns a B<POLLERR> event.  As noted above, B<write>(2)  can "
413 "never overflow the counter.  However an overflow can occur if 2^64 eventfd "
414 "\"signal posts\" were performed by the KAIO subsystem (theoretically "
415 "possible, but practically unlikely).  If an overflow has occurred, then "
416 "B<read>(2)  will return that maximum I<uint64_t> value (i.e., "
417 "0xffffffffffffffff)."
418 msgstr ""
419
420 #. type: Plain text
421 #: build/C/man2/eventfd.2:205
422 msgid ""
423 "The eventfd file descriptor also supports the other file-descriptor "
424 "multiplexing APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
425 msgstr ""
426
427 #. type: TP
428 #: build/C/man2/eventfd.2:205 build/C/man2/signalfd.2:159 build/C/man2/timerfd_create.2:261
429 #, no-wrap
430 msgid "B<close>(2)"
431 msgstr ""
432
433 #. type: Plain text
434 #: build/C/man2/eventfd.2:210
435 msgid ""
436 "When the file descriptor is no longer required it should be closed.  When "
437 "all file descriptors associated with the same eventfd object have been "
438 "closed, the resources for object are freed by the kernel."
439 msgstr ""
440
441 #. type: Plain text
442 #: build/C/man2/eventfd.2:222
443 msgid ""
444 "A copy of the file descriptor created by B<eventfd>()  is inherited by the "
445 "child produced by B<fork>(2).  The duplicate file descriptor is associated "
446 "with the same eventfd object.  File descriptors created by B<eventfd>()  are "
447 "preserved across B<execve>(2), unless the close-on-exec flag has been set."
448 msgstr ""
449
450 #. type: Plain text
451 #: build/C/man2/eventfd.2:229
452 msgid ""
453 "On success, B<eventfd>()  returns a new eventfd file descriptor.  On error, "
454 "-1 is returned and I<errno> is set to indicate the error."
455 msgstr ""
456
457 #. type: TP
458 #: build/C/man2/eventfd.2:230 build/C/man2/getitimer.2:130 build/C/man2/kill.2:105 build/C/man2/killpg.2:94 build/C/man2/prctl.2:568 build/C/man2/prctl.2:573 build/C/man2/prctl.2:585 build/C/man2/prctl.2:590 build/C/man2/prctl.2:599 build/C/man2/rt_sigqueueinfo.2:136 build/C/man2/sigaction.2:664 build/C/man2/sigaltstack.2:140 build/C/man3/siginterrupt.3:77 build/C/man2/signal.2:101 build/C/man2/signalfd.2:268 build/C/man2/signalfd.2:276 build/C/man2/sigprocmask.2:102 build/C/man3/sigqueue.3:96 build/C/man3/sigsetops.3:122 build/C/man3/sigwait.3:72 build/C/man2/sigwaitinfo.2:125 build/C/man2/timer_create.2:177 build/C/man2/timer_delete.2:58 build/C/man2/timer_getoverrun.2:88 build/C/man2/timer_settime.2:187 build/C/man2/timer_settime.2:195 build/C/man2/timerfd_create.2:304 build/C/man2/timerfd_create.2:312 build/C/man2/timerfd_create.2:348 build/C/man2/timerfd_create.2:355 build/C/man2/timerfd_create.2:361 build/C/man2/tkill.2:74 build/C/man2/wait.2:416
459 #, no-wrap
460 msgid "B<EINVAL>"
461 msgstr ""
462
463 #. type: Plain text
464 #: build/C/man2/eventfd.2:234
465 msgid "An unsupported value was specified in I<flags>."
466 msgstr ""
467
468 #. type: TP
469 #: build/C/man2/eventfd.2:234 build/C/man2/signalfd.2:283 build/C/man2/timerfd_create.2:319
470 #, no-wrap
471 msgid "B<EMFILE>"
472 msgstr ""
473
474 #. type: Plain text
475 #: build/C/man2/eventfd.2:237
476 msgid "The per-process limit on open file descriptors has been reached."
477 msgstr ""
478
479 #. type: TP
480 #: build/C/man2/eventfd.2:237 build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:322
481 #, no-wrap
482 msgid "B<ENFILE>"
483 msgstr ""
484
485 #. type: Plain text
486 #: build/C/man2/eventfd.2:241 build/C/man2/signalfd.2:290 build/C/man2/timerfd_create.2:326
487 msgid "The system-wide limit on the total number of open files has been reached."
488 msgstr ""
489
490 #. type: TP
491 #: build/C/man2/eventfd.2:241 build/C/man2/signalfd.2:290 build/C/man2/timerfd_create.2:326
492 #, no-wrap
493 msgid "B<ENODEV>"
494 msgstr ""
495
496 #. type: Plain text
497 #: build/C/man2/eventfd.2:249 build/C/man2/signalfd.2:293 build/C/man2/timerfd_create.2:329
498 msgid "Could not mount (internal) anonymous inode device."
499 msgstr ""
500
501 #. type: TP
502 #: build/C/man2/eventfd.2:249 build/C/man2/sigaltstack.2:145 build/C/man2/signalfd.2:293 build/C/man2/timer_create.2:185 build/C/man2/timerfd_create.2:329
503 #, no-wrap
504 msgid "B<ENOMEM>"
505 msgstr ""
506
507 #. type: Plain text
508 #: build/C/man2/eventfd.2:253
509 msgid "There was insufficient memory to create a new eventfd file descriptor."
510 msgstr ""
511
512 #. type: SH
513 #: build/C/man2/eventfd.2:253 build/C/man2/prctl.2:720 build/C/man3/psignal.3:93 build/C/man2/rt_sigqueueinfo.2:164 build/C/man2/signalfd.2:296 build/C/man3/sigqueue.3:110 build/C/man2/timer_create.2:189 build/C/man2/timer_delete.2:62 build/C/man2/timer_getoverrun.2:92 build/C/man2/timer_settime.2:201 build/C/man2/timerfd_create.2:367 build/C/man2/tkill.2:85
514 #, no-wrap
515 msgid "VERSIONS"
516 msgstr ""
517
518 #.  eventfd() is in glibc 2.7, but reportedly does not build
519 #. type: Plain text
520 #: build/C/man2/eventfd.2:266
521 msgid ""
522 "B<eventfd>()  is available on Linux since kernel 2.6.22.  Working support is "
523 "provided in glibc since version 2.8.  The B<eventfd2>()  system call (see "
524 "NOTES) is available on Linux since kernel 2.6.27.  Since version 2.9, the "
525 "glibc B<eventfd>()  wrapper will employ the B<eventfd2>()  system call, if "
526 "it is supported by the kernel."
527 msgstr ""
528
529 #. type: Plain text
530 #: build/C/man2/eventfd.2:271
531 msgid "B<eventfd>()  and B<eventfd2>()  are Linux-specific."
532 msgstr ""
533
534 #. type: Plain text
535 #: build/C/man2/eventfd.2:279
536 msgid ""
537 "Applications can use an eventfd file descriptor instead of a pipe (see "
538 "B<pipe>(2))  in all cases where a pipe is used simply to signal events.  The "
539 "kernel overhead of an eventfd file descriptor is much lower than that of a "
540 "pipe, and only one file descriptor is required (versus the two required for "
541 "a pipe)."
542 msgstr ""
543
544 #.  or eventually syslets/threadlets
545 #. type: Plain text
546 #: build/C/man2/eventfd.2:285
547 msgid ""
548 "When used in the kernel, an eventfd file descriptor can provide a "
549 "kernel-userspace bridge allowing, for example, functionalities like KAIO "
550 "(kernel AIO)  to signal to a file descriptor that some operation is "
551 "complete."
552 msgstr ""
553
554 #. type: Plain text
555 #: build/C/man2/eventfd.2:302
556 msgid ""
557 "A key point about an eventfd file descriptor is that it can be monitored "
558 "just like any other file descriptor using B<select>(2), B<poll>(2), or "
559 "B<epoll>(7).  This means that an application can simultaneously monitor the "
560 "readiness of \"traditional\" files and the readiness of other kernel "
561 "mechanisms that support the eventfd interface.  (Without the B<eventfd>()  "
562 "interface, these mechanisms could not be multiplexed via B<select>(2), "
563 "B<poll>(2), or B<epoll>(7).)"
564 msgstr ""
565
566 #. type: SS
567 #: build/C/man2/eventfd.2:302 build/C/man2/signalfd.2:333
568 #, no-wrap
569 msgid "Underlying Linux system calls"
570 msgstr ""
571
572 #. type: Plain text
573 #: build/C/man2/eventfd.2:316
574 msgid ""
575 "There are two underlying Linux system calls: B<eventfd>()  and the more "
576 "recent B<eventfd2>().  The former system call does not implement a I<flags> "
577 "argument.  The latter system call implements the I<flags> values described "
578 "above.  The glibc wrapper function will use B<eventfd2>()  where it is "
579 "available."
580 msgstr ""
581
582 #. type: SS
583 #: build/C/man2/eventfd.2:316
584 #, no-wrap
585 msgid "Additional glibc features"
586 msgstr ""
587
588 #. type: Plain text
589 #: build/C/man2/eventfd.2:320
590 msgid ""
591 "The GNU C library defines an additional type, and two functions that attempt "
592 "to abstract some of the details of reading and writing on an eventfd file "
593 "descriptor:"
594 msgstr ""
595
596 #. type: Plain text
597 #: build/C/man2/eventfd.2:324
598 #, no-wrap
599 msgid "typedef uint64_t eventfd_t;\n"
600 msgstr ""
601
602 #. type: Plain text
603 #: build/C/man2/eventfd.2:327
604 #, no-wrap
605 msgid ""
606 "int eventfd_read(int fd, eventfd_t *value);\n"
607 "int eventfd_write(int fd, eventfd_t value);\n"
608 msgstr ""
609
610 #. type: Plain text
611 #: build/C/man2/eventfd.2:334
612 msgid ""
613 "The functions perform the read and write operations on an eventfd file "
614 "descriptor, returning 0 if the correct number of bytes was transferred, or "
615 "-1 otherwise."
616 msgstr ""
617
618 #. type: SH
619 #: build/C/man2/eventfd.2:334 build/C/man2/sigaction.2:784 build/C/man2/sigaltstack.2:213 build/C/man2/signalfd.2:357 build/C/man3/sigwait.3:83 build/C/man2/timer_create.2:251 build/C/man2/timer_getoverrun.2:125 build/C/man2/timer_settime.2:205 build/C/man2/timerfd_create.2:372 build/C/man2/wait.2:522
620 #, no-wrap
621 msgid "EXAMPLE"
622 msgstr ""
623
624 #. type: Plain text
625 #: build/C/man2/eventfd.2:343
626 msgid ""
627 "The following program creates an eventfd file descriptor and then forks to "
628 "create a child process.  While the parent briefly sleeps, the child writes "
629 "each of the integers supplied in the program's command-line arguments to the "
630 "eventfd file descriptor.  When the parent has finished sleeping, it reads "
631 "from the eventfd file descriptor."
632 msgstr ""
633
634 #. type: Plain text
635 #: build/C/man2/eventfd.2:345
636 msgid "The following shell session shows a sample run of the program:"
637 msgstr ""
638
639 #. type: Plain text
640 #: build/C/man2/eventfd.2:357
641 #, no-wrap
642 msgid ""
643 "$B< ./a.out 1 2 4 7 14>\n"
644 "Child writing 1 to efd\n"
645 "Child writing 2 to efd\n"
646 "Child writing 4 to efd\n"
647 "Child writing 7 to efd\n"
648 "Child writing 14 to efd\n"
649 "Child completed write loop\n"
650 "Parent about to read\n"
651 "Parent read 28 (0x1c) from efd\n"
652 msgstr ""
653
654 #. type: SS
655 #: build/C/man2/eventfd.2:359 build/C/man2/signalfd.2:380 build/C/man2/timerfd_create.2:400 build/C/man2/wait.2:557
656 #, no-wrap
657 msgid "Program source"
658 msgstr ""
659
660 #. type: Plain text
661 #: build/C/man2/eventfd.2:367
662 #, no-wrap
663 msgid ""
664 "#include E<lt>sys/eventfd.hE<gt>\n"
665 "#include E<lt>unistd.hE<gt>\n"
666 "#include E<lt>stdlib.hE<gt>\n"
667 "#include E<lt>stdio.hE<gt>\n"
668 "#include E<lt>stdint.hE<gt>             /* Definition of uint64_t */\n"
669 msgstr ""
670
671 #. type: Plain text
672 #: build/C/man2/eventfd.2:370 build/C/man2/signalfd.2:391
673 #, no-wrap
674 msgid ""
675 "#define handle_error(msg) \\e\n"
676 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
677 msgstr ""
678
679 #. type: Plain text
680 #: build/C/man2/eventfd.2:377
681 #, no-wrap
682 msgid ""
683 "int\n"
684 "main(int argc, char *argv[])\n"
685 "{\n"
686 "    int efd, j;\n"
687 "    uint64_t u;\n"
688 "    ssize_t s;\n"
689 msgstr ""
690
691 #. type: Plain text
692 #: build/C/man2/eventfd.2:382
693 #, no-wrap
694 msgid ""
695 "    if (argc E<lt> 2) {\n"
696 "        fprintf(stderr, \"Usage: %s E<lt>numE<gt>...\\en\", argv[0]);\n"
697 "        exit(EXIT_FAILURE);\n"
698 "    }\n"
699 msgstr ""
700
701 #. type: Plain text
702 #: build/C/man2/eventfd.2:386
703 #, no-wrap
704 msgid ""
705 "    efd = eventfd(0, 0);\n"
706 "    if (efd == -1)\n"
707 "        handle_error(\"eventfd\");\n"
708 msgstr ""
709
710 #. type: Plain text
711 #: build/C/man2/eventfd.2:398
712 #, no-wrap
713 msgid ""
714 "    switch (fork()) {\n"
715 "    case 0:\n"
716 "        for (j = 1; j E<lt> argc; j++) {\n"
717 "            printf(\"Child writing %s to efd\\en\", argv[j]);\n"
718 "            u = strtoull(argv[j], NULL, 0);\n"
719 "                    /* strtoull() allows various bases */\n"
720 "            s = write(efd, &u, sizeof(uint64_t));\n"
721 "            if (s != sizeof(uint64_t))\n"
722 "                handle_error(\"write\");\n"
723 "        }\n"
724 "        printf(\"Child completed write loop\\en\");\n"
725 msgstr ""
726
727 #. type: Plain text
728 #: build/C/man2/eventfd.2:400
729 #, no-wrap
730 msgid "        exit(EXIT_SUCCESS);\n"
731 msgstr ""
732
733 #. type: Plain text
734 #: build/C/man2/eventfd.2:403
735 #, no-wrap
736 msgid ""
737 "    default:\n"
738 "        sleep(2);\n"
739 msgstr ""
740
741 #. type: Plain text
742 #: build/C/man2/eventfd.2:411
743 #, no-wrap
744 msgid ""
745 "        printf(\"Parent about to read\\en\");\n"
746 "        s = read(efd, &u, sizeof(uint64_t));\n"
747 "        if (s != sizeof(uint64_t))\n"
748 "            handle_error(\"read\");\n"
749 "        printf(\"Parent read %llu (0x%llx) from efd\\en\",\n"
750 "                (unsigned long long) u, (unsigned long long) u);\n"
751 "        exit(EXIT_SUCCESS);\n"
752 msgstr ""
753
754 #. type: Plain text
755 #: build/C/man2/eventfd.2:416
756 #, no-wrap
757 msgid ""
758 "    case -1:\n"
759 "        handle_error(\"fork\");\n"
760 "    }\n"
761 "}\n"
762 msgstr ""
763
764 #. type: Plain text
765 #: build/C/man2/eventfd.2:428
766 msgid ""
767 "B<futex>(2), B<pipe>(2), B<poll>(2), B<read>(2), B<select>(2), "
768 "B<signalfd>(2), B<timerfd_create>(2), B<write>(2), B<epoll>(7), "
769 "B<sem_overview>(7)"
770 msgstr ""
771
772 #. type: TH
773 #: build/C/man2/getitimer.2:7
774 #, no-wrap
775 msgid "GETITIMER"
776 msgstr ""
777
778 #. type: Plain text
779 #: build/C/man2/getitimer.2:10
780 msgid "getitimer, setitimer - get or set value of an interval timer"
781 msgstr ""
782
783 #. type: Plain text
784 #: build/C/man2/getitimer.2:13
785 #, no-wrap
786 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
787 msgstr ""
788
789 #. type: Plain text
790 #: build/C/man2/getitimer.2:15
791 #, no-wrap
792 msgid "B<int getitimer(int >I<which>B<, struct itimerval *>I<curr_value>B<);>\n"
793 msgstr ""
794
795 #. type: Plain text
796 #: build/C/man2/getitimer.2:18
797 #, no-wrap
798 msgid ""
799 "B<int setitimer(int >I<which>B<, const struct itimerval *>I<new_value>B<,>\n"
800 "B<              struct itimerval *>I<old_value>B<);>\n"
801 msgstr ""
802
803 #. type: Plain text
804 #: build/C/man2/getitimer.2:24
805 msgid ""
806 "The system provides each process with three interval timers, each "
807 "decrementing in a distinct time domain.  When any timer expires, a signal is "
808 "sent to the process, and the timer (potentially) restarts."
809 msgstr ""
810
811 #. type: TP
812 #: build/C/man2/getitimer.2:24
813 #, no-wrap
814 msgid "B<ITIMER_REAL>"
815 msgstr ""
816
817 #. type: Plain text
818 #: build/C/man2/getitimer.2:29
819 msgid "decrements in real time, and delivers B<SIGALRM> upon expiration."
820 msgstr ""
821
822 #. type: TP
823 #: build/C/man2/getitimer.2:29
824 #, no-wrap
825 msgid "B<ITIMER_VIRTUAL>"
826 msgstr ""
827
828 #. type: Plain text
829 #: build/C/man2/getitimer.2:34
830 msgid ""
831 "decrements only when the process is executing, and delivers B<SIGVTALRM> "
832 "upon expiration."
833 msgstr ""
834
835 #. type: TP
836 #: build/C/man2/getitimer.2:34
837 #, no-wrap
838 msgid "B<ITIMER_PROF>"
839 msgstr ""
840
841 #. type: Plain text
842 #: build/C/man2/getitimer.2:44
843 msgid ""
844 "decrements both when the process executes and when the system is executing "
845 "on behalf of the process.  Coupled with B<ITIMER_VIRTUAL>, this timer is "
846 "usually used to profile the time spent by the application in user and kernel "
847 "space.  B<SIGPROF> is delivered upon expiration."
848 msgstr ""
849
850 #. type: Plain text
851 #: build/C/man2/getitimer.2:46
852 msgid "Timer values are defined by the following structures:"
853 msgstr ""
854
855 #. type: Plain text
856 #: build/C/man2/getitimer.2:54
857 #, no-wrap
858 msgid ""
859 "struct itimerval {\n"
860 "    struct timeval it_interval; /* next value */\n"
861 "    struct timeval it_value;    /* current value */\n"
862 "};\n"
863 msgstr ""
864
865 #. type: Plain text
866 #: build/C/man2/getitimer.2:59
867 #, no-wrap
868 msgid ""
869 "struct timeval {\n"
870 "    long tv_sec;                /* seconds */\n"
871 "    long tv_usec;               /* microseconds */\n"
872 "};\n"
873 msgstr ""
874
875 #. type: Plain text
876 #: build/C/man2/getitimer.2:81
877 msgid ""
878 "The function B<getitimer>()  fills the structure pointed to by I<curr_value> "
879 "with the current setting for the timer specified by I<which> (one of "
880 "B<ITIMER_REAL>, B<ITIMER_VIRTUAL>, or B<ITIMER_PROF>).  The element "
881 "I<it_value> is set to the amount of time remaining on the timer, or zero if "
882 "the timer is disabled.  Similarly, I<it_interval> is set to the reset value."
883 msgstr ""
884
885 #. type: Plain text
886 #: build/C/man2/getitimer.2:89
887 msgid ""
888 "The function B<setitimer>()  sets the specified timer to the value in "
889 "I<new_value>.  If I<old_value> is non-NULL, the old value of the timer is "
890 "stored there."
891 msgstr ""
892
893 #. type: Plain text
894 #: build/C/man2/getitimer.2:99
895 msgid ""
896 "Timers decrement from I<it_value> to zero, generate a signal, and reset to "
897 "I<it_interval>.  A timer which is set to zero (I<it_value> is zero or the "
898 "timer expires and I<it_interval> is zero) stops."
899 msgstr ""
900
901 #. type: Plain text
902 #: build/C/man2/getitimer.2:105
903 msgid ""
904 "Both I<tv_sec> and I<tv_usec> are significant in determining the duration of "
905 "a timer."
906 msgstr ""
907
908 #. type: Plain text
909 #: build/C/man2/getitimer.2:117
910 msgid ""
911 "Timers will never expire before the requested time, but may expire some "
912 "(short) time afterward, which depends on the system timer resolution and on "
913 "the system load; see B<time>(7).  (But see BUGS below.)  Upon expiration, a "
914 "signal will be generated and the timer reset.  If the timer expires while "
915 "the process is active (always true for B<ITIMER_VIRTUAL>)  the signal will "
916 "be delivered immediately when generated.  Otherwise the delivery will be "
917 "offset by a small time dependent on the system loading."
918 msgstr ""
919
920 #. type: Plain text
921 #: build/C/man2/getitimer.2:122 build/C/man2/killpg.2:93 build/C/man2/tkill.2:73
922 msgid ""
923 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
924 "appropriately."
925 msgstr ""
926
927 #. type: TP
928 #: build/C/man2/getitimer.2:123 build/C/man2/prctl.2:564 build/C/man2/sigaction.2:660 build/C/man2/sigaltstack.2:136 build/C/man2/sigpending.2:55 build/C/man2/sigprocmask.2:95 build/C/man2/sigsuspend.2:73 build/C/man2/timer_settime.2:180 build/C/man2/timerfd_create.2:341
929 #, no-wrap
930 msgid "B<EFAULT>"
931 msgstr ""
932
933 #. type: Plain text
934 #: build/C/man2/getitimer.2:130 build/C/man2/timerfd_create.2:348
935 msgid "I<new_value>, I<old_value>, or I<curr_value> is not valid a pointer."
936 msgstr ""
937
938 #. type: Plain text
939 #: build/C/man2/getitimer.2:143
940 msgid ""
941 "I<which> is not one of B<ITIMER_REAL>, B<ITIMER_VIRTUAL>, or B<ITIMER_PROF>; "
942 "or (since Linux 2.6.22) one of the I<tv_usec> fields in the structure "
943 "pointed to by I<new_value> contains a value outside the range 0 to 999999."
944 msgstr ""
945
946 #. type: Plain text
947 #: build/C/man2/getitimer.2:153
948 msgid ""
949 "POSIX.1-2001, SVr4, 4.4BSD (this call first appeared in 4.2BSD).  "
950 "POSIX.1-2008 marks B<getitimer>()  and B<setitimer>()  obsolete, "
951 "recommending the use of the POSIX timers API (B<timer_gettime>(2), "
952 "B<timer_settime>(2), etc.) instead."
953 msgstr ""
954
955 #. type: Plain text
956 #: build/C/man2/getitimer.2:159
957 msgid ""
958 "A child created via B<fork>(2)  does not inherit its parent's interval "
959 "timers.  Interval timers are preserved across an B<execve>(2)."
960 msgstr ""
961
962 #. type: Plain text
963 #: build/C/man2/getitimer.2:169
964 msgid ""
965 "POSIX.1 leaves the interaction between B<setitimer>()  and the three "
966 "interfaces B<alarm>(2), B<sleep>(3), and B<usleep>(3)  unspecified."
967 msgstr ""
968
969 #. type: SH
970 #: build/C/man2/getitimer.2:169 build/C/man2/kill.2:160 build/C/man3/profil.3:70 build/C/man3/psignal.3:99 build/C/man2/sigaction.2:775 build/C/man2/signalfd.2:349 build/C/man2/sigpending.2:76 build/C/man3/sigset.3:230 build/C/man2/timer_getoverrun.2:112 build/C/man2/timerfd_create.2:534
971 #, no-wrap
972 msgid "BUGS"
973 msgstr ""
974
975 #. type: Plain text
976 #: build/C/man2/getitimer.2:178
977 msgid ""
978 "The generation and delivery of a signal are distinct, and only one instance "
979 "of each of the signals listed above may be pending for a process.  Under "
980 "very heavy loading, an B<ITIMER_REAL> timer may expire before the signal "
981 "from a previous expiration has been delivered.  The second signal in such an "
982 "event will be lost."
983 msgstr ""
984
985 #. type: Plain text
986 #: build/C/man2/getitimer.2:193
987 msgid ""
988 "On Linux kernels before 2.6.16, timer values are represented in jiffies.  If "
989 "a request is made set a timer with a value whose jiffies representation "
990 "exceeds B<MAX_SEC_IN_JIFFIES> (defined in I<include/linux/jiffies.h>), then "
991 "the timer is silently truncated to this ceiling value.  On Linux/i386 "
992 "(where, since Linux 2.6.13, the default jiffy is 0.004 seconds), this means "
993 "that the ceiling value for a timer is approximately 99.42 days.  Since Linux "
994 "2.6.16, the kernel uses a different internal representation for times, and "
995 "this ceiling is removed."
996 msgstr ""
997
998 #.  4 Jul 2005: It looks like this bug may remain in 2.4.x.
999 #.      http://lkml.org/lkml/2005/7/1/165
1000 #. type: Plain text
1001 #: build/C/man2/getitimer.2:200
1002 msgid ""
1003 "On certain systems (including i386), Linux kernels before version 2.6.12 "
1004 "have a bug which will produce premature timer expirations of up to one jiffy "
1005 "under some circumstances.  This bug is fixed in kernel 2.6.12."
1006 msgstr ""
1007
1008 #.  Bugzilla report 25 Apr 2006:
1009 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6443
1010 #.  "setitimer() should reject noncanonical arguments"
1011 #. type: Plain text
1012 #: build/C/man2/getitimer.2:219
1013 msgid ""
1014 "POSIX.1-2001 says that B<setitimer>()  should fail if a I<tv_usec> value is "
1015 "specified that is outside of the range 0 to 999999.  However, in kernels up "
1016 "to and including 2.6.21, Linux does not give an error, but instead silently "
1017 "adjusts the corresponding seconds value for the timer.  From kernel 2.6.22 "
1018 "onward, this nonconformance has been repaired: an improper I<tv_usec> value "
1019 "results in an B<EINVAL> error."
1020 msgstr ""
1021
1022 #. type: Plain text
1023 #: build/C/man2/getitimer.2:226
1024 msgid ""
1025 "B<gettimeofday>(2), B<sigaction>(2), B<signal>(2), B<timer_create>(2), "
1026 "B<timerfd_create>(2), B<time>(7)"
1027 msgstr ""
1028
1029 #. type: TH
1030 #: build/C/man3/gsignal.3:25
1031 #, no-wrap
1032 msgid "GSIGNAL"
1033 msgstr ""
1034
1035 #. type: TH
1036 #: build/C/man3/gsignal.3:25 build/C/man3/profil.3:28 build/C/man3/sigvec.3:24
1037 #, no-wrap
1038 msgid "2007-07-26"
1039 msgstr ""
1040
1041 #. type: Plain text
1042 #: build/C/man3/gsignal.3:28
1043 msgid "gsignal, ssignal - software signal facility"
1044 msgstr ""
1045
1046 #. type: Plain text
1047 #: build/C/man3/gsignal.3:31 build/C/man2/kill.2:52 build/C/man3/psignal.3:34 build/C/man3/raise.3:33 build/C/man2/sigaction.2:51 build/C/man3/siginterrupt.3:35 build/C/man3/sigpause.3:29 build/C/man3/sigwait.3:30 build/C/man2/sigwaitinfo.2:29
1048 #, no-wrap
1049 msgid "B<#include E<lt>signal.hE<gt>>\n"
1050 msgstr ""
1051
1052 #. type: Plain text
1053 #: build/C/man3/gsignal.3:33
1054 #, no-wrap
1055 msgid "B<typedef void (*sighandler_t)(int);>\n"
1056 msgstr ""
1057
1058 #. type: Plain text
1059 #: build/C/man3/gsignal.3:35
1060 #, no-wrap
1061 msgid "B<int gsignal(int >I<signum>B<);>\n"
1062 msgstr ""
1063
1064 #. type: Plain text
1065 #: build/C/man3/gsignal.3:37
1066 #, no-wrap
1067 msgid "B<sighandler_t ssignal(int >I<signum>B<, sighandler_t >I<action>B<);>\n"
1068 msgstr ""
1069
1070 #. type: Plain text
1071 #: build/C/man3/gsignal.3:42 build/C/man2/kill.2:59 build/C/man2/killpg.2:51 build/C/man3/profil.3:40 build/C/man3/psignal.3:44 build/C/man2/sigaction.2:59 build/C/man2/sigaltstack.2:36 build/C/man3/siginterrupt.3:42 build/C/man2/sigpending.2:38 build/C/man2/sigprocmask.2:39 build/C/man3/sigqueue.3:37 build/C/man3/sigset.3:43 build/C/man3/sigsetops.3:49 build/C/man2/sigsuspend.2:38 build/C/man3/sigvec.3:43 build/C/man3/sigwait.3:37 build/C/man2/sigwaitinfo.2:39 build/C/man2/timer_create.2:46 build/C/man2/timer_delete.2:38 build/C/man2/timer_getoverrun.2:38 build/C/man2/timer_settime.2:42 build/C/man2/wait.2:68 build/C/man2/wait4.2:54
1072 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1073 msgstr ""
1074
1075 #. type: Plain text
1076 #: build/C/man3/gsignal.3:47
1077 msgid "B<gsignal>(), B<ssignal>(): _SVID_SOURCE"
1078 msgstr ""
1079
1080 #. type: Plain text
1081 #: build/C/man3/gsignal.3:55
1082 msgid ""
1083 "Don't use these functions under Linux.  Due to a historical mistake, under "
1084 "Linux these functions are aliases for B<raise>(3)  and B<signal>(2), "
1085 "respectively."
1086 msgstr ""
1087
1088 #. type: Plain text
1089 #: build/C/man3/gsignal.3:93
1090 msgid ""
1091 "Elsewhere, on System V-like systems, these functions implement software "
1092 "signaling, entirely independent of the classical B<signal>(2)  and "
1093 "B<kill>(2)  functions.  The function B<ssignal>()  defines the action to "
1094 "take when the software signal with number I<signum> is raised using the "
1095 "function B<gsignal>(), and returns the previous such action or B<SIG_DFL>.  "
1096 "The function B<gsignal>()  does the following: if no action (or the action "
1097 "B<SIG_DFL>)  was specified for I<signum>, then it does nothing and returns "
1098 "0.  If the action B<SIG_IGN> was specified for I<signum>, then it does "
1099 "nothing and returns 1.  Otherwise, it resets the action to B<SIG_DFL> and "
1100 "calls the action function with argument I<signum>, and returns the value "
1101 "returned by that function.  The range of possible values I<signum> varies "
1102 "(often 1-15 or 1-17)."
1103 msgstr ""
1104
1105 #. type: Plain text
1106 #: build/C/man3/gsignal.3:101
1107 msgid ""
1108 "These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.  "
1109 "They are called obsolete under most of these systems, and are broken under "
1110 "Linux libc and glibc.  Some systems also have B<gsignal_r>()  and "
1111 "B<ssignal_r>()."
1112 msgstr ""
1113
1114 #. type: Plain text
1115 #: build/C/man3/gsignal.3:105
1116 msgid "B<kill>(2), B<signal>(2), B<raise>(3)"
1117 msgstr ""
1118
1119 #. type: TH
1120 #: build/C/man2/kill.2:44
1121 #, no-wrap
1122 msgid "KILL"
1123 msgstr ""
1124
1125 #. type: TH
1126 #: build/C/man2/kill.2:44
1127 #, no-wrap
1128 msgid "2009-09-15"
1129 msgstr ""
1130
1131 #. type: Plain text
1132 #: build/C/man2/kill.2:47
1133 msgid "kill - send signal to a process"
1134 msgstr ""
1135
1136 #. type: Plain text
1137 #: build/C/man2/kill.2:50
1138 #, no-wrap
1139 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
1140 msgstr ""
1141
1142 #. type: Plain text
1143 #: build/C/man2/kill.2:54
1144 #, no-wrap
1145 msgid "B<int kill(pid_t >I<pid>B<, int >I<sig>B<);>\n"
1146 msgstr ""
1147
1148 #. type: Plain text
1149 #: build/C/man2/kill.2:64
1150 msgid "B<kill>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1151 msgstr ""
1152
1153 #. type: Plain text
1154 #: build/C/man2/kill.2:70
1155 msgid ""
1156 "The B<kill>()  system call can be used to send any signal to any process "
1157 "group or process."
1158 msgstr ""
1159
1160 #. type: Plain text
1161 #: build/C/man2/kill.2:73
1162 msgid ""
1163 "If I<pid> is positive, then signal I<sig> is sent to the process with the ID "
1164 "specified by I<pid>."
1165 msgstr ""
1166
1167 #. type: Plain text
1168 #: build/C/man2/kill.2:76
1169 msgid ""
1170 "If I<pid> equals 0, then I<sig> is sent to every process in the process "
1171 "group of the calling process."
1172 msgstr ""
1173
1174 #. type: Plain text
1175 #: build/C/man2/kill.2:80
1176 msgid ""
1177 "If I<pid> equals -1, then I<sig> is sent to every process for which the "
1178 "calling process has permission to send signals, except for process 1 "
1179 "(I<init>), but see below."
1180 msgstr ""
1181
1182 #. type: Plain text
1183 #: build/C/man2/kill.2:83
1184 msgid ""
1185 "If I<pid> is less than -1, then I<sig> is sent to every process in the "
1186 "process group whose ID is I<-pid>."
1187 msgstr ""
1188
1189 #. type: Plain text
1190 #: build/C/man2/kill.2:88
1191 msgid ""
1192 "If I<sig> is 0, then no signal is sent, but error checking is still "
1193 "performed; this can be used to check for the existence of a process ID or "
1194 "process group ID."
1195 msgstr ""
1196
1197 #. type: Plain text
1198 #: build/C/man2/kill.2:99 build/C/man2/killpg.2:88
1199 msgid ""
1200 "For a process to have permission to send a signal it must either be "
1201 "privileged (under Linux: have the B<CAP_KILL> capability), or the real or "
1202 "effective user ID of the sending process must equal the real or saved "
1203 "set-user-ID of the target process.  In the case of B<SIGCONT> it suffices "
1204 "when the sending and receiving processes belong to the same session."
1205 msgstr ""
1206
1207 #. type: Plain text
1208 #: build/C/man2/kill.2:104
1209 msgid ""
1210 "On success (at least one signal was sent), zero is returned.  On error, -1 "
1211 "is returned, and I<errno> is set appropriately."
1212 msgstr ""
1213
1214 #. type: Plain text
1215 #: build/C/man2/kill.2:108
1216 msgid "An invalid signal was specified."
1217 msgstr ""
1218
1219 #. type: TP
1220 #: build/C/man2/kill.2:108 build/C/man2/killpg.2:98 build/C/man2/prctl.2:639 build/C/man2/prctl.2:651 build/C/man2/prctl.2:661 build/C/man2/prctl.2:669 build/C/man2/rt_sigqueueinfo.2:143 build/C/man2/sigaltstack.2:149 build/C/man3/sigqueue.3:100 build/C/man2/tkill.2:77
1221 #, no-wrap
1222 msgid "B<EPERM>"
1223 msgstr ""
1224
1225 #. type: Plain text
1226 #: build/C/man2/kill.2:112 build/C/man2/killpg.2:102
1227 msgid ""
1228 "The process does not have permission to send the signal to any of the target "
1229 "processes."
1230 msgstr ""
1231
1232 #. type: TP
1233 #: build/C/man2/kill.2:112 build/C/man2/killpg.2:102 build/C/man2/killpg.2:106 build/C/man2/rt_sigqueueinfo.2:151 build/C/man3/sigqueue.3:106 build/C/man2/tkill.2:82
1234 #, no-wrap
1235 msgid "B<ESRCH>"
1236 msgstr ""
1237
1238 #. type: Plain text
1239 #: build/C/man2/kill.2:120
1240 msgid ""
1241 "The pid or process group does not exist.  Note that an existing process "
1242 "might be a zombie, a process which already committed termination, but has "
1243 "not yet been B<wait>(2)ed for."
1244 msgstr ""
1245
1246 #. type: Plain text
1247 #: build/C/man2/kill.2:122 build/C/man2/pause.2:59 build/C/man2/wait.2:423
1248 msgid "SVr4, 4.3BSD, POSIX.1-2001."
1249 msgstr ""
1250
1251 #. type: Plain text
1252 #: build/C/man2/kill.2:130
1253 msgid ""
1254 "The only signals that can be sent to process ID 1, the I<init> process, are "
1255 "those for which I<init> has explicitly installed signal handlers.  This is "
1256 "done to assure the system is not brought down accidentally."
1257 msgstr ""
1258
1259 #. type: Plain text
1260 #: build/C/man2/kill.2:136
1261 msgid ""
1262 "POSIX.1-2001 requires that I<kill(-1,sig)> send I<sig> to all processes that "
1263 "the calling process may send signals to, except possibly for some "
1264 "implementation-defined system processes.  Linux allows a process to signal "
1265 "itself, but on Linux the call I<kill(-1,sig)> does not signal the calling "
1266 "process."
1267 msgstr ""
1268
1269 #. type: Plain text
1270 #: build/C/man2/kill.2:146
1271 msgid ""
1272 "POSIX.1-2001 requires that if a process sends a signal to itself, and the "
1273 "sending thread does not have the signal blocked, and no other thread has it "
1274 "unblocked or is waiting for it in B<sigwait>(3), at least one unblocked "
1275 "signal must be delivered to the sending thread before the B<kill>()  "
1276 "returns."
1277 msgstr ""
1278
1279 #. type: SS
1280 #: build/C/man2/kill.2:146 build/C/man3/sigpause.3:75 build/C/man2/wait.2:477
1281 #, no-wrap
1282 msgid "Linux Notes"
1283 msgstr ""
1284
1285 #.  In the 0.* kernels things chopped and changed quite
1286 #.  a bit - MTK, 24 Jul 02
1287 #. type: Plain text
1288 #: build/C/man2/kill.2:160
1289 msgid ""
1290 "Across different kernel versions, Linux has enforced different rules for the "
1291 "permissions required for an unprivileged process to send a signal to another "
1292 "process.  In kernels 1.0 to 1.2.2, a signal could be sent if the effective "
1293 "user ID of the sender matched that of the receiver, or the real user ID of "
1294 "the sender matched that of the receiver.  From kernel 1.2.3 until 1.3.77, a "
1295 "signal could be sent if the effective user ID of the sender matched either "
1296 "the real or effective user ID of the receiver.  The current rules, which "
1297 "conform to POSIX.1-2001, were adopted in kernel 1.3.78."
1298 msgstr ""
1299
1300 #. type: Plain text
1301 #: build/C/man2/kill.2:170
1302 msgid ""
1303 "In 2.6 kernels up to and including 2.6.7, there was a bug that meant that "
1304 "when sending signals to a process group, B<kill>()  failed with the error "
1305 "B<EPERM> if the caller did have permission to send the signal to I<any> "
1306 "(rather than I<all>) of the members of the process group.  Notwithstanding "
1307 "this error return, the signal was still delivered to all of the processes "
1308 "for which the caller had permission to signal."
1309 msgstr ""
1310
1311 #. type: Plain text
1312 #: build/C/man2/kill.2:180
1313 msgid ""
1314 "B<_exit>(2), B<killpg>(2), B<signal>(2), B<tkill>(2), B<exit>(3), "
1315 "B<sigqueue>(3), B<capabilities>(7), B<credentials>(7), B<signal>(7)"
1316 msgstr ""
1317
1318 #. type: TH
1319 #: build/C/man2/killpg.2:40
1320 #, no-wrap
1321 msgid "KILLPG"
1322 msgstr ""
1323
1324 #. type: TH
1325 #: build/C/man2/killpg.2:40 build/C/man3/sigset.3:24 build/C/man2/wait4.2:34
1326 #, no-wrap
1327 msgid "2010-09-20"
1328 msgstr ""
1329
1330 #. type: Plain text
1331 #: build/C/man2/killpg.2:43
1332 msgid "killpg - send signal to a process group"
1333 msgstr ""
1334
1335 #. type: Plain text
1336 #: build/C/man2/killpg.2:47
1337 msgid "B<int killpg(int >I<pgrp>B<, int >I<sig>B<);>"
1338 msgstr ""
1339
1340 #. type: TP
1341 #: build/C/man2/killpg.2:54
1342 #, no-wrap
1343 msgid "B<killpg>():"
1344 msgstr ""
1345
1346 #. type: Plain text
1347 #: build/C/man2/killpg.2:58 build/C/man2/sigaltstack.2:44 build/C/man3/siginterrupt.3:49 build/C/man2/wait4.2:61
1348 msgid ""
1349 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
1350 "_XOPEN_SOURCE_EXTENDED"
1351 msgstr ""
1352
1353 #. type: Plain text
1354 #: build/C/man2/killpg.2:68
1355 msgid ""
1356 "B<killpg>()  sends the signal I<sig> to the process group I<pgrp>.  See "
1357 "B<signal>(7)  for a list of signals."
1358 msgstr ""
1359
1360 #. type: Plain text
1361 #: build/C/man2/killpg.2:77
1362 msgid ""
1363 "If I<pgrp> is 0, B<killpg>()  sends the signal to the calling process's "
1364 "process group.  (POSIX says: If I<pgrp> is less than or equal to 1, the "
1365 "behavior is undefined.)"
1366 msgstr ""
1367
1368 #. type: Plain text
1369 #: build/C/man2/killpg.2:98
1370 msgid "I<Sig> is not a valid signal number."
1371 msgstr ""
1372
1373 #. type: Plain text
1374 #: build/C/man2/killpg.2:106
1375 msgid "No process can be found in the process group specified by I<pgrp>."
1376 msgstr ""
1377
1378 #. type: Plain text
1379 #: build/C/man2/killpg.2:110
1380 msgid ""
1381 "The process group was given as 0 but the sending process does not have a "
1382 "process group."
1383 msgstr ""
1384
1385 #. type: Plain text
1386 #: build/C/man2/killpg.2:114
1387 msgid ""
1388 "SVr4, 4.4BSD (the B<killpg>()  function call first appeared in 4BSD), "
1389 "POSIX.1-2001."
1390 msgstr ""
1391
1392 #. type: Plain text
1393 #: build/C/man2/killpg.2:128
1394 msgid ""
1395 "There are various differences between the permission checking in BSD-type "
1396 "systems and System V-type systems.  See the POSIX rationale for B<kill>().  "
1397 "A difference not mentioned by POSIX concerns the return value B<EPERM>: BSD "
1398 "documents that no signal is sent and B<EPERM> returned when the permission "
1399 "check failed for at least one target process, while POSIX documents B<EPERM> "
1400 "only when the permission check failed for all target processes."
1401 msgstr ""
1402
1403 #. type: Plain text
1404 #: build/C/man2/killpg.2:133
1405 msgid ""
1406 "On Linux, B<killpg>()  is implemented as a library function that makes the "
1407 "call I<kill(-pgrp,\\ sig)>."
1408 msgstr ""
1409
1410 #. type: Plain text
1411 #: build/C/man2/killpg.2:139
1412 msgid ""
1413 "B<getpgrp>(2), B<kill>(2), B<signal>(2), B<capabilities>(7), "
1414 "B<credentials>(7)"
1415 msgstr ""
1416
1417 #. type: TH
1418 #: build/C/man2/pause.2:30
1419 #, no-wrap
1420 msgid "PAUSE"
1421 msgstr ""
1422
1423 #. type: TH
1424 #: build/C/man2/pause.2:30
1425 #, no-wrap
1426 msgid "2008-10-06"
1427 msgstr ""
1428
1429 #. type: Plain text
1430 #: build/C/man2/pause.2:33
1431 msgid "pause - wait for signal"
1432 msgstr ""
1433
1434 #. type: Plain text
1435 #: build/C/man2/pause.2:35 build/C/man3/profil.3:33
1436 msgid "B<#include E<lt>unistd.hE<gt>>"
1437 msgstr ""
1438
1439 #. type: Plain text
1440 #: build/C/man2/pause.2:37
1441 msgid "B<int pause(void);>"
1442 msgstr ""
1443
1444 #. type: Plain text
1445 #: build/C/man2/pause.2:42
1446 msgid ""
1447 "B<pause>()  causes the calling process (or thread) to sleep until a signal "
1448 "is delivered that either terminates the process or causes the invocation of "
1449 "a signal-catching function."
1450 msgstr ""
1451
1452 #.  .BR ERESTARTNOHAND .
1453 #. type: Plain text
1454 #: build/C/man2/pause.2:53
1455 msgid ""
1456 "B<pause>()  only returns when a signal was caught and the signal-catching "
1457 "function returned.  In this case B<pause>()  returns -1, and I<errno> is set "
1458 "to B<EINTR>."
1459 msgstr ""
1460
1461 #. type: TP
1462 #: build/C/man2/pause.2:54 build/C/man2/sigsuspend.2:77 build/C/man2/sigwaitinfo.2:119 build/C/man2/wait.2:409
1463 #, no-wrap
1464 msgid "B<EINTR>"
1465 msgstr ""
1466
1467 #. type: Plain text
1468 #: build/C/man2/pause.2:57
1469 msgid "a signal was caught and the signal-catching function returned."
1470 msgstr ""
1471
1472 #. type: Plain text
1473 #: build/C/man2/pause.2:64
1474 msgid "B<kill>(2), B<select>(2), B<signal>(2), B<sigsuspend>(2)"
1475 msgstr ""
1476
1477 #. type: TH
1478 #: build/C/man2/prctl.2:48
1479 #, no-wrap
1480 msgid "PRCTL"
1481 msgstr ""
1482
1483 #. type: TH
1484 #: build/C/man2/prctl.2:48
1485 #, no-wrap
1486 msgid "2012-04-23"
1487 msgstr ""
1488
1489 #. type: Plain text
1490 #: build/C/man2/prctl.2:51
1491 msgid "prctl - operations on a process"
1492 msgstr ""
1493
1494 #. type: Plain text
1495 #: build/C/man2/prctl.2:54
1496 #, no-wrap
1497 msgid "B<#include E<lt>sys/prctl.hE<gt>>\n"
1498 msgstr ""
1499
1500 #. type: Plain text
1501 #: build/C/man2/prctl.2:57
1502 #, no-wrap
1503 msgid ""
1504 "B<int prctl(int >I<option>B<, unsigned long >I<arg2>B<, unsigned long "
1505 ">I<arg3>B<,>\n"
1506 "B<          unsigned long >I<arg4>B<, unsigned long >I<arg5>B<);>\n"
1507 msgstr ""
1508
1509 #. type: Plain text
1510 #: build/C/man2/prctl.2:64
1511 msgid ""
1512 "B<prctl>()  is called with a first argument describing what to do (with "
1513 "values defined in I<E<lt>linux/prctl.hE<gt>>), and further arguments with a "
1514 "significance depending on the first one.  The first argument can be:"
1515 msgstr ""
1516
1517 #. type: TP
1518 #: build/C/man2/prctl.2:64
1519 #, no-wrap
1520 msgid "B<PR_CAPBSET_READ> (since Linux 2.6.25)"
1521 msgstr ""
1522
1523 #. type: Plain text
1524 #: build/C/man2/prctl.2:76
1525 msgid ""
1526 "Return (as the function result) 1 if the capability specified in I<arg2> is "
1527 "in the calling thread's capability bounding set, or 0 if it is not.  (The "
1528 "capability constants are defined in I<E<lt>linux/capability.hE<gt>>.)  The "
1529 "capability bounding set dictates whether the process can receive the "
1530 "capability through a file's permitted capability set on a subsequent call to "
1531 "B<execve>(2)."
1532 msgstr ""
1533
1534 #. type: Plain text
1535 #: build/C/man2/prctl.2:81
1536 msgid ""
1537 "If the capability specified in I<arg2> is not valid, then the call fails "
1538 "with the error B<EINVAL>."
1539 msgstr ""
1540
1541 #. type: TP
1542 #: build/C/man2/prctl.2:81
1543 #, no-wrap
1544 msgid "B<PR_CAPBSET_DROP> (since Linux 2.6.25)"
1545 msgstr ""
1546
1547 #. type: Plain text
1548 #: build/C/man2/prctl.2:90
1549 msgid ""
1550 "If the calling thread has the B<CAP_SETPCAP> capability, then drop the "
1551 "capability specified by I<arg2> from the calling thread's capability "
1552 "bounding set.  Any children of the calling thread will inherit the newly "
1553 "reduced bounding set."
1554 msgstr ""
1555
1556 #. type: Plain text
1557 #: build/C/man2/prctl.2:102
1558 msgid ""
1559 "The call fails with the error: B<EPERM> if the calling thread does not have "
1560 "the B<CAP_SETPCAP>; B<EINVAL> if I<arg2> does not represent a valid "
1561 "capability; or B<EINVAL> if file capabilities are not enabled in the kernel, "
1562 "in which case bounding sets are not supported."
1563 msgstr ""
1564
1565 #. type: TP
1566 #: build/C/man2/prctl.2:102
1567 #, no-wrap
1568 msgid "B<PR_SET_DUMPABLE> (since Linux 2.3.20)"
1569 msgstr ""
1570
1571 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
1572 #.  Subject:    Fix prctl privilege escalation (CVE-2006-2451)
1573 #.  From:       Marcel Holtmann <marcel () holtmann ! org>
1574 #.  Date:       2006-07-12 11:12:00
1575 #. type: Plain text
1576 #: build/C/man2/prctl.2:128
1577 msgid ""
1578 "Set the state of the flag determining whether core dumps are produced for "
1579 "this process upon delivery of a signal whose default behavior is to produce "
1580 "a core dump.  (Normally this flag is set for a process by default, but it is "
1581 "cleared when a set-user-ID or set-group-ID program is executed and also by "
1582 "various system calls that manipulate process UIDs and GIDs).  In kernels up "
1583 "to and including 2.6.12, I<arg2> must be either 0 (process is not dumpable) "
1584 "or 1 (process is dumpable).  Between kernels 2.6.13 and 2.6.17, the value 2 "
1585 "was also permitted, which caused any binary which normally would not be "
1586 "dumped to be dumped readable by root only; for security reasons, this "
1587 "feature has been removed.  (See also the description of "
1588 "I</proc/sys/fs/suid_dumpable> in B<proc>(5).)  Processes that are not "
1589 "dumpable can not be attached via B<ptrace(2)> B<PTRACE_ATTACH>."
1590 msgstr ""
1591
1592 #. type: TP
1593 #: build/C/man2/prctl.2:128
1594 #, no-wrap
1595 msgid "B<PR_GET_DUMPABLE> (since Linux 2.3.20)"
1596 msgstr ""
1597
1598 #.  Since Linux 2.6.13, the dumpable flag can have the value 2,
1599 #.  but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable
1600 #.  flags has a nonzero value.  This was fixed in 2.6.14.
1601 #. type: Plain text
1602 #: build/C/man2/prctl.2:135
1603 msgid ""
1604 "Return (as the function result) the current state of the calling process's "
1605 "dumpable flag."
1606 msgstr ""
1607
1608 #. type: TP
1609 #: build/C/man2/prctl.2:135
1610 #, no-wrap
1611 msgid "B<PR_SET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1612 msgstr ""
1613
1614 #.  Respectively 0, 1, 2
1615 #. type: Plain text
1616 #: build/C/man2/prctl.2:145
1617 msgid ""
1618 "Set the endian-ness of the calling process to the value given in I<arg2>, "
1619 "which should be one of the following: B<PR_ENDIAN_BIG>, B<PR_ENDIAN_LITTLE>, "
1620 "or B<PR_ENDIAN_PPC_LITTLE> (PowerPC pseudo little endian)."
1621 msgstr ""
1622
1623 #. type: TP
1624 #: build/C/man2/prctl.2:145
1625 #, no-wrap
1626 msgid "B<PR_GET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1627 msgstr ""
1628
1629 #. type: Plain text
1630 #: build/C/man2/prctl.2:150
1631 msgid ""
1632 "Return the endian-ness of the calling process, in the location pointed to by "
1633 "I<(int\\ *) arg2>."
1634 msgstr ""
1635
1636 #. type: TP
1637 #: build/C/man2/prctl.2:150
1638 #, no-wrap
1639 msgid "B<PR_SET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1640 msgstr ""
1641
1642 #. type: Plain text
1643 #: build/C/man2/prctl.2:157
1644 msgid ""
1645 "Set floating-point emulation control bits to I<arg2>.  Pass "
1646 "B<PR_FPEMU_NOPRINT> to silently emulate fp operations accesses, or "
1647 "B<PR_FPEMU_SIGFPE> to not emulate fp operations and send B<SIGFPE> instead."
1648 msgstr ""
1649
1650 #. type: TP
1651 #: build/C/man2/prctl.2:157
1652 #, no-wrap
1653 msgid "B<PR_GET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1654 msgstr ""
1655
1656 #. type: Plain text
1657 #: build/C/man2/prctl.2:162
1658 msgid ""
1659 "Return floating-point emulation control bits, in the location pointed to by "
1660 "I<(int\\ *) arg2>."
1661 msgstr ""
1662
1663 #. type: TP
1664 #: build/C/man2/prctl.2:162
1665 #, no-wrap
1666 msgid "B<PR_SET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1667 msgstr ""
1668
1669 #. type: Plain text
1670 #: build/C/man2/prctl.2:175
1671 msgid ""
1672 "Set floating-point exception mode to I<arg2>.  Pass B<PR_FP_EXC_SW_ENABLE> "
1673 "to use FPEXC for FP exception enables, B<PR_FP_EXC_DIV> for floating-point "
1674 "divide by zero, B<PR_FP_EXC_OVF> for floating-point overflow, "
1675 "B<PR_FP_EXC_UND> for floating-point underflow, B<PR_FP_EXC_RES> for "
1676 "floating-point inexact result, B<PR_FP_EXC_INV> for floating-point invalid "
1677 "operation, B<PR_FP_EXC_DISABLED> for FP exceptions disabled, "
1678 "B<PR_FP_EXC_NONRECOV> for async nonrecoverable exception mode, "
1679 "B<PR_FP_EXC_ASYNC> for async recoverable exception mode, "
1680 "B<PR_FP_EXC_PRECISE> for precise exception mode."
1681 msgstr ""
1682
1683 #. type: TP
1684 #: build/C/man2/prctl.2:175
1685 #, no-wrap
1686 msgid "B<PR_GET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1687 msgstr ""
1688
1689 #. type: Plain text
1690 #: build/C/man2/prctl.2:180
1691 msgid ""
1692 "Return floating-point exception mode, in the location pointed to by I<(int\\ "
1693 "*) arg2>."
1694 msgstr ""
1695
1696 #. type: TP
1697 #: build/C/man2/prctl.2:180
1698 #, no-wrap
1699 msgid "B<PR_SET_KEEPCAPS> (since Linux 2.2.18)"
1700 msgstr ""
1701
1702 #. type: Plain text
1703 #: build/C/man2/prctl.2:198
1704 msgid ""
1705 "Set the state of the thread's \"keep capabilities\" flag, which determines "
1706 "whether the threads's permitted capability set is cleared when a change is "
1707 "made to the threads's user IDs such that the threads's real UID, effective "
1708 "UID, and saved set-user-ID all become nonzero when at least one of them "
1709 "previously had the value 0.  By default, the permitted capability set is "
1710 "cleared when such a change is made; setting the \"keep capabilities\" flag "
1711 "prevents it from being cleared.  I<arg2> must be either 0 (permitted "
1712 "capabilities are cleared)  or 1 (permitted capabilities are kept).  (A "
1713 "thread's I<effective> capability set is always cleared when such a "
1714 "credential change is made, regardless of the setting of the \"keep "
1715 "capabilities\" flag.)  The \"keep capabilities\" value will be reset to 0 on "
1716 "subsequent calls to B<execve>(2)."
1717 msgstr ""
1718
1719 #. type: TP
1720 #: build/C/man2/prctl.2:198
1721 #, no-wrap
1722 msgid "B<PR_GET_KEEPCAPS> (since Linux 2.2.18)"
1723 msgstr ""
1724
1725 #. type: Plain text
1726 #: build/C/man2/prctl.2:202
1727 msgid ""
1728 "Return (as the function result) the current state of the calling threads's "
1729 "\"keep capabilities\" flag."
1730 msgstr ""
1731
1732 #. type: TP
1733 #: build/C/man2/prctl.2:202
1734 #, no-wrap
1735 msgid "B<PR_SET_NAME> (since Linux 2.6.9)"
1736 msgstr ""
1737
1738 #.  TASK_COMM_LEN in include/linux/sched.h
1739 #. type: Plain text
1740 #: build/C/man2/prctl.2:210
1741 msgid ""
1742 "Set the process name for the calling process, using the value in the "
1743 "location pointed to by I<(char\\ *) arg2>.  The name can be up to 16 bytes "
1744 "long, and should be null-terminated if it contains fewer bytes."
1745 msgstr ""
1746
1747 #. type: TP
1748 #: build/C/man2/prctl.2:210
1749 #, no-wrap
1750 msgid "B<PR_GET_NAME> (since Linux 2.6.11)"
1751 msgstr ""
1752
1753 #. type: Plain text
1754 #: build/C/man2/prctl.2:217
1755 msgid ""
1756 "Return the process name for the calling process, in the buffer pointed to by "
1757 "I<(char\\ *) arg2>.  The buffer should allow space for up to 16 bytes; the "
1758 "returned string will be null-terminated if it is shorter than that."
1759 msgstr ""
1760
1761 #. type: TP
1762 #: build/C/man2/prctl.2:217
1763 #, no-wrap
1764 msgid "B<PR_SET_PDEATHSIG> (since Linux 2.1.57)"
1765 msgstr ""
1766
1767 #. type: Plain text
1768 #: build/C/man2/prctl.2:228
1769 msgid ""
1770 "Set the parent process death signal of the calling process to I<arg2> "
1771 "(either a signal value in the range 1..maxsig, or 0 to clear).  This is the "
1772 "signal that the calling process will get when its parent dies.  This value "
1773 "is cleared for the child of a B<fork>(2)  and (since Linux 2.5.36 / 2.6.23)  "
1774 "when executing a set-user_ID or set-group-ID binary."
1775 msgstr ""
1776
1777 #. type: TP
1778 #: build/C/man2/prctl.2:228
1779 #, no-wrap
1780 msgid "B<PR_GET_PDEATHSIG> (since Linux 2.3.15)"
1781 msgstr ""
1782
1783 #. type: Plain text
1784 #: build/C/man2/prctl.2:233
1785 msgid ""
1786 "Return the current value of the parent process death signal, in the location "
1787 "pointed to by I<(int\\ *) arg2>."
1788 msgstr ""
1789
1790 #. type: TP
1791 #: build/C/man2/prctl.2:233
1792 #, no-wrap
1793 msgid "B<PR_SET_SECCOMP> (since Linux 2.6.23)"
1794 msgstr ""
1795
1796 #.  See http://thread.gmane.org/gmane.linux.kernel/542632
1797 #.  [PATCH 0 of 2] seccomp updates
1798 #.  andrea@cpushare.com
1799 #. type: Plain text
1800 #: build/C/man2/prctl.2:257
1801 msgid ""
1802 "Set the secure computing mode for the calling thread.  In the current "
1803 "implementation, I<arg2> must be 1.  After the secure computing mode has been "
1804 "set to 1, the only system calls that the thread is permitted to make are "
1805 "B<read>(2), B<write>(2), B<_exit>(2), and B<sigreturn>(2).  Other system "
1806 "calls result in the delivery of a B<SIGKILL> signal.  Secure computing mode "
1807 "is useful for number-crunching applications that may need to execute "
1808 "untrusted byte code, perhaps obtained by reading from a pipe or socket.  "
1809 "This operation is only available if the kernel is configured with "
1810 "CONFIG_SECCOMP enabled."
1811 msgstr ""
1812
1813 #. type: TP
1814 #: build/C/man2/prctl.2:257
1815 #, no-wrap
1816 msgid "B<PR_GET_SECCOMP> (since Linux 2.6.23)"
1817 msgstr ""
1818
1819 #. type: Plain text
1820 #: build/C/man2/prctl.2:270
1821 msgid ""
1822 "Return the secure computing mode of the calling thread.  Not very useful for "
1823 "the current implementation (mode equals 1), but may be useful for other "
1824 "possible future modes: if the caller is not in secure computing mode, this "
1825 "operation returns 0; if the caller is in secure computing mode, then the "
1826 "B<prctl>()  call will cause a B<SIGKILL> signal to be sent to the process.  "
1827 "This operation is only available if the kernel is configured with "
1828 "CONFIG_SECCOMP enabled."
1829 msgstr ""
1830
1831 #. type: TP
1832 #: build/C/man2/prctl.2:270
1833 #, no-wrap
1834 msgid "B<PR_SET_SECUREBITS> (since Linux 2.6.26)"
1835 msgstr ""
1836
1837 #. type: Plain text
1838 #: build/C/man2/prctl.2:276
1839 msgid ""
1840 "Set the \"securebits\" flags of the calling thread to the value supplied in "
1841 "I<arg2>.  See B<capabilities>(7)."
1842 msgstr ""
1843
1844 #. type: TP
1845 #: build/C/man2/prctl.2:276
1846 #, no-wrap
1847 msgid "B<PR_GET_SECUREBITS> (since Linux 2.6.26)"
1848 msgstr ""
1849
1850 #. type: Plain text
1851 #: build/C/man2/prctl.2:282
1852 msgid ""
1853 "Return (as the function result)  the \"securebits\" flags of the calling "
1854 "thread.  See B<capabilities>(7)."
1855 msgstr ""
1856
1857 #. type: TP
1858 #: build/C/man2/prctl.2:282
1859 #, no-wrap
1860 msgid "B<PR_SET_TIMING> (since Linux 2.6.0-test4)"
1861 msgstr ""
1862
1863 #.  0
1864 #.  1
1865 #.  PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8,
1866 #.  and looking at the patch history, it appears
1867 #.  that it never did anything.
1868 #. type: Plain text
1869 #: build/C/man2/prctl.2:299
1870 msgid ""
1871 "Set whether to use (normal, traditional) statistical process timing or "
1872 "accurate timestamp-based process timing, by passing B<PR_TIMING_STATISTICAL> "
1873 "or B<PR_TIMING_TIMESTAMP> to I<arg2>.  B<PR_TIMING_TIMESTAMP> is not "
1874 "currently implemented (attempting to set this mode will yield the error "
1875 "B<EINVAL>)."
1876 msgstr ""
1877
1878 #. type: TP
1879 #: build/C/man2/prctl.2:299
1880 #, no-wrap
1881 msgid "B<PR_GET_TIMING> (since Linux 2.6.0-test4)"
1882 msgstr ""
1883
1884 #. type: Plain text
1885 #: build/C/man2/prctl.2:303
1886 msgid ""
1887 "Return (as the function result) which process timing method is currently in "
1888 "use."
1889 msgstr ""
1890
1891 #. type: TP
1892 #: build/C/man2/prctl.2:303
1893 #, no-wrap
1894 msgid "B<PR_TASK_PERF_EVENTS_DISABLE> (since Linux 2.6.31)"
1895 msgstr ""
1896
1897 #. type: Plain text
1898 #: build/C/man2/prctl.2:312
1899 msgid ""
1900 "Disable all performance counters attached to the calling process, regardless "
1901 "of whether the counters were created by this process or another process.  "
1902 "Performance counters created by the calling process for other processes are "
1903 "unaffected.  For more information on performance counters, see the kernel "
1904 "source file I<tools/perf/design.txt>."
1905 msgstr ""
1906
1907 #.  commit 1d1c7ddbfab358445a542715551301b7fc363e28
1908 #. type: Plain text
1909 #: build/C/man2/prctl.2:318
1910 msgid ""
1911 "Originally called B<PR_TASK_PERF_COUNTERS_DISABLE>; renamed (with same "
1912 "numerical value)  in Linux 2.6.32."
1913 msgstr ""
1914
1915 #. type: TP
1916 #: build/C/man2/prctl.2:318
1917 #, no-wrap
1918 msgid "B<PR_TASK_PERF_EVENTS_ENABLE> (since Linux 2.6.31)"
1919 msgstr ""
1920
1921 #. type: Plain text
1922 #: build/C/man2/prctl.2:323
1923 msgid ""
1924 "The converse of B<PR_TASK_PERF_EVENTS_DISABLE>; enable performance counters "
1925 "attached to the calling process."
1926 msgstr ""
1927
1928 #.  commit 1d1c7ddbfab358445a542715551301b7fc363e28
1929 #.  commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6
1930 #. type: Plain text
1931 #: build/C/man2/prctl.2:330
1932 msgid "Originally called B<PR_TASK_PERF_COUNTERS_ENABLE>; renamed in Linux 2.6.32."
1933 msgstr ""
1934
1935 #. type: TP
1936 #: build/C/man2/prctl.2:330
1937 #, no-wrap
1938 msgid "B<PR_SET_TSC> (since Linux 2.6.26, x86 only)"
1939 msgstr ""
1940
1941 #. type: Plain text
1942 #: build/C/man2/prctl.2:343
1943 msgid ""
1944 "Set the state of the flag determining whether the timestamp counter can be "
1945 "read by the process.  Pass B<PR_TSC_ENABLE> to I<arg2> to allow it to be "
1946 "read, or B<PR_TSC_SIGSEGV> to generate a B<SIGSEGV> when the process tries "
1947 "to read the timestamp counter."
1948 msgstr ""
1949
1950 #. type: TP
1951 #: build/C/man2/prctl.2:343
1952 #, no-wrap
1953 msgid "B<PR_GET_TSC> (since Linux 2.6.26, x86 only)"
1954 msgstr ""
1955
1956 #. type: Plain text
1957 #: build/C/man2/prctl.2:349
1958 msgid ""
1959 "Return the state of the flag determining whether the timestamp counter can "
1960 "be read, in the location pointed to by I<(int\\ *) arg2>."
1961 msgstr ""
1962
1963 #. type: TP
1964 #: build/C/man2/prctl.2:349
1965 #, no-wrap
1966 msgid "B<PR_SET_UNALIGN>"
1967 msgstr ""
1968
1969 #. type: Plain text
1970 #: build/C/man2/prctl.2:359
1971 msgid ""
1972 "(Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; PowerPC, "
1973 "since Linux 2.6.18; Alpha, since Linux 2.6.22)  Set unaligned access control "
1974 "bits to I<arg2>.  Pass B<PR_UNALIGN_NOPRINT> to silently fix up unaligned "
1975 "user accesses, or B<PR_UNALIGN_SIGBUS> to generate B<SIGBUS> on unaligned "
1976 "user access."
1977 msgstr ""
1978
1979 #. type: TP
1980 #: build/C/man2/prctl.2:359
1981 #, no-wrap
1982 msgid "B<PR_GET_UNALIGN>"
1983 msgstr ""
1984
1985 #. type: Plain text
1986 #: build/C/man2/prctl.2:366
1987 msgid ""
1988 "(see B<PR_SET_UNALIGN> for information on versions and architectures)  "
1989 "Return unaligned access control bits, in the location pointed to by I<(int\\ "
1990 "*) arg2>."
1991 msgstr ""
1992
1993 #. type: TP
1994 #: build/C/man2/prctl.2:366
1995 #, no-wrap
1996 msgid "B<PR_MCE_KILL> (since Linux 2.6.32)"
1997 msgstr ""
1998
1999 #. type: Plain text
2000 #: build/C/man2/prctl.2:406
2001 msgid ""
2002 "Set the machine check memory corruption kill policy for the current thread.  "
2003 "If I<arg2> is B<PR_MCE_KILL_CLEAR>, clear the thread memory corruption kill "
2004 "policy and use the system-wide default.  (The system-wide default is defined "
2005 "by I</proc/sys/vm/memory_failure_early_kill>; see B<proc>(5).)  If I<arg2> "
2006 "is B<PR_MCE_KILL_SET>, use a thread-specific memory corruption kill policy.  "
2007 "In this case, I<arg3> defines whether the policy is I<early kill> "
2008 "(B<PR_MCE_KILL_EARLY>), I<late kill> (B<PR_MCE_KILL_LATE>), or the "
2009 "system-wide default (B<PR_MCE_KILL_DEFAULT>).  Early kill means that the "
2010 "thread receives a B<SIGBUS> signal as soon as hardware memory corruption is "
2011 "detected inside its address space.  In late kill mode, the process is only "
2012 "killed when it accesses a corrupted page.  See B<sigaction>(2)  for more "
2013 "information on the B<SIGBUS> signal.  The policy is inherited by children.  "
2014 "The remaining unused B<prctl>()  arguments must be zero for future "
2015 "compatibility."
2016 msgstr ""
2017
2018 #. type: TP
2019 #: build/C/man2/prctl.2:406
2020 #, no-wrap
2021 msgid "B<PR_MCE_KILL_GET> (since Linux 2.6.32)"
2022 msgstr ""
2023
2024 #. type: Plain text
2025 #: build/C/man2/prctl.2:412
2026 msgid ""
2027 "Return the current per-process machine check kill policy.  All unused "
2028 "B<prctl>()  arguments must be zero."
2029 msgstr ""
2030
2031 #. type: TP
2032 #: build/C/man2/prctl.2:412
2033 #, no-wrap
2034 msgid "B<PR_SET_MM> (since Linux 3.3)"
2035 msgstr ""
2036
2037 #. type: Plain text
2038 #: build/C/man2/prctl.2:432
2039 msgid ""
2040 "Modify certain kernel memory map descriptor fields of the calling process.  "
2041 "Usually these fields are set by the kernel and dynamic loader (see "
2042 "B<ld.so>(8)  for more information) and a regular application should not use "
2043 "this feature.  However, there are cases, such as self-modifying programs, "
2044 "where a program might find it useful to change its own memory map.  This "
2045 "feature is available only if the kernel is built with the "
2046 "B<CONFIG_CHECKPOINT_RESTORE> option enabled.  The calling process must have "
2047 "the B<CAP_SYS_RESOURCE> capability.  The value in I<arg2> is one of the "
2048 "options below, while I<arg3> provides a new value for the option."
2049 msgstr ""
2050
2051 #. type: TP
2052 #: build/C/man2/prctl.2:433
2053 #, no-wrap
2054 msgid "B<PR_SET_MM_START_CODE>"
2055 msgstr ""
2056
2057 #. type: Plain text
2058 #: build/C/man2/prctl.2:442
2059 msgid ""
2060 "Set the address above which the program text can run.  The corresponding "
2061 "memory area must be readable and executable, but not writable or sharable "
2062 "(see B<mprotect>(2)  and B<mmap>(2)  for more information)."
2063 msgstr ""
2064
2065 #. type: TP
2066 #: build/C/man2/prctl.2:442
2067 #, no-wrap
2068 msgid "B<PR_SET_MM_END_CODE>"
2069 msgstr ""
2070
2071 #. type: Plain text
2072 #: build/C/man2/prctl.2:447
2073 msgid ""
2074 "Set the address below which the program text can run.  The corresponding "
2075 "memory area must be readable and executable, but not writable or sharable."
2076 msgstr ""
2077
2078 #. type: TP
2079 #: build/C/man2/prctl.2:447
2080 #, no-wrap
2081 msgid "B<PR_SET_MM_START_DATA>"
2082 msgstr ""
2083
2084 #. type: Plain text
2085 #: build/C/man2/prctl.2:453
2086 msgid ""
2087 "Set the address above which initialized and uninitialized (bss) data are "
2088 "placed.  The corresponding memory area must be readable and writable, but "
2089 "not executable or sharable."
2090 msgstr ""
2091
2092 #. type: TP
2093 #: build/C/man2/prctl.2:453
2094 #, no-wrap
2095 msgid "B<PR_SET_MM_END_DATA>"
2096 msgstr ""
2097
2098 #. type: Plain text
2099 #: build/C/man2/prctl.2:459
2100 msgid ""
2101 "Set the address below which initialized and uninitialized (bss) data are "
2102 "placed.  The corresponding memory area must be readable and writable, but "
2103 "not executable or sharable."
2104 msgstr ""
2105
2106 #. type: TP
2107 #: build/C/man2/prctl.2:459
2108 #, no-wrap
2109 msgid "B<PR_SET_MM_START_STACK>"
2110 msgstr ""
2111
2112 #. type: Plain text
2113 #: build/C/man2/prctl.2:463
2114 msgid ""
2115 "Set the start address of the stack.  The corresponding memory area must be "
2116 "readable and writable."
2117 msgstr ""
2118
2119 #. type: TP
2120 #: build/C/man2/prctl.2:463
2121 #, no-wrap
2122 msgid "B<PR_SET_MM_START_BRK>"
2123 msgstr ""
2124
2125 #. type: Plain text
2126 #: build/C/man2/prctl.2:475
2127 msgid ""
2128 "Set the address above which the program heap can be expanded with B<brk>(2)  "
2129 "call.  The address must be greater than the ending address of the current "
2130 "program data segment.  In addition, the combined size of the resulting heap "
2131 "and the size of the data segment can't exceed the B<RLIMIT_DATA> resource "
2132 "limit (see B<setrlimit>(2))."
2133 msgstr ""
2134
2135 #. type: TP
2136 #: build/C/man2/prctl.2:475
2137 #, no-wrap
2138 msgid "B<PR_SET_MM_BRK>"
2139 msgstr ""
2140
2141 #.  FIXME The following (until ========) is not yet in mainline kernel,
2142 #.  so commented out for the moment.
2143 #.  .TP
2144 #.  .BR PR_SET_MM_ARG_START
2145 #.  Set the address above which the program command line is placed.
2146 #.  .TP
2147 #.  .BR PR_SET_MM_ARG_END
2148 #.  Set the address below which the program command line is placed.
2149 #.  .TP
2150 #.  .BR PR_SET_MM_ENV_START
2151 #.  Set the address above which the program environment is placed.
2152 #.  .TP
2153 #.  .BR PR_SET_MM_ENV_END
2154 #.  Set the address below which the program environment is placed.
2155 #.  .IP
2156 #.  The address passed with
2157 #.  .BR PR_SET_MM_ARG_START ,
2158 #.  .BR PR_SET_MM_ARG_END ,
2159 #.  .BR PR_SET_MM_ENV_START ,
2160 #.  and
2161 #.  .BR PR_SET_MM_ENV_END
2162 #.  should belong to a process stack area.
2163 #.  Thus, the corresponding memory area must be readable, writable, and
2164 #.  (depending on the kernel configuration) have the
2165 #.  .BR MAP_GROWSDOWN
2166 #.  attribute set (see
2167 #.  .BR mmap (2)).
2168 #.  .TP
2169 #.  .BR PR_SET_MM_AUXV
2170 #.  Set a new auxiliary vector.
2171 #.  The
2172 #.  .I arg3
2173 #.  argument should provide the address of the vector.
2174 #.  The
2175 #.  .I arg4
2176 #.  is the size of the vector.
2177 #.  .TP
2178 #.  .BR PR_SET_MM_EXE_FILE
2179 #.  Supersede the
2180 #.  .IR /proc/pid/exe
2181 #.  symbolic link with a new one pointing to a new executable file
2182 #.  identified by the file descriptor provided in
2183 #.  .I arg3
2184 #.  argument.
2185 #.  The file descriptor should be obtained with a regular
2186 #.  .BR open (2)
2187 #.  call.
2188 #.  .IP
2189 #.  To change the symbolic link, one needs to unmap all existing
2190 #.  executable memory areas, including those created by the kernel itself
2191 #.  (for example the kernel usually creates at least one executable
2192 #.  memory area for the ELF
2193 #.  .IR .text
2194 #.  section).
2195 #.  .IP
2196 #.  The second limitation is that such transitions can be done only once
2197 #.  in a process life time.
2198 #.  Any further attempts will be rejected.
2199 #.  This should help system administrators to monitor unusual
2200 #.  symbolic-link transitions over all process running in a system.
2201 #.  ========== END FIXME
2202 #. type: Plain text
2203 #: build/C/man2/prctl.2:544
2204 msgid ""
2205 "Set the current B<brk>(2)  value.  The requirements for the address are the "
2206 "same as for the B<PR_SET_MM_START_BRK> option."
2207 msgstr ""
2208
2209 #. type: Plain text
2210 #: build/C/man2/prctl.2:563
2211 msgid ""
2212 "On success, B<PR_GET_DUMPABLE>, B<PR_GET_KEEPCAPS>, B<PR_CAPBSET_READ>, "
2213 "B<PR_GET_TIMING>, B<PR_GET_SECUREBITS>, B<PR_MCE_KILL_GET>, and (if it "
2214 "returns)  B<PR_GET_SECCOMP> return the nonnegative values described above.  "
2215 "All other I<option> values return 0 on success.  On error, -1 is returned, "
2216 "and I<errno> is set appropriately."
2217 msgstr ""
2218
2219 #. type: Plain text
2220 #: build/C/man2/prctl.2:568
2221 msgid "I<arg2> is an invalid address."
2222 msgstr ""
2223
2224 #. type: Plain text
2225 #: build/C/man2/prctl.2:573
2226 msgid "The value of I<option> is not recognized."
2227 msgstr ""
2228
2229 #. type: Plain text
2230 #: build/C/man2/prctl.2:585
2231 msgid ""
2232 "I<option> is B<PR_MCE_KILL> or B<PR_MCE_KILL_GET> or B<PR_SET_MM>, and "
2233 "unused B<prctl>()  arguments were not specified as zero."
2234 msgstr ""
2235
2236 #. type: Plain text
2237 #: build/C/man2/prctl.2:590
2238 msgid "I<arg2> is not valid value for this I<option>."
2239 msgstr ""
2240
2241 #. type: Plain text
2242 #: build/C/man2/prctl.2:599
2243 msgid ""
2244 "I<option> is B<PR_SET_SECCOMP> or B<PR_SET_SECCOMP>, and the kernel was not "
2245 "configured with B<CONFIG_SECCOMP>."
2246 msgstr ""
2247
2248 #. type: Plain text
2249 #: build/C/man2/prctl.2:605
2250 msgid "I<option> is B<PR_SET_MM>, and one of the following is true"
2251 msgstr ""
2252
2253 #. type: Plain text
2254 #: build/C/man2/prctl.2:611
2255 msgid "I<arg4> or I<arg5> is nonzero;"
2256 msgstr ""
2257
2258 #. type: Plain text
2259 #: build/C/man2/prctl.2:616
2260 msgid ""
2261 "I<arg3> is greater than B<TASK_SIZE> (the limit on the size of the user "
2262 "address space for this architecture);"
2263 msgstr ""
2264
2265 #. type: Plain text
2266 #: build/C/man2/prctl.2:626
2267 msgid ""
2268 "I<arg2> is B<PR_SET_MM_START_CODE>, B<PR_SET_MM_END_CODE>, "
2269 "B<PR_SET_MM_START_DATA>, B<PR_SET_MM_END_DATA>, or B<PR_SET_MM_START_STACK,> "
2270 "and the permissions of the corresponding memory area are not as required;"
2271 msgstr ""
2272
2273 #. type: Plain text
2274 #: build/C/man2/prctl.2:638
2275 msgid ""
2276 "I<arg2> is B<PR_SET_MM_START_BRK> or B<PR_SET_MM_BRK>, and I<arg3> is less "
2277 "than or equal to the end of the data segment or specifies a value that would "
2278 "cause the B<RLIMIT_DATA> resource limit to be exceeded."
2279 msgstr ""
2280
2281 #. type: Plain text
2282 #: build/C/man2/prctl.2:651
2283 msgid ""
2284 "I<option> is B<PR_SET_SECUREBITS>, and the caller does not have the "
2285 "B<CAP_SETPCAP> capability, or tried to unset a \"locked\" flag, or tried to "
2286 "set a flag whose corresponding locked flag was set (see B<capabilities>(7))."
2287 msgstr ""
2288
2289 #. type: Plain text
2290 #: build/C/man2/prctl.2:661
2291 msgid ""
2292 "I<option> is B<PR_SET_KEEPCAPS>, and the callers's "
2293 "B<SECURE_KEEP_CAPS_LOCKED> flag is set (see B<capabilities>(7))."
2294 msgstr ""
2295
2296 #. type: Plain text
2297 #: build/C/man2/prctl.2:669
2298 msgid ""
2299 "I<option> is B<PR_CAPBSET_DROP>, and the caller does not have the "
2300 "B<CAP_SETPCAP> capability."
2301 msgstr ""
2302
2303 #.  FIXME The following (until ========) is not yet in mainline kernel,
2304 #.  so commented out for the moment.
2305 #.  .TP
2306 #.  .B EACCES
2307 #.  .I option
2308 #.  is
2309 #.  .BR PR_SET_MM ,
2310 #.  and
2311 #.  .I arg3
2312 #.  is
2313 #.  .BR PR_SET_MM_EXE_FILE ,
2314 #.  the file is not executable.
2315 #.  .TP
2316 #.  .B EBUSY
2317 #.  .I option
2318 #.  is
2319 #.  .BR PR_SET_MM ,
2320 #.  .I arg3
2321 #.  is
2322 #.  .BR PR_SET_MM_EXE_FILE ,
2323 #.  and this the second attempt to change the
2324 #.  .I /proc/pid/exe
2325 #.  symbolic link, which is prohibited.
2326 #.  .TP
2327 #.  .B EBADF
2328 #.  .I option
2329 #.  is
2330 #.  .BR PR_SET_MM ,
2331 #.  .I arg3
2332 #.  is
2333 #.  .BR PR_SET_MM_EXE_FILE ,
2334 #.  and the file descriptor passed in
2335 #.  .I arg4
2336 #.  is not valid.
2337 #.  ========== END FIXME
2338 #.  The following can't actually happen, because prctl() in
2339 #.  seccomp mode will cause SIGKILL.
2340 #.  .TP
2341 #.  .B EPERM
2342 #.  .I option
2343 #.  is
2344 #.  .BR PR_SET_SECCOMP ,
2345 #.  and secure computing mode is already 1.
2346 #. type: Plain text
2347 #: build/C/man2/prctl.2:720
2348 msgid ""
2349 "I<option> is B<PR_SET_MM>, and the caller does not have the "
2350 "B<CAP_SYS_RESOURCE> capability."
2351 msgstr ""
2352
2353 #.  The library interface was added in glibc 2.0.6
2354 #. type: Plain text
2355 #: build/C/man2/prctl.2:725
2356 msgid "The B<prctl>()  system call was introduced in Linux 2.1.57."
2357 msgstr ""
2358
2359 #. type: Plain text
2360 #: build/C/man2/prctl.2:732
2361 msgid ""
2362 "This call is Linux-specific.  IRIX has a B<prctl>()  system call (also "
2363 "introduced in Linux 2.1.44 as irix_prctl on the MIPS architecture), with "
2364 "prototype"
2365 msgstr ""
2366
2367 #. type: Plain text
2368 #: build/C/man2/prctl.2:734
2369 msgid "B<ptrdiff_t prctl(int >I<option>B<, int >I<arg2>B<, int >I<arg3>B<);>"
2370 msgstr ""
2371
2372 #. type: Plain text
2373 #: build/C/man2/prctl.2:739
2374 msgid ""
2375 "and options to get the maximum number of processes per user, get the maximum "
2376 "number of processors the calling process can use, find out whether a "
2377 "specified process is currently blocked, get or set the maximum stack size, "
2378 "and so on."
2379 msgstr ""
2380
2381 #. type: Plain text
2382 #: build/C/man2/prctl.2:742
2383 msgid "B<signal>(2), B<core>(5)"
2384 msgstr ""
2385
2386 #. type: TH
2387 #: build/C/man3/profil.3:28
2388 #, no-wrap
2389 msgid "PROFIL"
2390 msgstr ""
2391
2392 #. type: Plain text
2393 #: build/C/man3/profil.3:31
2394 msgid "profil - execution time profile"
2395 msgstr ""
2396
2397 #. type: Plain text
2398 #: build/C/man3/profil.3:36
2399 msgid ""
2400 "B<int profil(unsigned short *>I<buf>B<, size_t >I<bufsiz>B<, size_t "
2401 ">I<offset>B<, unsigned int >I<scale>B<);>"
2402 msgstr ""
2403
2404 #. type: Plain text
2405 #: build/C/man3/profil.3:44
2406 msgid "B<profil>(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\\ E<lt>\\ 500)"
2407 msgstr ""
2408
2409 #. type: Plain text
2410 #: build/C/man3/profil.3:66
2411 msgid ""
2412 "This routine provides a means to find out in what areas your program spends "
2413 "most of its time.  The argument I<buf> points to I<bufsiz> bytes of core.  "
2414 "Every virtual 10 milliseconds, the user's program counter (PC)  is examined: "
2415 "I<offset> is subtracted and the result is multiplied by I<scale> and divided "
2416 "by 65536.  If the resulting value is less than I<bufsiz>, then the "
2417 "corresponding entry in I<buf> is incremented.  If I<buf> is NULL, profiling "
2418 "is disabled."
2419 msgstr ""
2420
2421 #. type: Plain text
2422 #: build/C/man3/profil.3:68
2423 msgid "Zero is always returned."
2424 msgstr ""
2425
2426 #. type: Plain text
2427 #: build/C/man3/profil.3:70
2428 msgid "Similar to a call in SVr4 (but not POSIX.1-2001)."
2429 msgstr ""
2430
2431 #. type: Plain text
2432 #: build/C/man3/profil.3:76
2433 msgid ""
2434 "B<profil>()  cannot be used on a program that also uses B<ITIMER_PROF> "
2435 "interval timers (see B<setitimer>(2))."
2436 msgstr ""
2437
2438 #. type: Plain text
2439 #: build/C/man3/profil.3:79
2440 msgid ""
2441 "True kernel profiling provides more accurate results.  Libc 4.4 contained a "
2442 "kernel patch providing a system call profil."
2443 msgstr ""
2444
2445 #. type: Plain text
2446 #: build/C/man3/profil.3:84
2447 msgid "B<gprof>(1), B<setitimer>(2), B<sigaction>(2), B<signal>(2)"
2448 msgstr ""
2449
2450 #. type: TH
2451 #: build/C/man3/psignal.3:28
2452 #, no-wrap
2453 msgid "PSIGNAL"
2454 msgstr ""
2455
2456 #. type: TH
2457 #: build/C/man3/psignal.3:28
2458 #, no-wrap
2459 msgid "2010-10-06"
2460 msgstr ""
2461
2462 #. type: TH
2463 #: build/C/man3/psignal.3:28 build/C/man3/raise.3:27 build/C/man7/sigevent.7:24
2464 #, no-wrap
2465 msgid "GNU"
2466 msgstr ""
2467
2468 #. type: Plain text
2469 #: build/C/man3/psignal.3:31
2470 msgid "psignal, psiginfo - print signal message"
2471 msgstr ""
2472
2473 #. type: Plain text
2474 #: build/C/man3/psignal.3:37
2475 #, no-wrap
2476 msgid ""
2477 "B<void psignal(int >I<sig>B<, const char *>I<s>B<);>\n"
2478 "B<void psiginfo(const siginfo_t *>I<pinfo>B<, const char *>I<s>B<);>\n"
2479 msgstr ""
2480
2481 #. type: Plain text
2482 #: build/C/man3/psignal.3:39
2483 #, no-wrap
2484 msgid "B<extern const char *const >I<sys_siglist>B<[];>\n"
2485 msgstr ""
2486
2487 #. type: Plain text
2488 #: build/C/man3/psignal.3:48
2489 msgid "B<psignal>(): _SVID_SOURCE || _BSD_SOURCE"
2490 msgstr ""
2491
2492 #. type: Plain text
2493 #: build/C/man3/psignal.3:51
2494 msgid ""
2495 "B<psiginfo>(): _XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ "
2496 "200809L"
2497 msgstr ""
2498
2499 #. type: Plain text
2500 #: build/C/man3/psignal.3:54
2501 msgid "I<sys_siglist>: _BSD_SOURCE"
2502 msgstr ""
2503
2504 #. type: Plain text
2505 #: build/C/man3/psignal.3:63
2506 msgid ""
2507 "The B<psignal>()  function displays a message on I<stderr> consisting of the "
2508 "string I<s>, a colon, a space, a string describing the signal number I<sig>, "
2509 "and a trailing newline.  If the string I<s> is NULL or empty, the colon and "
2510 "space are omitted.  If I<sig> is invalid, the message displayed will "
2511 "indicate an unknown signal."
2512 msgstr ""
2513
2514 #. type: Plain text
2515 #: build/C/man3/psignal.3:84
2516 msgid ""
2517 "The B<psiginfo>()  function is like B<psignal>(), except that it displays "
2518 "information about the signal described by I<pinfo>, which should point to a "
2519 "valid I<siginfo_t> structure.  As well as the signal description, "
2520 "B<psiginfo>()  displays information about the origin of the signal, and "
2521 "other information relevant to the signal (e.g., the relevant memory address "
2522 "for hardware-generated signals, the child process ID for B<SIGCHLD>, and the "
2523 "user ID and process ID of the sender, for signals set using B<kill>(2)  or "
2524 "B<sigqueue>(3))."
2525 msgstr ""
2526
2527 #. type: Plain text
2528 #: build/C/man3/psignal.3:87
2529 msgid ""
2530 "The array I<sys_siglist> holds the signal description strings indexed by "
2531 "signal number."
2532 msgstr ""
2533
2534 #. type: Plain text
2535 #: build/C/man3/psignal.3:93
2536 msgid "The B<psignal>()  and B<psiginfo>()  functions return no value."
2537 msgstr ""
2538
2539 #. type: Plain text
2540 #: build/C/man3/psignal.3:97
2541 msgid "The B<psiginfo>()  function was added to glibc in version 2.10."
2542 msgstr ""
2543
2544 #. type: Plain text
2545 #: build/C/man3/psignal.3:99
2546 msgid "POSIX.1-2008, 4.3BSD."
2547 msgstr ""
2548
2549 #. type: Plain text
2550 #: build/C/man3/psignal.3:103
2551 msgid "In glibc versions up to 2.12, B<psiginfo>()  had the following bugs:"
2552 msgstr ""
2553
2554 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12107
2555 #.  Reportedly now fixed; check glibc 2.13
2556 #. type: Plain text
2557 #: build/C/man3/psignal.3:107
2558 msgid "In some circumstances, a trailing newline is not printed."
2559 msgstr ""
2560
2561 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12108
2562 #.  Reportedly now fixed; check glibc 2.13
2563 #. type: Plain text
2564 #: build/C/man3/psignal.3:111
2565 msgid "Additional details are not displayed for real-time signals."
2566 msgstr ""
2567
2568 #. type: Plain text
2569 #: build/C/man3/psignal.3:116
2570 msgid "B<sigaction>(2), B<perror>(3), B<strsignal>(3), B<signal>(7)"
2571 msgstr ""
2572
2573 #. type: TH
2574 #: build/C/man3/raise.3:27
2575 #, no-wrap
2576 msgid "RAISE"
2577 msgstr ""
2578
2579 #. type: TH
2580 #: build/C/man3/raise.3:27
2581 #, no-wrap
2582 msgid "2012-04-20"
2583 msgstr ""
2584
2585 #. type: Plain text
2586 #: build/C/man3/raise.3:30
2587 msgid "raise - send a signal to the caller"
2588 msgstr ""
2589
2590 #. type: Plain text
2591 #: build/C/man3/raise.3:35
2592 #, no-wrap
2593 msgid "B<int raise(int >I<sig>B<);>\n"
2594 msgstr ""
2595
2596 #. type: Plain text
2597 #: build/C/man3/raise.3:41
2598 msgid ""
2599 "The B<raise>()  function sends a signal to the calling process or thread.  "
2600 "In a single-threaded program it is equivalent to"
2601 msgstr ""
2602
2603 #. type: Plain text
2604 #: build/C/man3/raise.3:45
2605 #, no-wrap
2606 msgid "kill(getpid(), sig);\n"
2607 msgstr ""
2608
2609 #. type: Plain text
2610 #: build/C/man3/raise.3:49
2611 msgid "In a multithreaded program it is equivalent to"
2612 msgstr ""
2613
2614 #. type: Plain text
2615 #: build/C/man3/raise.3:53
2616 #, no-wrap
2617 msgid "pthread_kill(pthread_self(), sig);\n"
2618 msgstr ""
2619
2620 #. type: Plain text
2621 #: build/C/man3/raise.3:59
2622 msgid ""
2623 "If the signal causes a handler to be called, B<raise>()  will only return "
2624 "after the signal handler has returned."
2625 msgstr ""
2626
2627 #. type: Plain text
2628 #: build/C/man3/raise.3:62
2629 msgid "B<raise>()  returns 0 on success, and nonzero for failure."
2630 msgstr ""
2631
2632 #. type: Plain text
2633 #: build/C/man3/raise.3:64 build/C/man2/signal.2:107
2634 msgid "C89, C99, POSIX.1-2001."
2635 msgstr ""
2636
2637 #.  2.3.2 used the obsolete tkill(), if available.
2638 #. type: Plain text
2639 #: build/C/man3/raise.3:75
2640 msgid ""
2641 "Since version 2.3.3, glibc implements B<raise>()  by calling B<tgkill>(2), "
2642 "if the kernel supports that system call.  Older glibc versions implemented "
2643 "B<raise>()  using B<kill>(2)."
2644 msgstr ""
2645
2646 #. type: Plain text
2647 #: build/C/man3/raise.3:82
2648 msgid ""
2649 "B<getpid>(2), B<kill>(2), B<sigaction>(2), B<signal>(2), B<pthread_kill>(3), "
2650 "B<signal>(7)"
2651 msgstr ""
2652
2653 #. type: TH
2654 #: build/C/man2/rt_sigqueueinfo.2:23
2655 #, no-wrap
2656 msgid "RT_SIGQUEUEINFO"
2657 msgstr ""
2658
2659 #. type: TH
2660 #: build/C/man2/rt_sigqueueinfo.2:23 build/C/man2/tkill.2:29
2661 #, no-wrap
2662 msgid "2011-09-18"
2663 msgstr ""
2664
2665 #. type: Plain text
2666 #: build/C/man2/rt_sigqueueinfo.2:26
2667 msgid "rt_sigqueueinfo, rt_tgsigqueueinfo - queue a signal and data"
2668 msgstr ""
2669
2670 #. type: Plain text
2671 #: build/C/man2/rt_sigqueueinfo.2:29
2672 #, no-wrap
2673 msgid ""
2674 "B<int rt_sigqueueinfo(pid_t >I<tgid>B<, int >I<sig>B<, siginfo_t "
2675 "*>I<uinfo>B<);>\n"
2676 msgstr ""
2677
2678 #. type: Plain text
2679 #: build/C/man2/rt_sigqueueinfo.2:32
2680 #, no-wrap
2681 msgid ""
2682 "B<int rt_tgsigqueueinfo(pid_t >I<tgid>B<, pid_t >I<tid>B<, int >I<sig>B<,>\n"
2683 "B<                      siginfo_t *>I<uinfo>B<);>\n"
2684 msgstr ""
2685
2686 #. type: Plain text
2687 #: build/C/man2/rt_sigqueueinfo.2:45
2688 msgid ""
2689 "The B<rt_sigqueueinfo>()  and B<rt_tgsigqueueinfo>()  system calls are the "
2690 "low-level interfaces used to send a signal plus data to a process or "
2691 "thread.  The receiver of the signal can obtain the accompanying data by "
2692 "establishing a signal handler with the B<sigaction>(2)  B<SA_SIGINFO> flag."
2693 msgstr ""
2694
2695 #. type: Plain text
2696 #: build/C/man2/rt_sigqueueinfo.2:51
2697 msgid ""
2698 "These system calls are not intended for direct application use; they are "
2699 "provided to allow the implementation of B<sigqueue>(3)  and "
2700 "B<pthread_sigqueue>(3)."
2701 msgstr ""
2702
2703 #. type: Plain text
2704 #: build/C/man2/rt_sigqueueinfo.2:63
2705 msgid ""
2706 "The B<rt_sigqueueinfo>()  system call sends the signal I<sig> to the thread "
2707 "group with the ID I<tgid>.  (The term \"thread group\" is synonymous with "
2708 "\"process\", and I<tid> corresponds to the traditional UNIX process ID.)  "
2709 "The signal will be delivered to an arbitrary member of the thread group "
2710 "(i.e., one of the threads that is not currently blocking the signal)."
2711 msgstr ""
2712
2713 #. type: Plain text
2714 #: build/C/man2/rt_sigqueueinfo.2:74
2715 msgid ""
2716 "The I<uinfo> argument specifies the data to accompany the signal.  This "
2717 "argument is a pointer to a structure of type I<siginfo_t>, described in "
2718 "B<sigaction>(2)  (and defined by including I<E<lt>sigaction.hE<gt>>).  The "
2719 "caller should set the following fields in this structure:"
2720 msgstr ""
2721
2722 #. type: TP
2723 #: build/C/man2/rt_sigqueueinfo.2:74 build/C/man7/sigevent.7:86 build/C/man2/wait.2:315
2724 #, no-wrap
2725 msgid "I<si_code>"
2726 msgstr ""
2727
2728 #.  tkill(2) or
2729 #. type: Plain text
2730 #: build/C/man2/rt_sigqueueinfo.2:90
2731 msgid ""
2732 "This must be one of the B<SI_*> codes in the kernel source file "
2733 "I<include/asm-generic/siginfo.h>, with the restriction that the code must be "
2734 "negative (i.e., cannot be B<SI_USER>, which is used by the kernel to "
2735 "indicate a signal sent by B<kill>(2))  and cannot (since Linux 2.6.39) be "
2736 "B<SI_TKILL> (which is used by the kernel to indicate a signal sent using "
2737 "B<tgkill>(2))."
2738 msgstr ""
2739
2740 #. type: TP
2741 #: build/C/man2/rt_sigqueueinfo.2:90 build/C/man2/wait.2:294
2742 #, no-wrap
2743 msgid "I<si_pid>"
2744 msgstr ""
2745
2746 #. type: Plain text
2747 #: build/C/man2/rt_sigqueueinfo.2:94
2748 msgid "This should be set to a process ID, typically the process ID of the sender."
2749 msgstr ""
2750
2751 #. type: TP
2752 #: build/C/man2/rt_sigqueueinfo.2:94 build/C/man2/wait.2:297
2753 #, no-wrap
2754 msgid "I<si_uid>"
2755 msgstr ""
2756
2757 #. type: Plain text
2758 #: build/C/man2/rt_sigqueueinfo.2:98
2759 msgid "This should be set to a user ID, typically the real user ID of the sender."
2760 msgstr ""
2761
2762 #. type: TP
2763 #: build/C/man2/rt_sigqueueinfo.2:98 build/C/man7/sigevent.7:94
2764 #, no-wrap
2765 msgid "I<si_value>"
2766 msgstr ""
2767
2768 #. type: Plain text
2769 #: build/C/man2/rt_sigqueueinfo.2:105
2770 msgid ""
2771 "This field contains the user data to accompany the signal.  For more "
2772 "information, see the description of the last (I<union sigval>)  argument of "
2773 "B<sigqueue>(3)."
2774 msgstr ""
2775
2776 #. type: Plain text
2777 #: build/C/man2/rt_sigqueueinfo.2:112
2778 msgid ""
2779 "Internally, the kernel sets the I<si_signo> field to the value specified in "
2780 "I<sig>, so that the receiver of the signal can also obtain the signal number "
2781 "via that field."
2782 msgstr ""
2783
2784 #. type: Plain text
2785 #: build/C/man2/rt_sigqueueinfo.2:124
2786 msgid ""
2787 "The B<rt_tgsigqueueinfo>()  system call is like B<rt_sigqueueinfo>(), but "
2788 "sends the signal and data to the single thread specified by the combination "
2789 "of I<tgid>, a thread group ID, and I<tid>, a thread in that thread group."
2790 msgstr ""
2791
2792 #. type: Plain text
2793 #: build/C/man2/rt_sigqueueinfo.2:129
2794 msgid ""
2795 "On success, these system calls return 0.  On error, they return -1 and "
2796 "I<errno> is set to indicate the error."
2797 msgstr ""
2798
2799 #. type: TP
2800 #: build/C/man2/rt_sigqueueinfo.2:130 build/C/man3/sigqueue.3:90 build/C/man2/sigwaitinfo.2:111 build/C/man2/timer_create.2:174
2801 #, no-wrap
2802 msgid "B<EAGAIN>"
2803 msgstr ""
2804
2805 #. type: Plain text
2806 #: build/C/man2/rt_sigqueueinfo.2:136 build/C/man3/sigqueue.3:96
2807 msgid ""
2808 "The limit of signals which may be queued has been reached.  (See "
2809 "B<signal>(7)  for further information.)"
2810 msgstr ""
2811
2812 #. type: Plain text
2813 #: build/C/man2/rt_sigqueueinfo.2:143
2814 msgid "I<sig>, I<tgid>, or I<tid> was invalid."
2815 msgstr ""
2816
2817 #. type: Plain text
2818 #: build/C/man2/rt_sigqueueinfo.2:151
2819 msgid ""
2820 "The caller does not have permission to send the signal to the target.  For "
2821 "the required permissions, see B<kill>(2).  Or: I<uinfo-E<gt>si_code> is "
2822 "invalid."
2823 msgstr ""
2824
2825 #. type: Plain text
2826 #: build/C/man2/rt_sigqueueinfo.2:157
2827 msgid "B<rt_sigqueueinfo>(): No thread group matching I<tgid> was found."
2828 msgstr ""
2829
2830 #. type: Plain text
2831 #: build/C/man2/rt_sigqueueinfo.2:164
2832 msgid "B<rt_tgsigqueinfo>(): No thread matching I<tgid> and I<tid> was found."
2833 msgstr ""
2834
2835 #. type: Plain text
2836 #: build/C/man2/rt_sigqueueinfo.2:171
2837 msgid ""
2838 "The B<rt_sigqueueinfo>()  system call was added to Linux in version 2.2.  "
2839 "The B<rt_tgsigqueueinfo>()  system call was added to Linux in version "
2840 "2.6.31."
2841 msgstr ""
2842
2843 #. type: Plain text
2844 #: build/C/man2/rt_sigqueueinfo.2:173 build/C/man2/sgetmask.2:63 build/C/man2/timerfd_create.2:372
2845 msgid "These system calls are Linux-specific."
2846 msgstr ""
2847
2848 #. type: Plain text
2849 #: build/C/man2/rt_sigqueueinfo.2:178
2850 msgid ""
2851 "Since these system calls are not intended for application use, there are no "
2852 "glibc wrapper functions; use B<syscall>(2)  in the unlikely case that you "
2853 "want to call them directly."
2854 msgstr ""
2855
2856 #. type: Plain text
2857 #: build/C/man2/rt_sigqueueinfo.2:183
2858 msgid ""
2859 "As with B<kill>(2), the null signal (0) can be used to check if the "
2860 "specified process or thread exists."
2861 msgstr ""
2862
2863 #. type: Plain text
2864 #: build/C/man2/rt_sigqueueinfo.2:191
2865 msgid ""
2866 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<tgkill>(2), "
2867 "B<pthread_sigqueue>(3), B<sigqueue>(3), B<signal>(7)"
2868 msgstr ""
2869
2870 #. type: TH
2871 #: build/C/man2/sgetmask.2:24
2872 #, no-wrap
2873 msgid "SGETMASK"
2874 msgstr ""
2875
2876 #. type: TH
2877 #: build/C/man2/sgetmask.2:24
2878 #, no-wrap
2879 msgid "2007-07-05"
2880 msgstr ""
2881
2882 #. type: Plain text
2883 #: build/C/man2/sgetmask.2:27
2884 msgid "sgetmask, ssetmask - manipulation of signal mask (obsolete)"
2885 msgstr ""
2886
2887 #. type: Plain text
2888 #: build/C/man2/sgetmask.2:29
2889 msgid "B<long sgetmask(void);>"
2890 msgstr ""
2891
2892 #. type: Plain text
2893 #: build/C/man2/sgetmask.2:31
2894 msgid "B<long ssetmask(long >I<newmask>B<);>"
2895 msgstr ""
2896
2897 #. type: Plain text
2898 #: build/C/man2/sgetmask.2:37
2899 msgid ""
2900 "These system calls are obsolete.  I<Do not use them>; use B<sigprocmask>(2)  "
2901 "instead."
2902 msgstr ""
2903
2904 #. type: Plain text
2905 #: build/C/man2/sgetmask.2:40
2906 msgid "B<sgetmask>()  returns the signal mask of the calling process."
2907 msgstr ""
2908
2909 #. type: Plain text
2910 #: build/C/man2/sgetmask.2:45
2911 msgid ""
2912 "B<ssetmask>()  sets the signal mask of the calling process to the value "
2913 "given in I<newmask>.  The previous signal mask is returned."
2914 msgstr ""
2915
2916 #. type: Plain text
2917 #: build/C/man2/sgetmask.2:54
2918 msgid ""
2919 "The signal masks dealt with by these two system calls are plain bit masks "
2920 "(unlike the I<sigset_t> used by B<sigprocmask>(2)); use B<sigmask>(3)  to "
2921 "create and inspect these masks."
2922 msgstr ""
2923
2924 #. type: Plain text
2925 #: build/C/man2/sgetmask.2:59
2926 msgid ""
2927 "B<sgetmask>()  always successfully returns the signal mask.  B<ssetmask>()  "
2928 "always succeeds, and returns the previous signal mask."
2929 msgstr ""
2930
2931 #. type: Plain text
2932 #: build/C/man2/sgetmask.2:61
2933 msgid "These system calls always succeed."
2934 msgstr ""
2935
2936 #. type: Plain text
2937 #: build/C/man2/sgetmask.2:66
2938 msgid "Glibc does not provide wrappers for these system calls; use B<syscall>(2)."
2939 msgstr ""
2940
2941 #. type: Plain text
2942 #: build/C/man2/sgetmask.2:69
2943 msgid ""
2944 "These system calls are unaware of signal numbers greater than 31 (i.e., "
2945 "real-time signals)."
2946 msgstr ""
2947
2948 #. type: Plain text
2949 #: build/C/man2/sgetmask.2:74
2950 msgid "It is not possible to block B<SIGSTOP> or B<SIGKILL>."
2951 msgstr ""
2952
2953 #. type: Plain text
2954 #: build/C/man2/sgetmask.2:77
2955 msgid "B<sigprocmask>(2), B<signal>(7)"
2956 msgstr ""
2957
2958 #. type: TH
2959 #: build/C/man2/sigaction.2:45
2960 #, no-wrap
2961 msgid "SIGACTION"
2962 msgstr ""
2963
2964 #. type: TH
2965 #: build/C/man2/sigaction.2:45
2966 #, no-wrap
2967 msgid "2012-04-26"
2968 msgstr ""
2969
2970 #. type: Plain text
2971 #: build/C/man2/sigaction.2:48
2972 msgid "sigaction - examine and change a signal action"
2973 msgstr ""
2974
2975 #. type: Plain text
2976 #: build/C/man2/sigaction.2:54
2977 #, no-wrap
2978 msgid ""
2979 "B<int sigaction(int >I<signum>B<, const struct sigaction *>I<act>B<,>\n"
2980 "B<              struct sigaction *>I<oldact>B<);>\n"
2981 msgstr ""
2982
2983 #. type: Plain text
2984 #: build/C/man2/sigaction.2:64
2985 msgid ""
2986 "B<sigaction>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
2987 "_POSIX_SOURCE"
2988 msgstr ""
2989
2990 #. type: Plain text
2991 #: build/C/man2/sigaction.2:73
2992 msgid ""
2993 "The B<sigaction>()  system call is used to change the action taken by a "
2994 "process on receipt of a specific signal.  (See B<signal>(7)  for an overview "
2995 "of signals.)"
2996 msgstr ""
2997
2998 #. type: Plain text
2999 #: build/C/man2/sigaction.2:79
3000 msgid ""
3001 "I<signum> specifies the signal and can be any valid signal except B<SIGKILL> "
3002 "and B<SIGSTOP>."
3003 msgstr ""
3004
3005 #. type: Plain text
3006 #: build/C/man2/sigaction.2:90
3007 msgid ""
3008 "If I<act> is non-NULL, the new action for signal I<signum> is installed from "
3009 "I<act>.  If I<oldact> is non-NULL, the previous action is saved in "
3010 "I<oldact>."
3011 msgstr ""
3012
3013 #. type: Plain text
3014 #: build/C/man2/sigaction.2:94
3015 msgid "The I<sigaction> structure is defined as something like:"
3016 msgstr ""
3017
3018 #. type: Plain text
3019 #: build/C/man2/sigaction.2:104
3020 #, no-wrap
3021 msgid ""
3022 "struct sigaction {\n"
3023 "    void     (*sa_handler)(int);\n"
3024 "    void     (*sa_sigaction)(int, siginfo_t *, void *);\n"
3025 "    sigset_t   sa_mask;\n"
3026 "    int        sa_flags;\n"
3027 "    void     (*sa_restorer)(void);\n"
3028 "};\n"
3029 msgstr ""
3030
3031 #. type: Plain text
3032 #: build/C/man2/sigaction.2:111
3033 msgid ""
3034 "On some architectures a union is involved: do not assign to both "
3035 "I<sa_handler> and I<sa_sigaction>."
3036 msgstr ""
3037
3038 #. type: Plain text
3039 #: build/C/man2/sigaction.2:118
3040 msgid ""
3041 "The I<sa_restorer> element is obsolete and should not be used.  POSIX does "
3042 "not specify a I<sa_restorer> element."
3043 msgstr ""
3044
3045 #. type: Plain text
3046 #: build/C/man2/sigaction.2:128
3047 msgid ""
3048 "I<sa_handler> specifies the action to be associated with I<signum> and may "
3049 "be B<SIG_DFL> for the default action, B<SIG_IGN> to ignore this signal, or a "
3050 "pointer to a signal handling function.  This function receives the signal "
3051 "number as its only argument."
3052 msgstr ""
3053
3054 #. type: Plain text
3055 #: build/C/man2/sigaction.2:150
3056 msgid ""
3057 "If B<SA_SIGINFO> is specified in I<sa_flags>, then I<sa_sigaction> (instead "
3058 "of I<sa_handler>)  specifies the signal-handling function for I<signum>.  "
3059 "This function receives the signal number as its first argument, a pointer to "
3060 "a I<siginfo_t> as its second argument and a pointer to a I<ucontext_t> (cast "
3061 "to I<void\\ *>) as its third argument.  (Commonly, the handler function "
3062 "doesn't make any use of the third argument.  See B<getcontext>(2)  for "
3063 "further information about I<ucontext_t>.)"
3064 msgstr ""
3065
3066 #. type: Plain text
3067 #: build/C/man2/sigaction.2:160
3068 msgid ""
3069 "I<sa_mask> specifies a mask of signals which should be blocked (i.e., added "
3070 "to the signal mask of the thread in which the signal handler is invoked)  "
3071 "during execution of the signal handler.  In addition, the signal which "
3072 "triggered the handler will be blocked, unless the B<SA_NODEFER> flag is "
3073 "used."
3074 msgstr ""
3075
3076 #. type: Plain text
3077 #: build/C/man2/sigaction.2:164
3078 msgid ""
3079 "I<sa_flags> specifies a set of flags which modify the behavior of the "
3080 "signal.  It is formed by the bitwise OR of zero or more of the following:"
3081 msgstr ""
3082
3083 #. type: TP
3084 #: build/C/man2/sigaction.2:165
3085 #, no-wrap
3086 msgid "B<SA_NOCLDSTOP>"
3087 msgstr ""
3088
3089 #. type: Plain text
3090 #: build/C/man2/sigaction.2:182
3091 msgid ""
3092 "If I<signum> is B<SIGCHLD>, do not receive notification when child processes "
3093 "stop (i.e., when they receive one of B<SIGSTOP>, B<SIGTSTP>, B<SIGTTIN> or "
3094 "B<SIGTTOU>)  or resume (i.e., they receive B<SIGCONT>)  (see B<wait>(2)).  "
3095 "This flag is only meaningful when establishing a handler for B<SIGCHLD>."
3096 msgstr ""
3097
3098 #. type: TP
3099 #: build/C/man2/sigaction.2:182
3100 #, no-wrap
3101 msgid "B<SA_NOCLDWAIT> (since Linux 2.6)"
3102 msgstr ""
3103
3104 #.  To be precise: Linux 2.5.60 -- MTK
3105 #. type: Plain text
3106 #: build/C/man2/sigaction.2:196
3107 msgid ""
3108 "If I<signum> is B<SIGCHLD>, do not transform children into zombies when they "
3109 "terminate.  See also B<waitpid>(2).  This flag is only meaningful when "
3110 "establishing a handler for B<SIGCHLD>, or when setting that signal's "
3111 "disposition to B<SIG_DFL>."
3112 msgstr ""
3113
3114 #. type: Plain text
3115 #: build/C/man2/sigaction.2:208
3116 msgid ""
3117 "If the B<SA_NOCLDWAIT> flag is set when establishing a handler for "
3118 "B<SIGCHLD>, POSIX.1 leaves it unspecified whether a B<SIGCHLD> signal is "
3119 "generated when a child process terminates.  On Linux, a B<SIGCHLD> signal is "
3120 "generated in this case; on some other implementations, it is not."
3121 msgstr ""
3122
3123 #. type: TP
3124 #: build/C/man2/sigaction.2:208
3125 #, no-wrap
3126 msgid "B<SA_NODEFER>"
3127 msgstr ""
3128
3129 #. type: Plain text
3130 #: build/C/man2/sigaction.2:215
3131 msgid ""
3132 "Do not prevent the signal from being received from within its own signal "
3133 "handler.  This flag is only meaningful when establishing a signal handler.  "
3134 "B<SA_NOMASK> is an obsolete, nonstandard synonym for this flag."
3135 msgstr ""
3136
3137 #. type: TP
3138 #: build/C/man2/sigaction.2:215
3139 #, no-wrap
3140 msgid "B<SA_ONSTACK>"
3141 msgstr ""
3142
3143 #. type: Plain text
3144 #: build/C/man2/sigaction.2:221
3145 msgid ""
3146 "Call the signal handler on an alternate signal stack provided by "
3147 "B<sigaltstack>(2).  If an alternate stack is not available, the default "
3148 "stack will be used.  This flag is only meaningful when establishing a signal "
3149 "handler."
3150 msgstr ""
3151
3152 #. type: TP
3153 #: build/C/man2/sigaction.2:221
3154 #, no-wrap
3155 msgid "B<SA_RESETHAND>"
3156 msgstr ""
3157
3158 #. type: Plain text
3159 #: build/C/man2/sigaction.2:228
3160 msgid ""
3161 "Restore the signal action to the default state once the signal handler has "
3162 "been called.  This flag is only meaningful when establishing a signal "
3163 "handler.  B<SA_ONESHOT> is an obsolete, nonstandard synonym for this flag."
3164 msgstr ""
3165
3166 #. type: TP
3167 #: build/C/man2/sigaction.2:228
3168 #, no-wrap
3169 msgid "B<SA_RESTART>"
3170 msgstr ""
3171
3172 #. type: Plain text
3173 #: build/C/man2/sigaction.2:236
3174 msgid ""
3175 "Provide behavior compatible with BSD signal semantics by making certain "
3176 "system calls restartable across signals.  This flag is only meaningful when "
3177 "establishing a signal handler.  See B<signal>(7)  for a discussion of system "
3178 "call restarting."
3179 msgstr ""
3180
3181 #. type: TP
3182 #: build/C/man2/sigaction.2:236
3183 #, no-wrap
3184 msgid "B<SA_SIGINFO> (since Linux 2.2)"
3185 msgstr ""
3186
3187 #.  (The
3188 #.  .I sa_sigaction
3189 #.  field was added in Linux 2.1.86.)
3190 #. type: Plain text
3191 #: build/C/man2/sigaction.2:247
3192 msgid ""
3193 "The signal handler takes 3 arguments, not one.  In this case, "
3194 "I<sa_sigaction> should be set instead of I<sa_handler>.  This flag is only "
3195 "meaningful when establishing a signal handler."
3196 msgstr ""
3197
3198 #. type: Plain text
3199 #: build/C/man2/sigaction.2:254
3200 msgid ""
3201 "The I<siginfo_t> argument to I<sa_sigaction> is a struct with the following "
3202 "elements:"
3203 msgstr ""
3204
3205 #.  FIXME
3206 #.  si_trapno seems to be only used on SPARC and Alpha;
3207 #.  this page could use a little more detail on its purpose there.
3208 #.  In the kernel: si_tid
3209 #. type: Plain text
3210 #: build/C/man2/sigaction.2:285
3211 #, no-wrap
3212 msgid ""
3213 "siginfo_t {\n"
3214 "    int      si_signo;    /* Signal number */\n"
3215 "    int      si_errno;    /* An errno value */\n"
3216 "    int      si_code;     /* Signal code */\n"
3217 "    int      si_trapno;   /* Trap number that caused\n"
3218 "                             hardware-generated signal\n"
3219 "                             (unused on most architectures) */\n"
3220 "    pid_t    si_pid;      /* Sending process ID */\n"
3221 "    uid_t    si_uid;      /* Real user ID of sending process */\n"
3222 "    int      si_status;   /* Exit value or signal */\n"
3223 "    clock_t  si_utime;    /* User time consumed */\n"
3224 "    clock_t  si_stime;    /* System time consumed */\n"
3225 "    sigval_t si_value;    /* Signal value */\n"
3226 "    int      si_int;      /* POSIX.1b signal */\n"
3227 "    void    *si_ptr;      /* POSIX.1b signal */\n"
3228 "    int      si_overrun;  /* Timer overrun count; POSIX.1b timers */\n"
3229 "    int      si_timerid;  /* Timer ID; POSIX.1b timers */\n"
3230 "    void    *si_addr;     /* Memory location which caused fault */\n"
3231 "    long     si_band;     /* Band event (was I<int> in\n"
3232 "                             glibc 2.3.2 and earlier) */\n"
3233 "    int      si_fd;       /* File descriptor */\n"
3234 "    short    si_addr_lsb; /* Least significant bit of address\n"
3235 "                             (since kernel 2.6.32) */\n"
3236 "}\n"
3237 msgstr ""
3238
3239 #. type: Plain text
3240 #: build/C/man2/sigaction.2:294
3241 msgid ""
3242 "I<si_signo>, I<si_errno> and I<si_code> are defined for all signals.  "
3243 "(I<si_errno> is generally unused on Linux.)  The rest of the struct may be a "
3244 "union, so that one should only read the fields that are meaningful for the "
3245 "given signal:"
3246 msgstr ""
3247
3248 #. type: Plain text
3249 #: build/C/man2/sigaction.2:309
3250 msgid ""
3251 "Signals sent with B<kill>(2)  and B<sigqueue>(3)  fill in I<si_pid> and "
3252 "I<si_uid>.  In addition, signals sent with B<sigqueue>(3)  fill in I<si_int> "
3253 "and I<si_ptr> with the values specified by the sender of the signal; see "
3254 "B<sigqueue>(3)  for more details."
3255 msgstr ""
3256
3257 #. type: Plain text
3258 #: build/C/man2/sigaction.2:325
3259 msgid ""
3260 "Signals sent by POSIX.1b timers (since Linux 2.6) fill in I<si_overrun> and "
3261 "I<si_timerid>.  The I<si_timerid> field is an internal ID used by the kernel "
3262 "to identify the timer; it is not the same as the timer ID returned by "
3263 "B<timer_create>(2).  The I<si_overrun> field is the timer overrun count; "
3264 "this is the same information as is obtained by a call to "
3265 "B<timer_getoverrun>(2).  These fields are nonstandard Linux extensions."
3266 msgstr ""
3267
3268 #. type: Plain text
3269 #: build/C/man2/sigaction.2:340
3270 msgid ""
3271 "Signals sent for message queue notification (see the description of "
3272 "B<SIGEV_SIGNAL> in B<mq_notify>(3))  fill in I<si_int>/I<si_ptr>, with the "
3273 "I<sigev_value> supplied to B<mq_notify>(3); I<si_pid>, with the process ID "
3274 "of the message sender; and I<si_uid>, with the real user ID of the message "
3275 "sender."
3276 msgstr ""
3277
3278 #.  FIXME .
3279 #.  When si_utime and si_stime where originally implemented, the
3280 #.  measurement unit was HZ, which was the same as clock ticks
3281 #.  (sysconf(_SC_CLK_TCK)).  In 2.6, HZ became configurable, and
3282 #.  was *still* used as the unit to return the info these fields,
3283 #.  with the result that the field values depended on the the
3284 #.  configured HZ.  Of course, the should have been measured in
3285 #.  USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to
3286 #.  convert to seconds.  I have a queued patch to fix this:
3287 #.  http://thread.gmane.org/gmane.linux.kernel/698061/ .
3288 #.  This patch made it into 2.6.27.
3289 #.  But note that these fields still don't return the times of
3290 #.  waited-for children (as is done by getrusage() and times()
3291 #.  and wait4()).  Solaris 8 does include child times.
3292 #. type: Plain text
3293 #: build/C/man2/sigaction.2:387
3294 msgid ""
3295 "B<SIGCHLD> fills in I<si_pid>, I<si_uid>, I<si_status>, I<si_utime> and "
3296 "I<si_stime>, providing information about the child.  The I<si_pid> field is "
3297 "the process ID of the child; I<si_uid> is the child's real user ID.  The "
3298 "I<si_status> field contains the exit status of the child (if I<si_code> is "
3299 "B<CLD_EXITED>), or the signal number that caused the process to change "
3300 "state.  The I<si_utime> and I<si_stime> contain the user and system CPU time "
3301 "used by the child process; these fields do not include the times used by "
3302 "waited-for children (unlike B<getrusage>(2)  and B<time>(2)).  In kernels up "
3303 "to 2.6, and since 2.6.27, these fields report CPU time in units of "
3304 "I<sysconf(_SC_CLK_TCK)>.  In 2.6 kernels before 2.6.27, a bug meant that "
3305 "these fields reported time in units of the (configurable) system jiffy (see "
3306 "B<time>(7))."
3307 msgstr ""
3308
3309 #.  FIXME SIGTRAP also sets the following for ptrace_notify() ?
3310 #.      info.si_code = exit_code;
3311 #.      info.si_pid = task_pid_vnr(current);
3312 #.      info.si_uid = current_uid();  /* Real UID */
3313 #. type: Plain text
3314 #: build/C/man2/sigaction.2:423
3315 msgid ""
3316 "B<SIGILL>, B<SIGFPE>, B<SIGSEGV>, B<SIGBUS>, and B<SIGTRAP> fill in "
3317 "I<si_addr> with the address of the fault.  On some architectures, these "
3318 "signals also fill in the I<si_trapno> filed.  Some suberrors of B<SIGBUS>, "
3319 "in particular B<BUS_MCEERR_AO> and B<BUS_MCEERR_AR>, also fill in "
3320 "I<si_addr_lsb>.  This field indicates the least significant bit of the "
3321 "reported address and therefore the extent of the corruption.  For example, "
3322 "if a full page was corrupted, I<si_addr_lsb> contains "
3323 "I<log2(sysconf(_SC_PAGESIZE))>.  B<BUS_MCERR_*> and I<si_addr_lsb> are "
3324 "Linux-specific extensions."
3325 msgstr ""
3326
3327 #. type: Plain text
3328 #: build/C/man2/sigaction.2:437
3329 msgid ""
3330 "B<SIGIO>/B<SIGPOLL> (the two names are synonyms on Linux)  fills in "
3331 "I<si_band> and I<si_fd>.  The I<si_band> event is a bit mask containing the "
3332 "same values as are filled in the I<revents> field by B<poll>(2).  The "
3333 "I<si_fd> field indicates the file descriptor for which the I/O event "
3334 "occurred."
3335 msgstr ""
3336
3337 #. type: Plain text
3338 #: build/C/man2/sigaction.2:444
3339 msgid ""
3340 "I<si_code> is a value (not a bit mask)  indicating why this signal was "
3341 "sent.  The following list shows the values which can be placed in I<si_code> "
3342 "for any signal, along with reason that the signal was generated."
3343 msgstr ""
3344
3345 #. type: TP
3346 #: build/C/man2/sigaction.2:445
3347 #, no-wrap
3348 msgid "B<SI_USER>"
3349 msgstr ""
3350
3351 #. type: TP
3352 #: build/C/man2/sigaction.2:448 build/C/man7/signal.7:109
3353 #, no-wrap
3354 msgid "B<kill>(2)"
3355 msgstr ""
3356
3357 #. type: TP
3358 #: build/C/man2/sigaction.2:448
3359 #, no-wrap
3360 msgid "B<SI_KERNEL>"
3361 msgstr ""
3362
3363 #. type: Plain text
3364 #: build/C/man2/sigaction.2:451
3365 msgid "Sent by the kernel."
3366 msgstr ""
3367
3368 #. type: TP
3369 #: build/C/man2/sigaction.2:451
3370 #, no-wrap
3371 msgid "B<SI_QUEUE>"
3372 msgstr ""
3373
3374 #. type: TP
3375 #: build/C/man2/sigaction.2:454 build/C/man7/signal.7:126
3376 #, no-wrap
3377 msgid "B<sigqueue>(3)"
3378 msgstr ""
3379
3380 #. type: TP
3381 #: build/C/man2/sigaction.2:454
3382 #, no-wrap
3383 msgid "B<SI_TIMER>"
3384 msgstr ""
3385
3386 #. type: Plain text
3387 #: build/C/man2/sigaction.2:457
3388 msgid "POSIX timer expired"
3389 msgstr ""
3390
3391 #. type: TP
3392 #: build/C/man2/sigaction.2:457
3393 #, no-wrap
3394 msgid "B<SI_MESGQ>"
3395 msgstr ""
3396
3397 #. type: Plain text
3398 #: build/C/man2/sigaction.2:461
3399 msgid "POSIX message queue state changed (since Linux 2.6.6); see B<mq_notify>(3)"
3400 msgstr ""
3401
3402 #. type: TP
3403 #: build/C/man2/sigaction.2:461
3404 #, no-wrap
3405 msgid "B<SI_ASYNCIO>"
3406 msgstr ""
3407
3408 #. type: Plain text
3409 #: build/C/man2/sigaction.2:464
3410 msgid "AIO completed"
3411 msgstr ""
3412
3413 #. type: TP
3414 #: build/C/man2/sigaction.2:464
3415 #, no-wrap
3416 msgid "B<SI_SIGIO>"
3417 msgstr ""
3418
3419 #. type: Plain text
3420 #: build/C/man2/sigaction.2:473
3421 msgid ""
3422 "Queued B<SIGIO> (only in kernels up to Linux 2.2; from Linux 2.4 onward "
3423 "B<SIGIO>/B<SIGPOLL> fills in I<si_code> as described below)."
3424 msgstr ""
3425
3426 #. type: TP
3427 #: build/C/man2/sigaction.2:473
3428 #, no-wrap
3429 msgid "B<SI_TKILL>"
3430 msgstr ""
3431
3432 #.  SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented
3433 #.  It appears to have been an idea that was tried during 2.5.6
3434 #.  through to 2.5.24 and then was backed out.
3435 #. type: Plain text
3436 #: build/C/man2/sigaction.2:482
3437 msgid "B<tkill>(2)  or B<tgkill>(2)  (since Linux 2.4.19)"
3438 msgstr ""
3439
3440 #. type: Plain text
3441 #: build/C/man2/sigaction.2:489
3442 msgid "The following values can be placed in I<si_code> for a B<SIGILL> signal:"
3443 msgstr ""
3444
3445 #. type: TP
3446 #: build/C/man2/sigaction.2:490
3447 #, no-wrap
3448 msgid "B<ILL_ILLOPC>"
3449 msgstr ""
3450
3451 #. type: Plain text
3452 #: build/C/man2/sigaction.2:493
3453 msgid "illegal opcode"
3454 msgstr ""
3455
3456 #. type: TP
3457 #: build/C/man2/sigaction.2:493
3458 #, no-wrap
3459 msgid "B<ILL_ILLOPN>"
3460 msgstr ""
3461
3462 #. type: Plain text
3463 #: build/C/man2/sigaction.2:496
3464 msgid "illegal operand"
3465 msgstr ""
3466
3467 #. type: TP
3468 #: build/C/man2/sigaction.2:496
3469 #, no-wrap
3470 msgid "B<ILL_ILLADR>"
3471 msgstr ""
3472
3473 #. type: Plain text
3474 #: build/C/man2/sigaction.2:499
3475 msgid "illegal addressing mode"
3476 msgstr ""
3477
3478 #. type: TP
3479 #: build/C/man2/sigaction.2:499
3480 #, no-wrap
3481 msgid "B<ILL_ILLTRP>"
3482 msgstr ""
3483
3484 #. type: Plain text
3485 #: build/C/man2/sigaction.2:502
3486 msgid "illegal trap"
3487 msgstr ""
3488
3489 #. type: TP
3490 #: build/C/man2/sigaction.2:502
3491 #, no-wrap
3492 msgid "B<ILL_PRVOPC>"
3493 msgstr ""
3494
3495 #. type: Plain text
3496 #: build/C/man2/sigaction.2:505
3497 msgid "privileged opcode"
3498 msgstr ""
3499
3500 #. type: TP
3501 #: build/C/man2/sigaction.2:505
3502 #, no-wrap
3503 msgid "B<ILL_PRVREG>"
3504 msgstr ""
3505
3506 #. type: Plain text
3507 #: build/C/man2/sigaction.2:508
3508 msgid "privileged register"
3509 msgstr ""
3510
3511 #. type: TP
3512 #: build/C/man2/sigaction.2:508
3513 #, no-wrap
3514 msgid "B<ILL_COPROC>"
3515 msgstr ""
3516
3517 #. type: Plain text
3518 #: build/C/man2/sigaction.2:511
3519 msgid "coprocessor error"
3520 msgstr ""
3521
3522 #. type: TP
3523 #: build/C/man2/sigaction.2:511
3524 #, no-wrap
3525 msgid "B<ILL_BADSTK>"
3526 msgstr ""
3527
3528 #. type: Plain text
3529 #: build/C/man2/sigaction.2:514
3530 msgid "internal stack error"
3531 msgstr ""
3532
3533 #. type: Plain text
3534 #: build/C/man2/sigaction.2:521
3535 msgid "The following values can be placed in I<si_code> for a B<SIGFPE> signal:"
3536 msgstr ""
3537
3538 #. type: TP
3539 #: build/C/man2/sigaction.2:522
3540 #, no-wrap
3541 msgid "B<FPE_INTDIV>"
3542 msgstr ""
3543
3544 #. type: Plain text
3545 #: build/C/man2/sigaction.2:525
3546 msgid "integer divide by zero"
3547 msgstr ""
3548
3549 #. type: TP
3550 #: build/C/man2/sigaction.2:525
3551 #, no-wrap
3552 msgid "B<FPE_INTOVF>"
3553 msgstr ""
3554
3555 #. type: Plain text
3556 #: build/C/man2/sigaction.2:528
3557 msgid "integer overflow"
3558 msgstr ""
3559
3560 #. type: TP
3561 #: build/C/man2/sigaction.2:528
3562 #, no-wrap
3563 msgid "B<FPE_FLTDIV>"
3564 msgstr ""
3565
3566 #. type: Plain text
3567 #: build/C/man2/sigaction.2:531
3568 msgid "floating-point divide by zero"
3569 msgstr ""
3570
3571 #. type: TP
3572 #: build/C/man2/sigaction.2:531
3573 #, no-wrap
3574 msgid "B<FPE_FLTOVF>"
3575 msgstr ""
3576
3577 #. type: Plain text
3578 #: build/C/man2/sigaction.2:534
3579 msgid "floating-point overflow"
3580 msgstr ""
3581
3582 #. type: TP
3583 #: build/C/man2/sigaction.2:534
3584 #, no-wrap
3585 msgid "B<FPE_FLTUND>"
3586 msgstr ""
3587
3588 #. type: Plain text
3589 #: build/C/man2/sigaction.2:537
3590 msgid "floating-point underflow"
3591 msgstr ""
3592
3593 #. type: TP
3594 #: build/C/man2/sigaction.2:537
3595 #, no-wrap
3596 msgid "B<FPE_FLTRES>"
3597 msgstr ""
3598
3599 #. type: Plain text
3600 #: build/C/man2/sigaction.2:540
3601 msgid "floating-point inexact result"
3602 msgstr ""
3603
3604 #. type: TP
3605 #: build/C/man2/sigaction.2:540
3606 #, no-wrap
3607 msgid "B<FPE_FLTINV>"
3608 msgstr ""
3609
3610 #. type: Plain text
3611 #: build/C/man2/sigaction.2:543
3612 msgid "floating-point invalid operation"
3613 msgstr ""
3614
3615 #. type: TP
3616 #: build/C/man2/sigaction.2:543
3617 #, no-wrap
3618 msgid "B<FPE_FLTSUB>"
3619 msgstr ""
3620
3621 #. type: Plain text
3622 #: build/C/man2/sigaction.2:546
3623 msgid "subscript out of range"
3624 msgstr ""
3625
3626 #. type: Plain text
3627 #: build/C/man2/sigaction.2:553
3628 msgid "The following values can be placed in I<si_code> for a B<SIGSEGV> signal:"
3629 msgstr ""
3630
3631 #. type: TP
3632 #: build/C/man2/sigaction.2:554
3633 #, no-wrap
3634 msgid "B<SEGV_MAPERR>"
3635 msgstr ""
3636
3637 #. type: Plain text
3638 #: build/C/man2/sigaction.2:557
3639 msgid "address not mapped to object"
3640 msgstr ""
3641
3642 #. type: TP
3643 #: build/C/man2/sigaction.2:557
3644 #, no-wrap
3645 msgid "B<SEGV_ACCERR>"
3646 msgstr ""
3647
3648 #. type: Plain text
3649 #: build/C/man2/sigaction.2:560
3650 msgid "invalid permissions for mapped object"
3651 msgstr ""
3652
3653 #. type: Plain text
3654 #: build/C/man2/sigaction.2:567
3655 msgid "The following values can be placed in I<si_code> for a B<SIGBUS> signal:"
3656 msgstr ""
3657
3658 #. type: TP
3659 #: build/C/man2/sigaction.2:568
3660 #, no-wrap
3661 msgid "B<BUS_ADRALN>"
3662 msgstr ""
3663
3664 #. type: Plain text
3665 #: build/C/man2/sigaction.2:571
3666 msgid "invalid address alignment"
3667 msgstr ""
3668
3669 #. type: TP
3670 #: build/C/man2/sigaction.2:571
3671 #, no-wrap
3672 msgid "B<BUS_ADRERR>"
3673 msgstr ""
3674
3675 #. type: Plain text
3676 #: build/C/man2/sigaction.2:574
3677 msgid "nonexistent physical address"
3678 msgstr ""
3679
3680 #. type: TP
3681 #: build/C/man2/sigaction.2:574
3682 #, no-wrap
3683 msgid "B<BUS_OBJERR>"
3684 msgstr ""
3685
3686 #. type: Plain text
3687 #: build/C/man2/sigaction.2:577
3688 msgid "object-specific hardware error"
3689 msgstr ""
3690
3691 #. type: TP
3692 #: build/C/man2/sigaction.2:577
3693 #, no-wrap
3694 msgid "B<BUS_MCEERR_AR> (since Linux 2.6.32)"
3695 msgstr ""
3696
3697 #. type: Plain text
3698 #: build/C/man2/sigaction.2:580
3699 msgid "Hardware memory error consumed on a machine check; action required."
3700 msgstr ""
3701
3702 #. type: TP
3703 #: build/C/man2/sigaction.2:580
3704 #, no-wrap
3705 msgid "B<BUS_MCEERR_AO> (since Linux 2.6.32)"
3706 msgstr ""
3707
3708 #. type: Plain text
3709 #: build/C/man2/sigaction.2:583
3710 msgid "Hardware memory error detected in process but not consumed; action optional."
3711 msgstr ""
3712
3713 #. type: Plain text
3714 #: build/C/man2/sigaction.2:590
3715 msgid "The following values can be placed in I<si_code> for a B<SIGTRAP> signal:"
3716 msgstr ""
3717
3718 #. type: TP
3719 #: build/C/man2/sigaction.2:591
3720 #, no-wrap
3721 msgid "B<TRAP_BRKPT>"
3722 msgstr ""
3723
3724 #. type: Plain text
3725 #: build/C/man2/sigaction.2:594
3726 msgid "process breakpoint"
3727 msgstr ""
3728
3729 #. type: TP
3730 #: build/C/man2/sigaction.2:594
3731 #, no-wrap
3732 msgid "B<TRAP_TRACE>"
3733 msgstr ""
3734
3735 #. type: Plain text
3736 #: build/C/man2/sigaction.2:597
3737 msgid "process trace trap"
3738 msgstr ""
3739
3740 #. type: TP
3741 #: build/C/man2/sigaction.2:597
3742 #, no-wrap
3743 msgid "B<TRAP_BRANCH> (since Linux 2.4)"
3744 msgstr ""
3745
3746 #. type: Plain text
3747 #: build/C/man2/sigaction.2:600
3748 msgid "process taken branch trap"
3749 msgstr ""
3750
3751 #. type: TP
3752 #: build/C/man2/sigaction.2:600
3753 #, no-wrap
3754 msgid "B<TRAP_HWBKPT> (since Linux 2.4)"
3755 msgstr ""
3756
3757 #. type: Plain text
3758 #: build/C/man2/sigaction.2:603
3759 msgid "hardware breakpoint/watchpoint"
3760 msgstr ""
3761
3762 #. type: Plain text
3763 #: build/C/man2/sigaction.2:610
3764 msgid "The following values can be placed in I<si_code> for a B<SIGCHLD> signal:"
3765 msgstr ""
3766
3767 #. type: TP
3768 #: build/C/man2/sigaction.2:611
3769 #, no-wrap
3770 msgid "B<CLD_EXITED>"
3771 msgstr ""
3772
3773 #. type: Plain text
3774 #: build/C/man2/sigaction.2:614
3775 msgid "child has exited"
3776 msgstr ""
3777
3778 #. type: TP
3779 #: build/C/man2/sigaction.2:614
3780 #, no-wrap
3781 msgid "B<CLD_KILLED>"
3782 msgstr ""
3783
3784 #. type: Plain text
3785 #: build/C/man2/sigaction.2:617
3786 msgid "child was killed"
3787 msgstr ""
3788
3789 #. type: TP
3790 #: build/C/man2/sigaction.2:617
3791 #, no-wrap
3792 msgid "B<CLD_DUMPED>"
3793 msgstr ""
3794
3795 #. type: Plain text
3796 #: build/C/man2/sigaction.2:620
3797 msgid "child terminated abnormally"
3798 msgstr ""
3799
3800 #. type: TP
3801 #: build/C/man2/sigaction.2:620
3802 #, no-wrap
3803 msgid "B<CLD_TRAPPED>"
3804 msgstr ""
3805
3806 #. type: Plain text
3807 #: build/C/man2/sigaction.2:623
3808 msgid "traced child has trapped"
3809 msgstr ""
3810
3811 #. type: TP
3812 #: build/C/man2/sigaction.2:623
3813 #, no-wrap
3814 msgid "B<CLD_STOPPED>"
3815 msgstr ""
3816
3817 #. type: Plain text
3818 #: build/C/man2/sigaction.2:626
3819 msgid "child has stopped"
3820 msgstr ""
3821
3822 #. type: TP
3823 #: build/C/man2/sigaction.2:626
3824 #, no-wrap
3825 msgid "B<CLD_CONTINUED>"
3826 msgstr ""
3827
3828 #. type: Plain text
3829 #: build/C/man2/sigaction.2:629
3830 msgid "stopped child has continued (since Linux 2.6.9)"
3831 msgstr ""
3832
3833 #. type: Plain text
3834 #: build/C/man2/sigaction.2:636
3835 msgid ""
3836 "The following values can be placed in I<si_code> for a B<SIGIO>/B<SIGPOLL> "
3837 "signal:"
3838 msgstr ""
3839
3840 #. type: TP
3841 #: build/C/man2/sigaction.2:637
3842 #, no-wrap
3843 msgid "B<POLL_IN>"
3844 msgstr ""
3845
3846 #. type: Plain text
3847 #: build/C/man2/sigaction.2:640
3848 msgid "data input available"
3849 msgstr ""
3850
3851 #. type: TP
3852 #: build/C/man2/sigaction.2:640
3853 #, no-wrap
3854 msgid "B<POLL_OUT>"
3855 msgstr ""
3856
3857 #. type: Plain text
3858 #: build/C/man2/sigaction.2:643
3859 msgid "output buffers available"
3860 msgstr ""
3861
3862 #. type: TP
3863 #: build/C/man2/sigaction.2:643
3864 #, no-wrap
3865 msgid "B<POLL_MSG>"
3866 msgstr ""
3867
3868 #. type: Plain text
3869 #: build/C/man2/sigaction.2:646
3870 msgid "input message available"
3871 msgstr ""
3872
3873 #. type: TP
3874 #: build/C/man2/sigaction.2:646
3875 #, no-wrap
3876 msgid "B<POLL_ERR>"
3877 msgstr ""
3878
3879 #. type: Plain text
3880 #: build/C/man2/sigaction.2:649
3881 msgid "I/O error"
3882 msgstr ""
3883
3884 #. type: TP
3885 #: build/C/man2/sigaction.2:649
3886 #, no-wrap
3887 msgid "B<POLL_PRI>"
3888 msgstr ""
3889
3890 #. type: Plain text
3891 #: build/C/man2/sigaction.2:652
3892 msgid "high priority input available"
3893 msgstr ""
3894
3895 #. type: TP
3896 #: build/C/man2/sigaction.2:652
3897 #, no-wrap
3898 msgid "B<POLL_HUP>"
3899 msgstr ""
3900
3901 #. type: Plain text
3902 #: build/C/man2/sigaction.2:655
3903 msgid "device disconnected"
3904 msgstr ""
3905
3906 #. type: Plain text
3907 #: build/C/man2/sigaction.2:659
3908 msgid "B<sigaction>()  returns 0 on success and -1 on error."
3909 msgstr ""
3910
3911 #. type: Plain text
3912 #: build/C/man2/sigaction.2:664
3913 msgid ""
3914 "I<act> or I<oldact> points to memory which is not a valid part of the "
3915 "process address space."
3916 msgstr ""
3917
3918 #. type: Plain text
3919 #: build/C/man2/sigaction.2:671
3920 msgid ""
3921 "An invalid signal was specified.  This will also be generated if an attempt "
3922 "is made to change the action for B<SIGKILL> or B<SIGSTOP>, which cannot be "
3923 "caught or ignored."
3924 msgstr ""
3925
3926 #.  SVr4 does not document the EINTR condition.
3927 #. type: Plain text
3928 #: build/C/man2/sigaction.2:674
3929 msgid "POSIX.1-2001, SVr4."
3930 msgstr ""
3931
3932 #. type: Plain text
3933 #: build/C/man2/sigaction.2:682 build/C/man7/signal.7:103
3934 msgid ""
3935 "A child created via B<fork>(2)  inherits a copy of its parent's signal "
3936 "dispositions.  During an B<execve>(2), the dispositions of handled signals "
3937 "are reset to the default; the dispositions of ignored signals are left "
3938 "unchanged."
3939 msgstr ""
3940
3941 #. type: Plain text
3942 #: build/C/man2/sigaction.2:700 build/C/man2/signal.2:129
3943 msgid ""
3944 "According to POSIX, the behavior of a process is undefined after it ignores "
3945 "a B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> signal that was not generated by "
3946 "B<kill>(2)  or B<raise>(3).  Integer division by zero has undefined result.  "
3947 "On some architectures it will generate a B<SIGFPE> signal.  (Also dividing "
3948 "the most negative integer by -1 may generate B<SIGFPE>.)  Ignoring this "
3949 "signal might lead to an endless loop."
3950 msgstr ""
3951
3952 #. type: Plain text
3953 #: build/C/man2/sigaction.2:717
3954 msgid ""
3955 "POSIX.1-1990 disallowed setting the action for B<SIGCHLD> to B<SIG_IGN>.  "
3956 "POSIX.1-2001 allows this possibility, so that ignoring B<SIGCHLD> can be "
3957 "used to prevent the creation of zombies (see B<wait>(2)).  Nevertheless, the "
3958 "historical BSD and System V behaviors for ignoring B<SIGCHLD> differ, so "
3959 "that the only completely portable method of ensuring that terminated "
3960 "children do not become zombies is to catch the B<SIGCHLD> signal and perform "
3961 "a B<wait>(2)  or similar."
3962 msgstr ""
3963
3964 #. type: Plain text
3965 #: build/C/man2/sigaction.2:730
3966 msgid ""
3967 "POSIX.1-1990 only specified B<SA_NOCLDSTOP>.  POSIX.1-2001 added "
3968 "B<SA_NOCLDWAIT>, B<SA_RESETHAND>, B<SA_NODEFER>, and B<SA_SIGINFO>.  Use of "
3969 "these latter values in I<sa_flags> may be less portable in applications "
3970 "intended for older UNIX implementations."
3971 msgstr ""
3972
3973 #. type: Plain text
3974 #: build/C/man2/sigaction.2:734
3975 msgid "The B<SA_RESETHAND> flag is compatible with the SVr4 flag of the same name."
3976 msgstr ""
3977
3978 #. type: Plain text
3979 #: build/C/man2/sigaction.2:744
3980 msgid ""
3981 "The B<SA_NODEFER> flag is compatible with the SVr4 flag of the same name "
3982 "under kernels 1.3.9 and newer.  On older kernels the Linux implementation "
3983 "allowed the receipt of any signal, not just the one we are installing "
3984 "(effectively overriding any I<sa_mask> settings)."
3985 msgstr ""
3986
3987 #. type: Plain text
3988 #: build/C/man2/sigaction.2:750
3989 msgid ""
3990 "B<sigaction>()  can be called with a NULL second argument to query the "
3991 "current signal handler.  It can also be used to check whether a given signal "
3992 "is valid for the current machine by calling it with NULL second and third "
3993 "arguments."
3994 msgstr ""
3995
3996 #. type: Plain text
3997 #: build/C/man2/sigaction.2:756
3998 msgid ""
3999 "It is not possible to block B<SIGKILL> or B<SIGSTOP> (by specifying them in "
4000 "I<sa_mask>).  Attempts to do so are silently ignored."
4001 msgstr ""
4002
4003 #. type: Plain text
4004 #: build/C/man2/sigaction.2:760 build/C/man2/sigpending.2:65 build/C/man2/sigprocmask.2:139 build/C/man2/sigsuspend.2:104
4005 msgid "See B<sigsetops>(3)  for details on manipulating signal sets."
4006 msgstr ""
4007
4008 #. type: Plain text
4009 #: build/C/man2/sigaction.2:765
4010 msgid ""
4011 "See B<signal>(7)  for a list of the async-signal-safe functions that can be "
4012 "safely called inside from inside a signal handler."
4013 msgstr ""
4014
4015 #. type: SS
4016 #: build/C/man2/sigaction.2:765
4017 #, no-wrap
4018 msgid "Undocumented"
4019 msgstr ""
4020
4021 #. type: Plain text
4022 #: build/C/man2/sigaction.2:775
4023 msgid ""
4024 "Before the introduction of B<SA_SIGINFO> it was also possible to get some "
4025 "additional information, namely by using a I<sa_handler> with second argument "
4026 "of type I<struct sigcontext>.  See the relevant kernel sources for details.  "
4027 "This use is obsolete now."
4028 msgstr ""
4029
4030 #. type: Plain text
4031 #: build/C/man2/sigaction.2:784
4032 msgid ""
4033 "In kernels up to and including 2.6.13, specifying B<SA_NODEFER> in "
4034 "I<sa_flags> prevents not only the delivered signal from being masked during "
4035 "execution of the handler, but also the signals specified in I<sa_mask>.  "
4036 "This bug was fixed in kernel 2.6.14."
4037 msgstr ""
4038
4039 #. type: Plain text
4040 #: build/C/man2/sigaction.2:787
4041 msgid "See B<mprotect>(2)."
4042 msgstr ""
4043
4044 #. type: Plain text
4045 #: build/C/man2/sigaction.2:806
4046 msgid ""
4047 "B<kill>(1), B<kill>(2), B<killpg>(2), B<pause>(2), B<sigaltstack>(2), "
4048 "B<signal>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
4049 "B<sigsuspend>(2), B<wait>(2), B<raise>(3), B<siginterrupt>(3), "
4050 "B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), B<core>(5), B<signal>(7)"
4051 msgstr ""
4052
4053 #. type: TH
4054 #: build/C/man2/sigaltstack.2:25
4055 #, no-wrap
4056 msgid "SIGALTSTACK"
4057 msgstr ""
4058
4059 #. type: TH
4060 #: build/C/man2/sigaltstack.2:25 build/C/man2/wait.2:50
4061 #, no-wrap
4062 msgid "2010-09-26"
4063 msgstr ""
4064
4065 #. type: Plain text
4066 #: build/C/man2/sigaltstack.2:28
4067 msgid "sigaltstack - set and/or get signal stack context"
4068 msgstr ""
4069
4070 #. type: Plain text
4071 #: build/C/man2/sigaltstack.2:32
4072 msgid "B<int sigaltstack(const stack_t *>I<ss>B<, stack_t *>I<oss>B<);>"
4073 msgstr ""
4074
4075 #. type: Plain text
4076 #: build/C/man2/sigaltstack.2:39
4077 msgid "B<sigaltstack>():"
4078 msgstr ""
4079
4080 #. type: Plain text
4081 #: build/C/man2/sigaltstack.2:46 build/C/man3/siginterrupt.3:51 build/C/man2/wait.2:79
4082 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
4083 msgstr ""
4084
4085 #. type: Plain text
4086 #: build/C/man2/sigaltstack.2:58
4087 msgid ""
4088 "B<sigaltstack>()  allows a process to define a new alternate signal stack "
4089 "and/or retrieve the state of an existing alternate signal stack.  An "
4090 "alternate signal stack is used during the execution of a signal handler if "
4091 "the establishment of that handler (see B<sigaction>(2))  requested it."
4092 msgstr ""
4093
4094 #. type: Plain text
4095 #: build/C/man2/sigaltstack.2:61
4096 msgid ""
4097 "The normal sequence of events for using an alternate signal stack is the "
4098 "following:"
4099 msgstr ""
4100
4101 #. type: IP
4102 #: build/C/man2/sigaltstack.2:61 build/C/man7/signal.7:385
4103 #, no-wrap
4104 msgid "1."
4105 msgstr ""
4106
4107 #. type: Plain text
4108 #: build/C/man2/sigaltstack.2:65
4109 msgid "Allocate an area of memory to be used for the alternate signal stack."
4110 msgstr ""
4111
4112 #. type: IP
4113 #: build/C/man2/sigaltstack.2:65 build/C/man7/signal.7:389
4114 #, no-wrap
4115 msgid "2."
4116 msgstr ""
4117
4118 #. type: Plain text
4119 #: build/C/man2/sigaltstack.2:71
4120 msgid ""
4121 "Use B<sigaltstack>()  to inform the system of the existence and location of "
4122 "the alternate signal stack."
4123 msgstr ""
4124
4125 #. type: IP
4126 #: build/C/man2/sigaltstack.2:71 build/C/man7/signal.7:409
4127 #, no-wrap
4128 msgid "3."
4129 msgstr ""
4130
4131 #. type: Plain text
4132 #: build/C/man2/sigaltstack.2:78
4133 msgid ""
4134 "When establishing a signal handler using B<sigaction>(2), inform the system "
4135 "that the signal handler should be executed on the alternate signal stack by "
4136 "specifying the B<SA_ONSTACK> flag."
4137 msgstr ""
4138
4139 #. type: Plain text
4140 #: build/C/man2/sigaltstack.2:86
4141 msgid ""
4142 "The I<ss> argument is used to specify a new alternate signal stack, while "
4143 "the I<oss> argument is used to retrieve information about the currently "
4144 "established signal stack.  If we are interested in performing just one of "
4145 "these tasks then the other argument can be specified as NULL.  Each of these "
4146 "arguments is a structure of the following type:"
4147 msgstr ""
4148
4149 #. type: Plain text
4150 #: build/C/man2/sigaltstack.2:94
4151 #, no-wrap
4152 msgid ""
4153 "typedef struct {\n"
4154 "    void  *ss_sp;     /* Base address of stack */\n"
4155 "    int    ss_flags;  /* Flags */\n"
4156 "    size_t ss_size;   /* Number of bytes in stack */\n"
4157 "} stack_t;\n"
4158 msgstr ""
4159
4160 #. type: Plain text
4161 #: build/C/man2/sigaltstack.2:105
4162 msgid ""
4163 "To establish a new alternate signal stack, I<ss.ss_flags> is set to zero, "
4164 "and I<ss.ss_sp> and I<ss.ss_size> specify the starting address and size of "
4165 "the stack.  The constant B<SIGSTKSZ> is defined to be large enough to cover "
4166 "the usual size requirements for an alternate signal stack, and the constant "
4167 "B<MINSIGSTKSZ> defines the minimum size required to execute a signal "
4168 "handler."
4169 msgstr ""
4170
4171 #. type: Plain text
4172 #: build/C/man2/sigaltstack.2:109
4173 msgid ""
4174 "When a signal handler is invoked on the alternate stack, the kernel "
4175 "automatically aligns the address given in I<ss.ss_sp> to a suitable address "
4176 "boundary for the underlying hardware architecture."
4177 msgstr ""
4178
4179 #. type: Plain text
4180 #: build/C/man2/sigaltstack.2:114
4181 msgid ""
4182 "To disable an existing stack, specify I<ss.ss_flags> as B<SS_DISABLE>.  In "
4183 "this case, the remaining fields in I<ss> are ignored."
4184 msgstr ""
4185
4186 #. type: Plain text
4187 #: build/C/man2/sigaltstack.2:122
4188 msgid ""
4189 "If I<oss> is not NULL, then it is used to return information about the "
4190 "alternate signal stack which was in effect prior to the call to "
4191 "B<sigaltstack>().  The I<oss.ss_sp> and I<oss.ss_size> fields return the "
4192 "starting address and size of that stack.  The I<oss.ss_flags> may return "
4193 "either of the following values:"
4194 msgstr ""
4195
4196 #. type: TP
4197 #: build/C/man2/sigaltstack.2:122
4198 #, no-wrap
4199 msgid "B<SS_ONSTACK>"
4200 msgstr ""
4201
4202 #. type: Plain text
4203 #: build/C/man2/sigaltstack.2:128
4204 msgid ""
4205 "The process is currently executing on the alternate signal stack.  (Note "
4206 "that it is not possible to change the alternate signal stack if the process "
4207 "is currently executing on it.)"
4208 msgstr ""
4209
4210 #. type: TP
4211 #: build/C/man2/sigaltstack.2:128
4212 #, no-wrap
4213 msgid "B<SS_DISABLE>"
4214 msgstr ""
4215
4216 #. type: Plain text
4217 #: build/C/man2/sigaltstack.2:131
4218 msgid "The alternate signal stack is currently disabled."
4219 msgstr ""
4220
4221 #. type: Plain text
4222 #: build/C/man2/sigaltstack.2:135
4223 msgid ""
4224 "B<sigaltstack>()  returns 0 on success, or -1 on failure with I<errno> set "
4225 "to indicate the error."
4226 msgstr ""
4227
4228 #. type: Plain text
4229 #: build/C/man2/sigaltstack.2:140
4230 msgid ""
4231 "Either I<ss> or I<oss> is not NULL and points to an area outside of the "
4232 "process's address space."
4233 msgstr ""
4234
4235 #. type: Plain text
4236 #: build/C/man2/sigaltstack.2:145
4237 msgid ""
4238 "I<ss> is not NULL and the I<ss_flags> field contains a nonzero value other "
4239 "than B<SS_DISABLE>."
4240 msgstr ""
4241
4242 #. type: Plain text
4243 #: build/C/man2/sigaltstack.2:149
4244 msgid ""
4245 "The specified size of the new alternate signal stack (I<ss.ss_size>) was "
4246 "less than B<MINSTKSZ>."
4247 msgstr ""
4248
4249 #. type: Plain text
4250 #: build/C/man2/sigaltstack.2:154
4251 msgid ""
4252 "An attempt was made to change the alternate signal stack while it was active "
4253 "(i.e., the process was already executing on the current alternate signal "
4254 "stack)."
4255 msgstr ""
4256
4257 #. type: Plain text
4258 #: build/C/man2/sigaltstack.2:156
4259 msgid "SUSv2, SVr4, POSIX.1-2001."
4260 msgstr ""
4261
4262 #. type: Plain text
4263 #: build/C/man2/sigaltstack.2:164
4264 msgid ""
4265 "The most common usage of an alternate signal stack is to handle the "
4266 "B<SIGSEGV> signal that is generated if the space available for the normal "
4267 "process stack is exhausted: in this case, a signal handler for B<SIGSEGV> "
4268 "cannot be invoked on the process stack; if we wish to handle it, we must use "
4269 "an alternate signal stack."
4270 msgstr ""
4271
4272 #. type: Plain text
4273 #: build/C/man2/sigaltstack.2:174
4274 msgid ""
4275 "Establishing an alternate signal stack is useful if a process expects that "
4276 "it may exhaust its standard stack.  This may occur, for example, because the "
4277 "stack grows so large that it encounters the upwardly growing heap, or it "
4278 "reaches a limit established by a call to B<setrlimit(RLIMIT_STACK, &rlim)>.  "
4279 "If the standard stack is exhausted, the kernel sends the process a "
4280 "B<SIGSEGV> signal.  In these circumstances the only way to catch this signal "
4281 "is on an alternate signal stack."
4282 msgstr ""
4283
4284 #. type: Plain text
4285 #: build/C/man2/sigaltstack.2:180
4286 msgid ""
4287 "On most hardware architectures supported by Linux, stacks grow downward.  "
4288 "B<sigaltstack>()  automatically takes account of the direction of stack "
4289 "growth."
4290 msgstr ""
4291
4292 #. type: Plain text
4293 #: build/C/man2/sigaltstack.2:189
4294 msgid ""
4295 "Functions called from a signal handler executing on an alternate signal "
4296 "stack will also use the alternate signal stack.  (This also applies to any "
4297 "handlers invoked for other signals while the process is executing on the "
4298 "alternate signal stack.)  Unlike the standard stack, the system does not "
4299 "automatically extend the alternate signal stack.  Exceeding the allocated "
4300 "size of the alternate signal stack will lead to unpredictable results."
4301 msgstr ""
4302
4303 #. type: Plain text
4304 #: build/C/man2/sigaltstack.2:197
4305 msgid ""
4306 "A successful call to B<execve>(2)  removes any existing alternate signal "
4307 "stack.  A child process created via B<fork>(2)  inherits a copy of its "
4308 "parent's alternate signal stack settings."
4309 msgstr ""
4310
4311 #. type: Plain text
4312 #: build/C/man2/sigaltstack.2:206
4313 msgid ""
4314 "B<sigaltstack>()  supersedes the older B<sigstack>()  call.  For backward "
4315 "compatibility, glibc also provides B<sigstack>().  All new applications "
4316 "should be written using B<sigaltstack>()."
4317 msgstr ""
4318
4319 #. type: SS
4320 #: build/C/man2/sigaltstack.2:206 build/C/man3/sigpause.3:59
4321 #, no-wrap
4322 msgid "History"
4323 msgstr ""
4324
4325 #. type: Plain text
4326 #: build/C/man2/sigaltstack.2:213
4327 msgid ""
4328 "4.2BSD had a B<sigstack>()  system call.  It used a slightly different "
4329 "struct, and had the major disadvantage that the caller had to know the "
4330 "direction of stack growth."
4331 msgstr ""
4332
4333 #. type: Plain text
4334 #: build/C/man2/sigaltstack.2:216
4335 msgid "The following code segment demonstrates the use of B<sigaltstack>():"
4336 msgstr ""
4337
4338 #. type: Plain text
4339 #: build/C/man2/sigaltstack.2:220
4340 #, no-wrap
4341 msgid "stack_t ss;\n"
4342 msgstr ""
4343
4344 #. type: Plain text
4345 #: build/C/man2/sigaltstack.2:228
4346 #, no-wrap
4347 msgid ""
4348 "ss.ss_sp = malloc(SIGSTKSZ);\n"
4349 "if (ss.ss_sp == NULL)\n"
4350 "    /* Handle error */;\n"
4351 "ss.ss_size = SIGSTKSZ;\n"
4352 "ss.ss_flags = 0;\n"
4353 "if (sigaltstack(&ss, NULL) == -1)\n"
4354 "    /* Handle error */;\n"
4355 msgstr ""
4356
4357 #. type: Plain text
4358 #: build/C/man2/sigaltstack.2:237
4359 msgid ""
4360 "B<execve>(2), B<setrlimit>(2), B<sigaction>(2), B<siglongjmp>(3), "
4361 "B<sigsetjmp>(3), B<signal>(7)"
4362 msgstr ""
4363
4364 #. type: TH
4365 #: build/C/man7/sigevent.7:24
4366 #, no-wrap
4367 msgid "SIGEVENT"
4368 msgstr ""
4369
4370 #. type: TH
4371 #: build/C/man7/sigevent.7:24 build/C/man3/siginterrupt.3:29
4372 #, no-wrap
4373 msgid "2011-09-09"
4374 msgstr ""
4375
4376 #. type: Plain text
4377 #: build/C/man7/sigevent.7:27
4378 msgid "sigevent - structure for notification from asynchronous routines"
4379 msgstr ""
4380
4381 #. type: Plain text
4382 #: build/C/man7/sigevent.7:34
4383 #, no-wrap
4384 msgid ""
4385 "union sigval {          /* Data passed with notification */\n"
4386 "    int     sival_int;         /* Integer value */\n"
4387 "    void   *sival_ptr;         /* Pointer value */\n"
4388 "};\n"
4389 msgstr ""
4390
4391 #. type: Plain text
4392 #: build/C/man7/sigevent.7:49
4393 #, no-wrap
4394 msgid ""
4395 "struct sigevent {\n"
4396 "    int          sigev_notify; /* Notification method */\n"
4397 "    int          sigev_signo;  /* Notification signal */\n"
4398 "    union sigval sigev_value;  /* Data passed with\n"
4399 "                                  notification */\n"
4400 "    void       (*sigev_notify_function) (union sigval);\n"
4401 "                     /* Function used for thread\n"
4402 "                        notification (SIGEV_THREAD) */\n"
4403 "    void        *sigev_notify_attributes;\n"
4404 "                     /* Attributes for notification thread\n"
4405 "                        (SIGEV_THREAD) */\n"
4406 "    pid_t        sigev_notify_thread_id;\n"
4407 "                     /* ID of thread to signal (SIGEV_THREAD_ID) */\n"
4408 "};\n"
4409 msgstr ""
4410
4411 #. type: Plain text
4412 #: build/C/man7/sigevent.7:58
4413 msgid ""
4414 "The I<sigevent> structure is used by various APIs to describe the way a "
4415 "process is to be notified about an event (e.g., completion of an "
4416 "asynchronous request, expiration of a timer, or the arrival of a message)."
4417 msgstr ""
4418
4419 #. type: Plain text
4420 #: build/C/man7/sigevent.7:66
4421 msgid ""
4422 "The definition shown in the SYNOPSIS is approximate: some of the fields in "
4423 "the I<sigevent> structure may be defined as part of a union.  Programs "
4424 "should only employ those fields relevant to the value specified in "
4425 "I<sigev_notify>."
4426 msgstr ""
4427
4428 #. type: Plain text
4429 #: build/C/man7/sigevent.7:71
4430 msgid ""
4431 "The I<sigev_notify> field specifies how notification is to be performed.  "
4432 "This field can have one of the following values:"
4433 msgstr ""
4434
4435 #. type: TP
4436 #: build/C/man7/sigevent.7:71 build/C/man2/timer_create.2:105
4437 #, no-wrap
4438 msgid "B<SIGEV_NONE>"
4439 msgstr ""
4440
4441 #. type: Plain text
4442 #: build/C/man7/sigevent.7:74
4443 msgid "A \"null\" notification: don't do anything when the event occurs."
4444 msgstr ""
4445
4446 #. type: TP
4447 #: build/C/man7/sigevent.7:74 build/C/man2/timer_create.2:110
4448 #, no-wrap
4449 msgid "B<SIGEV_SIGNAL>"
4450 msgstr ""
4451
4452 #. type: Plain text
4453 #: build/C/man7/sigevent.7:78
4454 msgid "Notify the process by sending the signal specified in I<sigev_signo>."
4455 msgstr ""
4456
4457 #. type: Plain text
4458 #: build/C/man7/sigevent.7:85
4459 msgid ""
4460 "If the signal is caught with a signal handler that was registered using the "
4461 "B<sigaction>(2)  B<SA_SIGINFO> flag, then the following fields are set in "
4462 "the I<siginfo_t> structure that is passed as the second argument of the "
4463 "handler:"
4464 msgstr ""
4465
4466 #. type: Plain text
4467 #: build/C/man7/sigevent.7:90
4468 msgid ""
4469 "This field is set to a value that depends on the API delivering the "
4470 "notification."
4471 msgstr ""
4472
4473 #. type: TP
4474 #: build/C/man7/sigevent.7:90 build/C/man2/wait.2:301
4475 #, no-wrap
4476 msgid "I<si_signo>"
4477 msgstr ""
4478
4479 #. type: Plain text
4480 #: build/C/man7/sigevent.7:94
4481 msgid ""
4482 "This field is set to the signal number (i.e., the same value as in "
4483 "I<sigev_signo>)."
4484 msgstr ""
4485
4486 #. type: Plain text
4487 #: build/C/man7/sigevent.7:98
4488 msgid "This field is set to the value specified in I<sigev_value>."
4489 msgstr ""
4490
4491 #. type: Plain text
4492 #: build/C/man7/sigevent.7:103
4493 msgid ""
4494 "Depending on the API, other fields may also be set in the I<siginfo_t> "
4495 "structure."
4496 msgstr ""
4497
4498 #. type: Plain text
4499 #: build/C/man7/sigevent.7:106
4500 msgid ""
4501 "The same information is also available if the signal is accepted using "
4502 "B<sigwaitinfo>(2)."
4503 msgstr ""
4504
4505 #. type: TP
4506 #: build/C/man7/sigevent.7:106 build/C/man2/timer_create.2:128
4507 #, no-wrap
4508 msgid "B<SIGEV_THREAD>"
4509 msgstr ""
4510
4511 #. type: Plain text
4512 #: build/C/man7/sigevent.7:123
4513 msgid ""
4514 "Notify the process by invoking I<sigev_notify_function> \"as if\" it were "
4515 "the start function of a new thread.  (Among the implementation possibilities "
4516 "here are that each timer notification could result in the creation of a new "
4517 "thread, or that a single thread is created to receive all notifications.)  "
4518 "The function is invoked with I<sigev_value> as its sole argument.  If "
4519 "I<sigev_notify_attributes> is not NULL, it should point to a "
4520 "I<pthread_attr_t> structure that defines attributes for the new thread (see "
4521 "B<pthread_attr_init>(3))."
4522 msgstr ""
4523
4524 #. type: TP
4525 #: build/C/man7/sigevent.7:123 build/C/man2/timer_create.2:136
4526 #, no-wrap
4527 msgid "B<SIGEV_THREAD_ID> (Linux-specific)"
4528 msgstr ""
4529
4530 #.  | SIGEV_SIGNAL vs not?
4531 #. type: Plain text
4532 #: build/C/man7/sigevent.7:128
4533 msgid "Currently used only by POSIX timers; see B<timer_create>(2)."
4534 msgstr ""
4535
4536 #. type: Plain text
4537 #: build/C/man7/sigevent.7:130 build/C/man2/sigpending.2:61 build/C/man2/sigprocmask.2:109 build/C/man3/sigqueue.3:114 build/C/man3/sigsetops.3:128 build/C/man2/sigsuspend.2:82 build/C/man3/sigwait.3:79 build/C/man2/sigwaitinfo.2:131 build/C/man2/timer_create.2:193 build/C/man2/timer_delete.2:66 build/C/man2/timer_getoverrun.2:96 build/C/man2/timer_settime.2:205
4538 msgid "POSIX.1-2001."
4539 msgstr ""
4540
4541 #. type: Plain text
4542 #: build/C/man7/sigevent.7:140
4543 msgid ""
4544 "B<timer_create>(2), B<aio_fsync>(3), B<aio_read>(3), B<aio_write>(3), "
4545 "B<getaddrinfo_a>(3), B<lio_listio>(3), B<mq_notify>(3), B<aio>(7), "
4546 "B<pthreads>(7)"
4547 msgstr ""
4548
4549 #. type: TH
4550 #: build/C/man3/siginterrupt.3:29
4551 #, no-wrap
4552 msgid "SIGINTERRUPT"
4553 msgstr ""
4554
4555 #. type: Plain text
4556 #: build/C/man3/siginterrupt.3:32
4557 msgid "siginterrupt - allow signals to interrupt system calls"
4558 msgstr ""
4559
4560 #. type: Plain text
4561 #: build/C/man3/siginterrupt.3:37
4562 #, no-wrap
4563 msgid "B<int siginterrupt(int >I<sig>B<, int >I<flag>B<);>\n"
4564 msgstr ""
4565
4566 #. type: Plain text
4567 #: build/C/man3/siginterrupt.3:45
4568 msgid "B<siginterrupt>():"
4569 msgstr ""
4570
4571 #. type: Plain text
4572 #: build/C/man3/siginterrupt.3:62
4573 msgid ""
4574 "The B<siginterrupt>()  function changes the restart behavior when a system "
4575 "call is interrupted by the signal I<sig>.  If the I<flag> argument is false "
4576 "(0), then system calls will be restarted if interrupted by the specified "
4577 "signal I<sig>.  This is the default behavior in Linux."
4578 msgstr ""
4579
4580 #. type: Plain text
4581 #: build/C/man3/siginterrupt.3:67
4582 msgid ""
4583 "If the I<flag> argument is true (1) and no data has been transferred, then a "
4584 "system call interrupted by the signal I<sig> will return -1 and I<errno> "
4585 "will be set to B<EINTR>."
4586 msgstr ""
4587
4588 #. type: Plain text
4589 #: build/C/man3/siginterrupt.3:71
4590 msgid ""
4591 "If the I<flag> argument is true (1) and data transfer has started, then the "
4592 "system call will be interrupted and will return the actual amount of data "
4593 "transferred."
4594 msgstr ""
4595
4596 #. type: Plain text
4597 #: build/C/man3/siginterrupt.3:76
4598 msgid ""
4599 "The B<siginterrupt>()  function returns 0 on success, or -1 if the signal "
4600 "number I<sig> is invalid."
4601 msgstr ""
4602
4603 #. type: Plain text
4604 #: build/C/man3/siginterrupt.3:80
4605 msgid "The specified signal number is invalid."
4606 msgstr ""
4607
4608 #. type: Plain text
4609 #: build/C/man3/siginterrupt.3:89
4610 msgid ""
4611 "4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<siginterrupt>()  as obsolete, "
4612 "recommending the use of B<sigaction>(2)  with the B<SA_RESTART> flag "
4613 "instead."
4614 msgstr ""
4615
4616 #. type: Plain text
4617 #: build/C/man3/siginterrupt.3:91
4618 msgid "B<signal>(2)"
4619 msgstr ""
4620
4621 #. type: TH
4622 #: build/C/man2/signal.2:34 build/C/man7/signal.7:44
4623 #, no-wrap
4624 msgid "SIGNAL"
4625 msgstr ""
4626
4627 #. type: TH
4628 #: build/C/man2/signal.2:34
4629 #, no-wrap
4630 msgid "2012-05-05"
4631 msgstr ""
4632
4633 #. type: Plain text
4634 #: build/C/man2/signal.2:37
4635 msgid "signal - ANSI C signal handling"
4636 msgstr ""
4637
4638 #. type: Plain text
4639 #: build/C/man2/signal.2:43
4640 msgid "B<sighandler_t signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
4641 msgstr ""
4642
4643 #. type: Plain text
4644 #: build/C/man2/signal.2:52
4645 msgid ""
4646 "The behavior of B<signal>()  varies across UNIX versions, and has also "
4647 "varied historically across different versions of Linux.  B<Avoid its use>: "
4648 "use B<sigaction>(2)  instead.  See I<Portability> below."
4649 msgstr ""
4650
4651 #. type: Plain text
4652 #: build/C/man2/signal.2:62
4653 msgid ""
4654 "B<signal>()  sets the disposition of the signal I<signum> to I<handler>, "
4655 "which is either B<SIG_IGN>, B<SIG_DFL>, or the address of a "
4656 "programmer-defined function (a \"signal handler\")."
4657 msgstr ""
4658
4659 #. type: Plain text
4660 #: build/C/man2/signal.2:66
4661 msgid ""
4662 "If the signal I<signum> is delivered to the process, then one of the "
4663 "following happens:"
4664 msgstr ""
4665
4666 #. type: Plain text
4667 #: build/C/man2/signal.2:71
4668 msgid "If the disposition is set to B<SIG_IGN>, then the signal is ignored."
4669 msgstr ""
4670
4671 #. type: Plain text
4672 #: build/C/man2/signal.2:78
4673 msgid ""
4674 "If the disposition is set to B<SIG_DFL>, then the default action associated "
4675 "with the signal (see B<signal>(7))  occurs."
4676 msgstr ""
4677
4678 #. type: Plain text
4679 #: build/C/man2/signal.2:89
4680 msgid ""
4681 "If the disposition is set to a function, then first either the disposition "
4682 "is reset to B<SIG_DFL>, or the signal is blocked (see I<Portability> below), "
4683 "and then I<handler> is called with argument I<signum>.  If invocation of the "
4684 "handler caused the signal to be blocked, then the signal is unblocked upon "
4685 "return from the handler."
4686 msgstr ""
4687
4688 #. type: Plain text
4689 #: build/C/man2/signal.2:95
4690 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught or ignored."
4691 msgstr ""
4692
4693 #. type: Plain text
4694 #: build/C/man2/signal.2:100
4695 msgid ""
4696 "B<signal>()  returns the previous value of the signal handler, or B<SIG_ERR> "
4697 "on error."
4698 msgstr ""
4699
4700 #. type: Plain text
4701 #: build/C/man2/signal.2:105
4702 msgid "I<signum> is invalid."
4703 msgstr ""
4704
4705 #. type: Plain text
4706 #: build/C/man2/signal.2:111
4707 msgid "The effects of B<signal>()  in a multithreaded process are unspecified."
4708 msgstr ""
4709
4710 #. type: Plain text
4711 #: build/C/man2/signal.2:136
4712 msgid ""
4713 "See B<sigaction>(2)  for details on what happens when B<SIGCHLD> is set to "
4714 "B<SIG_IGN>."
4715 msgstr ""
4716
4717 #. type: Plain text
4718 #: build/C/man2/signal.2:141
4719 msgid ""
4720 "See B<signal>(7)  for a list of the async-signal-safe functions that can be "
4721 "safely called from inside a signal handler."
4722 msgstr ""
4723
4724 #.  libc4 and libc5 define
4725 #.  .IR SignalHandler ;
4726 #. type: Plain text
4727 #: build/C/man2/signal.2:157
4728 msgid ""
4729 "The use of I<sighandler_t> is a GNU extension, exposed if B<_GNU_SOURCE> is "
4730 "defined; glibc also defines (the BSD-derived)  I<sig_t> if B<_BSD_SOURCE> is "
4731 "defined.  Without use of such a type, the declaration of B<signal>()  is the "
4732 "somewhat harder to read:"
4733 msgstr ""
4734
4735 #. type: Plain text
4736 #: build/C/man2/signal.2:161
4737 #, no-wrap
4738 msgid ""
4739 "B<void ( *>I<signal>B<(int >I<signum>B<, void (*>I<handler>B<)(int)) ) "
4740 "(int);>\n"
4741 msgstr ""
4742
4743 #. type: SS
4744 #: build/C/man2/signal.2:163
4745 #, no-wrap
4746 msgid "Portability"
4747 msgstr ""
4748
4749 #. type: Plain text
4750 #: build/C/man2/signal.2:175
4751 msgid ""
4752 "The only portable use of B<signal>()  is to set a signal's disposition to "
4753 "B<SIG_DFL> or B<SIG_IGN>.  The semantics when using B<signal>()  to "
4754 "establish a signal handler vary across systems (and POSIX.1 explicitly "
4755 "permits this variation); B<do not use it for this purpose.>"
4756 msgstr ""
4757
4758 #. type: Plain text
4759 #: build/C/man2/signal.2:181
4760 msgid ""
4761 "POSIX.1 solved the portability mess by specifying B<sigaction>(2), which "
4762 "provides explicit control of the semantics when a signal handler is invoked; "
4763 "use that interface instead of B<signal>()."
4764 msgstr ""
4765
4766 #. type: Plain text
4767 #: build/C/man2/signal.2:194
4768 msgid ""
4769 "In the original UNIX systems, when a handler that was established using "
4770 "B<signal>()  was invoked by the delivery of a signal, the disposition of the "
4771 "signal would be reset to B<SIG_DFL>, and the system did not block delivery "
4772 "of further instances of the signal.  System V also provides these semantics "
4773 "for B<signal>().  This was bad because the signal might be delivered again "
4774 "before the handler had a chance to reestablish itself.  Furthermore, rapid "
4775 "deliveries of the same signal could result in recursive invocations of the "
4776 "handler."
4777 msgstr ""
4778
4779 #. type: Plain text
4780 #: build/C/man2/signal.2:204
4781 msgid ""
4782 "BSD improved on this situation by changing the semantics of signal handling "
4783 "(but, unfortunately, silently changed the semantics when establishing a "
4784 "handler with B<signal>()).  On BSD, when a signal handler is invoked, the "
4785 "signal disposition is not reset, and further instances of the signal are "
4786 "blocked from being delivered while the handler is executing."
4787 msgstr ""
4788
4789 #. type: Plain text
4790 #: build/C/man2/signal.2:206
4791 msgid "The situation on Linux is as follows:"
4792 msgstr ""
4793
4794 #. type: Plain text
4795 #: build/C/man2/signal.2:210
4796 msgid "The kernel's B<signal>()  system call provides System V semantics."
4797 msgstr ""
4798
4799 #. type: Plain text
4800 #: build/C/man2/signal.2:226
4801 msgid ""
4802 "By default, in glibc 2 and later, the B<signal>()  wrapper function does not "
4803 "invoke the kernel system call.  Instead, it calls B<sigaction>(2)  using "
4804 "flags that supply BSD semantics.  This default behavior is provided as long "
4805 "as the B<_BSD_SOURCE> feature test macro is defined.  By default, "
4806 "B<_BSD_SOURCE> is defined; it is also implicitly defined if one defines "
4807 "B<_GNU_SOURCE>, and can of course be explicitly defined."
4808 msgstr ""
4809
4810 #
4811 #.  System V semantics are also provided if one uses the separate
4812 #.  .BR sysv_signal (3)
4813 #.  function.
4814 #. type: Plain text
4815 #: build/C/man2/signal.2:249
4816 msgid ""
4817 "On glibc 2 and later, if the B<_BSD_SOURCE> feature test macro is not "
4818 "defined, then B<signal>()  provides System V semantics.  (The default "
4819 "implicit definition of B<_BSD_SOURCE> is not provided if one invokes "
4820 "B<gcc>(1)  in one of its standard modes (I<-std=xxx> or I<-ansi>)  or "
4821 "defines various other feature test macros such as B<_POSIX_SOURCE>, "
4822 "B<_XOPEN_SOURCE>, or B<_SVID_SOURCE>; see B<feature_test_macros>(7).)"
4823 msgstr ""
4824
4825 #. type: Plain text
4826 #: build/C/man2/signal.2:260
4827 msgid ""
4828 "The B<signal>()  function in Linux libc4 and libc5 provide System V "
4829 "semantics.  If one on a libc5 system includes I<E<lt>bsd/signal.hE<gt>> "
4830 "instead of I<E<lt>signal.hE<gt>>, then B<signal>()  provides BSD semantics."
4831 msgstr ""
4832
4833 #. type: Plain text
4834 #: build/C/man2/signal.2:279
4835 msgid ""
4836 "B<kill>(1), B<alarm>(2), B<kill>(2), B<killpg>(2), B<pause>(2), "
4837 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
4838 "B<sigsuspend>(2), B<bsd_signal>(3), B<raise>(3), B<siginterrupt>(3), "
4839 "B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), B<sysv_signal>(3), "
4840 "B<signal>(7)"
4841 msgstr ""
4842
4843 #. type: TH
4844 #: build/C/man7/signal.7:44
4845 #, no-wrap
4846 msgid "2012-05-01"
4847 msgstr ""
4848
4849 #. type: Plain text
4850 #: build/C/man7/signal.7:47
4851 msgid "signal - overview of signals"
4852 msgstr ""
4853
4854 #. type: Plain text
4855 #: build/C/man7/signal.7:50
4856 msgid ""
4857 "Linux supports both POSIX reliable signals (hereinafter \"standard "
4858 "signals\") and POSIX real-time signals."
4859 msgstr ""
4860
4861 #. type: SS
4862 #: build/C/man7/signal.7:50
4863 #, no-wrap
4864 msgid "Signal Dispositions"
4865 msgstr ""
4866
4867 #. type: Plain text
4868 #: build/C/man7/signal.7:55
4869 msgid ""
4870 "Each signal has a current I<disposition>, which determines how the process "
4871 "behaves when it is delivered the signal."
4872 msgstr ""
4873
4874 #. type: Plain text
4875 #: build/C/man7/signal.7:58
4876 msgid ""
4877 "The entries in the \"Action\" column of the tables below specify the default "
4878 "disposition for each signal, as follows:"
4879 msgstr ""
4880
4881 #. type: IP
4882 #: build/C/man7/signal.7:58
4883 #, no-wrap
4884 msgid "Term"
4885 msgstr ""
4886
4887 #. type: Plain text
4888 #: build/C/man7/signal.7:60
4889 msgid "Default action is to terminate the process."
4890 msgstr ""
4891
4892 #. type: IP
4893 #: build/C/man7/signal.7:60
4894 #, no-wrap
4895 msgid "Ign"
4896 msgstr ""
4897
4898 #. type: Plain text
4899 #: build/C/man7/signal.7:62
4900 msgid "Default action is to ignore the signal."
4901 msgstr ""
4902
4903 #. type: IP
4904 #: build/C/man7/signal.7:62
4905 #, no-wrap
4906 msgid "Core"
4907 msgstr ""
4908
4909 #. type: Plain text
4910 #: build/C/man7/signal.7:65
4911 msgid "Default action is to terminate the process and dump core (see B<core>(5))."
4912 msgstr ""
4913
4914 #. type: IP
4915 #: build/C/man7/signal.7:65
4916 #, no-wrap
4917 msgid "Stop"
4918 msgstr ""
4919
4920 #. type: Plain text
4921 #: build/C/man7/signal.7:67
4922 msgid "Default action is to stop the process."
4923 msgstr ""
4924
4925 #. type: IP
4926 #: build/C/man7/signal.7:67
4927 #, no-wrap
4928 msgid "Cont"
4929 msgstr ""
4930
4931 #. type: Plain text
4932 #: build/C/man7/signal.7:69
4933 msgid "Default action is to continue the process if it is currently stopped."
4934 msgstr ""
4935
4936 #. type: Plain text
4937 #: build/C/man7/signal.7:91
4938 msgid ""
4939 "A process can change the disposition of a signal using B<sigaction>(2)  or "
4940 "B<signal>(2).  (The latter is less portable when establishing a signal "
4941 "handler; see B<signal>(2)  for details.)  Using these system calls, a "
4942 "process can elect one of the following behaviors to occur on delivery of the "
4943 "signal: perform the default action; ignore the signal; or catch the signal "
4944 "with a I<signal handler>, a programmer-defined function that is "
4945 "automatically invoked when the signal is delivered.  (By default, the signal "
4946 "handler is invoked on the normal process stack.  It is possible to arrange "
4947 "that the signal handler uses an alternate stack; see B<sigaltstack>(2)  for "
4948 "a discussion of how to do this and when it might be useful.)"
4949 msgstr ""
4950
4951 #. type: Plain text
4952 #: build/C/man7/signal.7:95
4953 msgid ""
4954 "The signal disposition is a per-process attribute: in a multithreaded "
4955 "application, the disposition of a particular signal is the same for all "
4956 "threads."
4957 msgstr ""
4958
4959 #. type: SS
4960 #: build/C/man7/signal.7:103
4961 #, no-wrap
4962 msgid "Sending a Signal"
4963 msgstr ""
4964
4965 #. type: Plain text
4966 #: build/C/man7/signal.7:106
4967 msgid ""
4968 "The following system calls and library functions allow the caller to send a "
4969 "signal:"
4970 msgstr ""
4971
4972 #. type: TP
4973 #: build/C/man7/signal.7:106
4974 #, no-wrap
4975 msgid "B<raise>(3)"
4976 msgstr ""
4977
4978 #. type: Plain text
4979 #: build/C/man7/signal.7:109
4980 msgid "Sends a signal to the calling thread."
4981 msgstr ""
4982
4983 #. type: Plain text
4984 #: build/C/man7/signal.7:114
4985 msgid ""
4986 "Sends a signal to a specified process, to all members of a specified process "
4987 "group, or to all processes on the system."
4988 msgstr ""
4989
4990 #. type: TP
4991 #: build/C/man7/signal.7:114
4992 #, no-wrap
4993 msgid "B<killpg>(2)"
4994 msgstr ""
4995
4996 #. type: Plain text
4997 #: build/C/man7/signal.7:117
4998 msgid "Sends a signal to all of the members of a specified process group."
4999 msgstr ""
5000
5001 #. type: TP
5002 #: build/C/man7/signal.7:117
5003 #, no-wrap
5004 msgid "B<pthread_kill>(3)"
5005 msgstr ""
5006
5007 #. type: Plain text
5008 #: build/C/man7/signal.7:121
5009 msgid ""
5010 "Sends a signal to a specified POSIX thread in the same process as the "
5011 "caller."
5012 msgstr ""
5013
5014 #. type: TP
5015 #: build/C/man7/signal.7:121
5016 #, no-wrap
5017 msgid "B<tgkill>(2)"
5018 msgstr ""
5019
5020 #. type: Plain text
5021 #: build/C/man7/signal.7:126
5022 msgid ""
5023 "Sends a signal to a specified thread within a specific process.  (This is "
5024 "the system call used to implement B<pthread_kill>(3).)"
5025 msgstr ""
5026
5027 #. type: Plain text
5028 #: build/C/man7/signal.7:129
5029 msgid "Sends a real-time signal with accompanying data to a specified process."
5030 msgstr ""
5031
5032 #. type: SS
5033 #: build/C/man7/signal.7:129
5034 #, no-wrap
5035 msgid "Waiting for a Signal to be Caught"
5036 msgstr ""
5037
5038 #. type: Plain text
5039 #: build/C/man7/signal.7:133
5040 msgid ""
5041 "The following system calls suspend execution of the calling process or "
5042 "thread until a signal is caught (or an unhandled signal terminates the "
5043 "process):"
5044 msgstr ""
5045
5046 #. type: TP
5047 #: build/C/man7/signal.7:133
5048 #, no-wrap
5049 msgid "B<pause>(2)"
5050 msgstr ""
5051
5052 #. type: Plain text
5053 #: build/C/man7/signal.7:136
5054 msgid "Suspends execution until any signal is caught."
5055 msgstr ""
5056
5057 #. type: TP
5058 #: build/C/man7/signal.7:136
5059 #, no-wrap
5060 msgid "B<sigsuspend>(2)"
5061 msgstr ""
5062
5063 #. type: Plain text
5064 #: build/C/man7/signal.7:140
5065 msgid ""
5066 "Temporarily changes the signal mask (see below) and suspends execution until "
5067 "one of the unmasked signals is caught."
5068 msgstr ""
5069
5070 #. type: SS
5071 #: build/C/man7/signal.7:140
5072 #, no-wrap
5073 msgid "Synchronously Accepting a Signal"
5074 msgstr ""
5075
5076 #. type: Plain text
5077 #: build/C/man7/signal.7:147
5078 msgid ""
5079 "Rather than asynchronously catching a signal via a signal handler, it is "
5080 "possible to synchronously accept the signal, that is, to block execution "
5081 "until the signal is delivered, at which point the kernel returns information "
5082 "about the signal to the caller.  There are two general ways to do this:"
5083 msgstr ""
5084
5085 #. type: Plain text
5086 #: build/C/man7/signal.7:155
5087 msgid ""
5088 "B<sigwaitinfo>(2), B<sigtimedwait>(2), and B<sigwait>(3)  suspend execution "
5089 "until one of the signals in a specified set is delivered.  Each of these "
5090 "calls returns information about the delivered signal."
5091 msgstr ""
5092
5093 #. type: Plain text
5094 #: build/C/man7/signal.7:168
5095 msgid ""
5096 "B<signalfd>(2)  returns a file descriptor that can be used to read "
5097 "information about signals that are delivered to the caller.  Each B<read>(2)  "
5098 "from this file descriptor blocks until one of the signals in the set "
5099 "specified in the B<signalfd>(2)  call is delivered to the caller.  The "
5100 "buffer returned by B<read>(2)  contains a structure describing the signal."
5101 msgstr ""
5102
5103 #. type: SS
5104 #: build/C/man7/signal.7:168
5105 #, no-wrap
5106 msgid "Signal Mask and Pending Signals"
5107 msgstr ""
5108
5109 #. type: Plain text
5110 #: build/C/man7/signal.7:175
5111 msgid ""
5112 "A signal may be I<blocked>, which means that it will not be delivered until "
5113 "it is later unblocked.  Between the time when it is generated and when it is "
5114 "delivered a signal is said to be I<pending>."
5115 msgstr ""
5116
5117 #. type: Plain text
5118 #: build/C/man7/signal.7:184
5119 msgid ""
5120 "Each thread in a process has an independent I<signal mask>, which indicates "
5121 "the set of signals that the thread is currently blocking.  A thread can "
5122 "manipulate its signal mask using B<pthread_sigmask>(3).  In a traditional "
5123 "single-threaded application, B<sigprocmask>(2)  can be used to manipulate "
5124 "the signal mask."
5125 msgstr ""
5126
5127 #. type: Plain text
5128 #: build/C/man7/signal.7:190 build/C/man2/sigprocmask.2:121
5129 msgid ""
5130 "A child created via B<fork>(2)  inherits a copy of its parent's signal mask; "
5131 "the signal mask is preserved across B<execve>(2)."
5132 msgstr ""
5133
5134 #. type: Plain text
5135 #: build/C/man7/signal.7:207
5136 msgid ""
5137 "A signal may be generated (and thus pending)  for a process as a whole "
5138 "(e.g., when sent using B<kill>(2))  or for a specific thread (e.g., certain "
5139 "signals, such as B<SIGSEGV> and B<SIGFPE>, generated as a consequence of "
5140 "executing a specific machine-language instruction are thread directed, as "
5141 "are signals targeted at a specific thread using B<pthread_kill>(3)).  A "
5142 "process-directed signal may be delivered to any one of the threads that does "
5143 "not currently have the signal blocked.  If more than one of the threads has "
5144 "the signal unblocked, then the kernel chooses an arbitrary thread to which "
5145 "to deliver the signal."
5146 msgstr ""
5147
5148 #. type: Plain text
5149 #: build/C/man7/signal.7:214
5150 msgid ""
5151 "A thread can obtain the set of signals that it currently has pending using "
5152 "B<sigpending>(2).  This set will consist of the union of the set of pending "
5153 "process-directed signals and the set of signals pending for the calling "
5154 "thread."
5155 msgstr ""
5156
5157 #. type: Plain text
5158 #: build/C/man7/signal.7:220 build/C/man2/sigpending.2:76
5159 msgid ""
5160 "A child created via B<fork>(2)  initially has an empty pending signal set; "
5161 "the pending signal set is preserved across an B<execve>(2)."
5162 msgstr ""
5163
5164 #. type: SS
5165 #: build/C/man7/signal.7:220
5166 #, no-wrap
5167 msgid "Standard Signals"
5168 msgstr ""
5169
5170 #. type: Plain text
5171 #: build/C/man7/signal.7:232
5172 msgid ""
5173 "Linux supports the standard signals listed below.  Several signal numbers "
5174 "are architecture-dependent, as indicated in the \"Value\" column.  (Where "
5175 "three values are given, the first one is usually valid for alpha and sparc, "
5176 "the middle one for x86, arm, and most other architectures, and the last one "
5177 "for mips.  (Values for parisc are I<not> shown; see the kernel source for "
5178 "signal numbering on that architecture.)  A - denotes that a signal is absent "
5179 "on the corresponding architecture.)"
5180 msgstr ""
5181
5182 #. type: Plain text
5183 #: build/C/man7/signal.7:234
5184 msgid "First the signals described in the original POSIX.1-1990 standard."
5185 msgstr ""
5186
5187 #. type: tbl table
5188 #: build/C/man7/signal.7:238 build/C/man7/signal.7:274 build/C/man7/signal.7:303
5189 #, no-wrap
5190 msgid "Signal\tValue\tAction\tComment\n"
5191 msgstr ""
5192
5193 #. type: tbl table
5194 #: build/C/man7/signal.7:239
5195 #, no-wrap
5196 msgid "SIGHUP\t\\01\tTerm\tHangup detected on controlling terminal\n"
5197 msgstr ""
5198
5199 #. type: tbl table
5200 #: build/C/man7/signal.7:240
5201 #, no-wrap
5202 msgid "\t\t\tor death of controlling process\n"
5203 msgstr ""
5204
5205 #. type: tbl table
5206 #: build/C/man7/signal.7:241
5207 #, no-wrap
5208 msgid "SIGINT\t\\02\tTerm\tInterrupt from keyboard\n"
5209 msgstr ""
5210
5211 #. type: tbl table
5212 #: build/C/man7/signal.7:242
5213 #, no-wrap
5214 msgid "SIGQUIT\t\\03\tCore\tQuit from keyboard\n"
5215 msgstr ""
5216
5217 #. type: tbl table
5218 #: build/C/man7/signal.7:243
5219 #, no-wrap
5220 msgid "SIGILL\t\\04\tCore\tIllegal Instruction\n"
5221 msgstr ""
5222
5223 #. type: tbl table
5224 #: build/C/man7/signal.7:244
5225 #, no-wrap
5226 msgid "SIGABRT\t\\06\tCore\tAbort signal from B<abort>(3)\n"
5227 msgstr ""
5228
5229 #. type: tbl table
5230 #: build/C/man7/signal.7:245
5231 #, no-wrap
5232 msgid "SIGFPE\t\\08\tCore\tFloating point exception\n"
5233 msgstr ""
5234
5235 #. type: tbl table
5236 #: build/C/man7/signal.7:246
5237 #, no-wrap
5238 msgid "SIGKILL\t\\09\tTerm\tKill signal\n"
5239 msgstr ""
5240
5241 #. type: tbl table
5242 #: build/C/man7/signal.7:247
5243 #, no-wrap
5244 msgid "SIGSEGV\t11\tCore\tInvalid memory reference\n"
5245 msgstr ""
5246
5247 #. type: tbl table
5248 #: build/C/man7/signal.7:248
5249 #, no-wrap
5250 msgid "SIGPIPE\t13\tTerm\tBroken pipe: write to pipe with no\n"
5251 msgstr ""
5252
5253 #. type: tbl table
5254 #: build/C/man7/signal.7:249
5255 #, no-wrap
5256 msgid "\t\t\treaders\n"
5257 msgstr ""
5258
5259 #. type: tbl table
5260 #: build/C/man7/signal.7:250
5261 #, no-wrap
5262 msgid "SIGALRM\t14\tTerm\tTimer signal from B<alarm>(2)\n"
5263 msgstr ""
5264
5265 #. type: tbl table
5266 #: build/C/man7/signal.7:251
5267 #, no-wrap
5268 msgid "SIGTERM\t15\tTerm\tTermination signal\n"
5269 msgstr ""
5270
5271 #. type: tbl table
5272 #: build/C/man7/signal.7:252
5273 #, no-wrap
5274 msgid "SIGUSR1\t30,10,16\tTerm\tUser-defined signal 1\n"
5275 msgstr ""
5276
5277 #. type: tbl table
5278 #: build/C/man7/signal.7:253
5279 #, no-wrap
5280 msgid "SIGUSR2\t31,12,17\tTerm\tUser-defined signal 2\n"
5281 msgstr ""
5282
5283 #. type: tbl table
5284 #: build/C/man7/signal.7:254
5285 #, no-wrap
5286 msgid "SIGCHLD\t20,17,18\tIgn\tChild stopped or terminated\n"
5287 msgstr ""
5288
5289 #. type: tbl table
5290 #: build/C/man7/signal.7:255
5291 #, no-wrap
5292 msgid "SIGCONT\t19,18,25\tCont\tContinue if stopped\n"
5293 msgstr ""
5294
5295 #. type: tbl table
5296 #: build/C/man7/signal.7:256
5297 #, no-wrap
5298 msgid "SIGSTOP\t17,19,23\tStop\tStop process\n"
5299 msgstr ""
5300
5301 #. type: tbl table
5302 #: build/C/man7/signal.7:257
5303 #, no-wrap
5304 msgid "SIGTSTP\t18,20,24\tStop\tStop typed at tty\n"
5305 msgstr ""
5306
5307 #. type: tbl table
5308 #: build/C/man7/signal.7:258
5309 #, no-wrap
5310 msgid "SIGTTIN\t21,21,26\tStop\ttty input for background process\n"
5311 msgstr ""
5312
5313 #. type: tbl table
5314 #: build/C/man7/signal.7:259
5315 #, no-wrap
5316 msgid "SIGTTOU\t22,22,27\tStop\ttty output for background process\n"
5317 msgstr ""
5318
5319 #. type: Plain text
5320 #: build/C/man7/signal.7:267
5321 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught, blocked, or ignored."
5322 msgstr ""
5323
5324 #. type: Plain text
5325 #: build/C/man7/signal.7:270
5326 msgid ""
5327 "Next the signals not in the POSIX.1-1990 standard but described in SUSv2 and "
5328 "POSIX.1-2001."
5329 msgstr ""
5330
5331 #. type: tbl table
5332 #: build/C/man7/signal.7:275
5333 #, no-wrap
5334 msgid "SIGBUS\t10,7,10\tCore\tBus error (bad memory access)\n"
5335 msgstr ""
5336
5337 #. type: tbl table
5338 #: build/C/man7/signal.7:276
5339 #, no-wrap
5340 msgid "SIGPOLL\t\tTerm\tPollable event (Sys V).\n"
5341 msgstr ""
5342
5343 #. type: tbl table
5344 #: build/C/man7/signal.7:277
5345 #, no-wrap
5346 msgid "\t\t\tSynonym for B<SIGIO>\n"
5347 msgstr ""
5348
5349 #. type: tbl table
5350 #: build/C/man7/signal.7:278
5351 #, no-wrap
5352 msgid "SIGPROF\t27,27,29\tTerm\tProfiling timer expired\n"
5353 msgstr ""
5354
5355 #. type: tbl table
5356 #: build/C/man7/signal.7:279
5357 #, no-wrap
5358 msgid "SIGSYS\t12,31,12\tCore\tBad argument to routine (SVr4)\n"
5359 msgstr ""
5360
5361 #. type: tbl table
5362 #: build/C/man7/signal.7:280
5363 #, no-wrap
5364 msgid "SIGTRAP\t5\tCore\tTrace/breakpoint trap\n"
5365 msgstr ""
5366
5367 #. type: tbl table
5368 #: build/C/man7/signal.7:281
5369 #, no-wrap
5370 msgid "SIGURG\t16,23,21\tIgn\tUrgent condition on socket (4.2BSD)\n"
5371 msgstr ""
5372
5373 #. type: tbl table
5374 #: build/C/man7/signal.7:282
5375 #, no-wrap
5376 msgid "SIGVTALRM\t26,26,28\tTerm\tVirtual alarm clock (4.2BSD)\n"
5377 msgstr ""
5378
5379 #. type: tbl table
5380 #: build/C/man7/signal.7:283
5381 #, no-wrap
5382 msgid "SIGXCPU\t24,24,30\tCore\tCPU time limit exceeded (4.2BSD)\n"
5383 msgstr ""
5384
5385 #. type: tbl table
5386 #: build/C/man7/signal.7:284
5387 #, no-wrap
5388 msgid "SIGXFSZ\t25,25,31\tCore\tFile size limit exceeded (4.2BSD)\n"
5389 msgstr ""
5390
5391 #. type: Plain text
5392 #: build/C/man7/signal.7:297
5393 msgid ""
5394 "Up to and including Linux 2.2, the default behavior for B<SIGSYS>, "
5395 "B<SIGXCPU>, B<SIGXFSZ>, and (on architectures other than SPARC and MIPS)  "
5396 "B<SIGBUS> was to terminate the process (without a core dump).  (On some "
5397 "other UNIX systems the default action for B<SIGXCPU> and B<SIGXFSZ> is to "
5398 "terminate the process without a core dump.)  Linux 2.4 conforms to the "
5399 "POSIX.1-2001 requirements for these signals, terminating the process with a "
5400 "core dump."
5401 msgstr ""
5402
5403 #. type: Plain text
5404 #: build/C/man7/signal.7:299
5405 msgid "Next various other signals."
5406 msgstr ""
5407
5408 #. type: tbl table
5409 #: build/C/man7/signal.7:304
5410 #, no-wrap
5411 msgid "SIGIOT\t6\tCore\tIOT trap. A synonym for B<SIGABRT>\n"
5412 msgstr ""
5413
5414 #. type: tbl table
5415 #: build/C/man7/signal.7:305
5416 #, no-wrap
5417 msgid "SIGEMT\t7,-,7\tTerm\n"
5418 msgstr ""
5419
5420 #. type: tbl table
5421 #: build/C/man7/signal.7:306
5422 #, no-wrap
5423 msgid "SIGSTKFLT\t-,16,-\tTerm\tStack fault on coprocessor (unused)\n"
5424 msgstr ""
5425
5426 #. type: tbl table
5427 #: build/C/man7/signal.7:307
5428 #, no-wrap
5429 msgid "SIGIO\t23,29,22\tTerm\tI/O now possible (4.2BSD)\n"
5430 msgstr ""
5431
5432 #. type: tbl table
5433 #: build/C/man7/signal.7:308
5434 #, no-wrap
5435 msgid "SIGCLD\t-,-,18\tIgn\tA synonym for B<SIGCHLD>\n"
5436 msgstr ""
5437
5438 #. type: tbl table
5439 #: build/C/man7/signal.7:309
5440 #, no-wrap
5441 msgid "SIGPWR\t29,30,19\tTerm\tPower failure (System V)\n"
5442 msgstr ""
5443
5444 #. type: tbl table
5445 #: build/C/man7/signal.7:310
5446 #, no-wrap
5447 msgid "SIGINFO\t29,-,-\t\tA synonym for B<SIGPWR>\n"
5448 msgstr ""
5449
5450 #. type: tbl table
5451 #: build/C/man7/signal.7:311
5452 #, no-wrap
5453 msgid "SIGLOST\t-,-,-\tTerm\tFile lock lost (unused)\n"
5454 msgstr ""
5455
5456 #. type: tbl table
5457 #: build/C/man7/signal.7:312
5458 #, no-wrap
5459 msgid "SIGWINCH\t28,28,20\tIgn\tWindow resize signal (4.3BSD, Sun)\n"
5460 msgstr ""
5461
5462 #. type: tbl table
5463 #: build/C/man7/signal.7:313
5464 #, no-wrap
5465 msgid "SIGUNUSED\t-,31,-\tCore\tSynonymous with B<SIGSYS>\n"
5466 msgstr ""
5467
5468 #. type: Plain text
5469 #: build/C/man7/signal.7:323
5470 msgid "(Signal 29 is B<SIGINFO> / B<SIGPWR> on an alpha but B<SIGLOST> on a sparc.)"
5471 msgstr ""
5472
5473 #. type: Plain text
5474 #: build/C/man7/signal.7:329
5475 msgid ""
5476 "B<SIGEMT> is not specified in POSIX.1-2001, but nevertheless appears on most "
5477 "other UNIX systems, where its default action is typically to terminate the "
5478 "process with a core dump."
5479 msgstr ""
5480
5481 #. type: Plain text
5482 #: build/C/man7/signal.7:333
5483 msgid ""
5484 "B<SIGPWR> (which is not specified in POSIX.1-2001) is typically ignored by "
5485 "default on those other UNIX systems where it appears."
5486 msgstr ""
5487
5488 #. type: Plain text
5489 #: build/C/man7/signal.7:337
5490 msgid ""
5491 "B<SIGIO> (which is not specified in POSIX.1-2001) is ignored by default on "
5492 "several other UNIX systems."
5493 msgstr ""
5494
5495 #.  parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
5496 #. type: Plain text
5497 #: build/C/man7/signal.7:344
5498 msgid ""
5499 "Where defined, B<SIGUNUSED> is synonymous with B<SIGSYS> on most "
5500 "architectures."
5501 msgstr ""
5502
5503 #. type: SS
5504 #: build/C/man7/signal.7:344
5505 #, no-wrap
5506 msgid "Real-time Signals"
5507 msgstr ""
5508
5509 #. type: Plain text
5510 #: build/C/man7/signal.7:354
5511 msgid ""
5512 "Linux supports real-time signals as originally defined in the POSIX.1b "
5513 "real-time extensions (and now included in POSIX.1-2001).  The range of "
5514 "supported real-time signals is defined by the macros B<SIGRTMIN> and "
5515 "B<SIGRTMAX>.  POSIX.1-2001 requires that an implementation support at least "
5516 "B<_POSIX_RTSIG_MAX> (8) real-time signals."
5517 msgstr ""
5518
5519 #. type: Plain text
5520 #: build/C/man7/signal.7:376
5521 msgid ""
5522 "The Linux kernel supports a range of 32 different real-time signals, "
5523 "numbered 33 to 64.  However, the glibc POSIX threads implementation "
5524 "internally uses two (for NPTL) or three (for LinuxThreads) real-time signals "
5525 "(see B<pthreads>(7)), and adjusts the value of B<SIGRTMIN> suitably (to 34 "
5526 "or 35).  Because the range of available real-time signals varies according "
5527 "to the glibc threading implementation (and this variation can occur at run "
5528 "time according to the available kernel and glibc), and indeed the range of "
5529 "real-time signals varies across UNIX systems, programs should I<never refer "
5530 "to real-time signals using hard-coded numbers>, but instead should always "
5531 "refer to real-time signals using the notation B<SIGRTMIN>+n, and include "
5532 "suitable (run-time) checks that B<SIGRTMIN>+n does not exceed B<SIGRTMAX>."
5533 msgstr ""
5534
5535 #. type: Plain text
5536 #: build/C/man7/signal.7:380
5537 msgid ""
5538 "Unlike standard signals, real-time signals have no predefined meanings: the "
5539 "entire set of real-time signals can be used for application-defined "
5540 "purposes."
5541 msgstr ""
5542
5543 #. type: Plain text
5544 #: build/C/man7/signal.7:383
5545 msgid ""
5546 "The default action for an unhandled real-time signal is to terminate the "
5547 "receiving process."
5548 msgstr ""
5549
5550 #. type: Plain text
5551 #: build/C/man7/signal.7:385
5552 msgid "Real-time signals are distinguished by the following:"
5553 msgstr ""
5554
5555 #. type: Plain text
5556 #: build/C/man7/signal.7:389
5557 msgid ""
5558 "Multiple instances of real-time signals can be queued.  By contrast, if "
5559 "multiple instances of a standard signal are delivered while that signal is "
5560 "currently blocked, then only one instance is queued."
5561 msgstr ""
5562
5563 #. type: Plain text
5564 #: build/C/man7/signal.7:409
5565 msgid ""
5566 "If the signal is sent using B<sigqueue>(3), an accompanying value (either an "
5567 "integer or a pointer) can be sent with the signal.  If the receiving process "
5568 "establishes a handler for this signal using the B<SA_SIGINFO> flag to "
5569 "B<sigaction>(2)  then it can obtain this data via the I<si_value> field of "
5570 "the I<siginfo_t> structure passed as the second argument to the handler.  "
5571 "Furthermore, the I<si_pid> and I<si_uid> fields of this structure can be "
5572 "used to obtain the PID and real user ID of the process sending the signal."
5573 msgstr ""
5574
5575 #. type: Plain text
5576 #: build/C/man7/signal.7:418
5577 msgid ""
5578 "Real-time signals are delivered in a guaranteed order.  Multiple real-time "
5579 "signals of the same type are delivered in the order they were sent.  If "
5580 "different real-time signals are sent to a process, they are delivered "
5581 "starting with the lowest-numbered signal.  (I.e., low-numbered signals have "
5582 "highest priority.)  By contrast, if multiple standard signals are pending "
5583 "for a process, the order in which they are delivered is unspecified."
5584 msgstr ""
5585
5586 #. type: Plain text
5587 #: build/C/man7/signal.7:423
5588 msgid ""
5589 "If both standard and real-time signals are pending for a process, POSIX "
5590 "leaves it unspecified which is delivered first.  Linux, like many other "
5591 "implementations, gives priority to standard signals in this case."
5592 msgstr ""
5593
5594 #. type: Plain text
5595 #: build/C/man7/signal.7:446
5596 msgid ""
5597 "According to POSIX, an implementation should permit at least "
5598 "B<_POSIX_SIGQUEUE_MAX> (32) real-time signals to be queued to a process.  "
5599 "However, Linux does things differently.  In kernels up to and including "
5600 "2.6.7, Linux imposes a system-wide limit on the number of queued real-time "
5601 "signals for all processes.  This limit can be viewed and (with privilege) "
5602 "changed via the I</proc/sys/kernel/rtsig-max> file.  A related file, "
5603 "I</proc/sys/kernel/rtsig-nr>, can be used to find out how many real-time "
5604 "signals are currently queued.  In Linux 2.6.8, these I</proc> interfaces "
5605 "were replaced by the B<RLIMIT_SIGPENDING> resource limit, which specifies a "
5606 "per-user limit for queued signals; see B<setrlimit>(2)  for further details."
5607 msgstr ""
5608
5609 #. type: SS
5610 #: build/C/man7/signal.7:446
5611 #, no-wrap
5612 msgid "Async-signal-safe functions"
5613 msgstr ""
5614
5615 #. type: Plain text
5616 #: build/C/man7/signal.7:455
5617 msgid ""
5618 "A signal handler function must be very careful, since processing elsewhere "
5619 "may be interrupted at some arbitrary point in the execution of the program.  "
5620 "POSIX has the concept of \"safe function\".  If a signal interrupts the "
5621 "execution of an unsafe function, and I<handler> calls an unsafe function, "
5622 "then the behavior of the program is undefined."
5623 msgstr ""
5624
5625 #. type: Plain text
5626 #: build/C/man7/signal.7:459
5627 msgid ""
5628 "POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2)  requires "
5629 "an implementation to guarantee that the following functions can be safely "
5630 "called inside a signal handler:"
5631 msgstr ""
5632
5633 #. type: Plain text
5634 #: build/C/man7/signal.7:580
5635 #, no-wrap
5636 msgid ""
5637 "_Exit()\n"
5638 "_exit()\n"
5639 "abort()\n"
5640 "accept()\n"
5641 "access()\n"
5642 "aio_error()\n"
5643 "aio_return()\n"
5644 "aio_suspend()\n"
5645 "alarm()\n"
5646 "bind()\n"
5647 "cfgetispeed()\n"
5648 "cfgetospeed()\n"
5649 "cfsetispeed()\n"
5650 "cfsetospeed()\n"
5651 "chdir()\n"
5652 "chmod()\n"
5653 "chown()\n"
5654 "clock_gettime()\n"
5655 "close()\n"
5656 "connect()\n"
5657 "creat()\n"
5658 "dup()\n"
5659 "dup2()\n"
5660 "execle()\n"
5661 "execve()\n"
5662 "fchmod()\n"
5663 "fchown()\n"
5664 "fcntl()\n"
5665 "fdatasync()\n"
5666 "fork()\n"
5667 "fpathconf()\n"
5668 "fstat()\n"
5669 "fsync()\n"
5670 "ftruncate()\n"
5671 "getegid()\n"
5672 "geteuid()\n"
5673 "getgid()\n"
5674 "getgroups()\n"
5675 "getpeername()\n"
5676 "getpgrp()\n"
5677 "getpid()\n"
5678 "getppid()\n"
5679 "getsockname()\n"
5680 "getsockopt()\n"
5681 "getuid()\n"
5682 "kill()\n"
5683 "link()\n"
5684 "listen()\n"
5685 "lseek()\n"
5686 "lstat()\n"
5687 "mkdir()\n"
5688 "mkfifo()\n"
5689 "open()\n"
5690 "pathconf()\n"
5691 "pause()\n"
5692 "pipe()\n"
5693 "poll()\n"
5694 "posix_trace_event()\n"
5695 "pselect()\n"
5696 "raise()\n"
5697 "read()\n"
5698 "readlink()\n"
5699 "recv()\n"
5700 "recvfrom()\n"
5701 "recvmsg()\n"
5702 "rename()\n"
5703 "rmdir()\n"
5704 "select()\n"
5705 "sem_post()\n"
5706 "send()\n"
5707 "sendmsg()\n"
5708 "sendto()\n"
5709 "setgid()\n"
5710 "setpgid()\n"
5711 "setsid()\n"
5712 "setsockopt()\n"
5713 "setuid()\n"
5714 "shutdown()\n"
5715 "sigaction()\n"
5716 "sigaddset()\n"
5717 "sigdelset()\n"
5718 "sigemptyset()\n"
5719 "sigfillset()\n"
5720 "sigismember()\n"
5721 "signal()\n"
5722 "sigpause()\n"
5723 "sigpending()\n"
5724 "sigprocmask()\n"
5725 "sigqueue()\n"
5726 "sigset()\n"
5727 "sigsuspend()\n"
5728 "sleep()\n"
5729 "sockatmark()\n"
5730 "socket()\n"
5731 "socketpair()\n"
5732 "stat()\n"
5733 "symlink()\n"
5734 "sysconf()\n"
5735 "tcdrain()\n"
5736 "tcflow()\n"
5737 "tcflush()\n"
5738 "tcgetattr()\n"
5739 "tcgetpgrp()\n"
5740 "tcsendbreak()\n"
5741 "tcsetattr()\n"
5742 "tcsetpgrp()\n"
5743 "time()\n"
5744 "timer_getoverrun()\n"
5745 "timer_gettime()\n"
5746 "timer_settime()\n"
5747 "times()\n"
5748 "umask()\n"
5749 "uname()\n"
5750 "unlink()\n"
5751 "utime()\n"
5752 "wait()\n"
5753 "waitpid()\n"
5754 "write()\n"
5755 msgstr ""
5756
5757 #. type: Plain text
5758 #: build/C/man7/signal.7:585
5759 msgid ""
5760 "POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf()  from the above "
5761 "list, and adds the following functions:"
5762 msgstr ""
5763
5764 #. type: Plain text
5765 #: build/C/man7/signal.7:608
5766 #, no-wrap
5767 msgid ""
5768 "execl()\n"
5769 "execv()\n"
5770 "faccessat()\n"
5771 "fchmodat()\n"
5772 "fchownat()\n"
5773 "fexecve()\n"
5774 "fstatat()\n"
5775 "futimens()\n"
5776 "linkat()\n"
5777 "mkdirat()\n"
5778 "mkfifoat()\n"
5779 "mknod()\n"
5780 "mknodat()\n"
5781 "openat()\n"
5782 "readlinkat()\n"
5783 "renameat()\n"
5784 "symlinkat()\n"
5785 "unlinkat()\n"
5786 "utimensat()\n"
5787 "utimes()\n"
5788 msgstr ""
5789
5790 #. type: SS
5791 #: build/C/man7/signal.7:610
5792 #, no-wrap
5793 msgid "Interruption of System Calls and Library Functions by Signal Handlers"
5794 msgstr ""
5795
5796 #. type: Plain text
5797 #: build/C/man7/signal.7:613
5798 msgid ""
5799 "If a signal handler is invoked while a system call or library function call "
5800 "is blocked, then either:"
5801 msgstr ""
5802
5803 #. type: Plain text
5804 #: build/C/man7/signal.7:615
5805 msgid "the call is automatically restarted after the signal handler returns; or"
5806 msgstr ""
5807
5808 #. type: Plain text
5809 #: build/C/man7/signal.7:618
5810 msgid "the call fails with the error B<EINTR>."
5811 msgstr ""
5812
5813 #. type: Plain text
5814 #: build/C/man7/signal.7:626
5815 msgid ""
5816 "Which of these two behaviors occurs depends on the interface and whether or "
5817 "not the signal handler was established using the B<SA_RESTART> flag (see "
5818 "B<sigaction>(2)).  The details vary across UNIX systems; below, the details "
5819 "for Linux."
5820 msgstr ""
5821
5822 #.  The following system calls use ERESTARTSYS,
5823 #.  so that they are restartable
5824 #. type: Plain text
5825 #: build/C/man7/signal.7:635
5826 msgid ""
5827 "If a blocked call to one of the following interfaces is interrupted by a "
5828 "signal handler, then the call will be automatically restarted after the "
5829 "signal handler returns if the B<SA_RESTART> flag was used; otherwise the "
5830 "call will fail with the error B<EINTR>:"
5831 msgstr ""
5832
5833 #. type: Plain text
5834 #: build/C/man7/signal.7:651
5835 msgid ""
5836 "B<read>(2), B<readv>(2), B<write>(2), B<writev>(2), and B<ioctl>(2)  calls "
5837 "on \"slow\" devices.  A \"slow\" device is one where the I/O call may block "
5838 "for an indefinite time, for example, a terminal, pipe, or socket.  (A disk "
5839 "is not a slow device according to this definition.)  If an I/O call on a "
5840 "slow device has already transferred some data by the time it is interrupted "
5841 "by a signal handler, then the call will return a success status (normally, "
5842 "the number of bytes transferred)."
5843 msgstr ""
5844
5845 #. type: Plain text
5846 #: build/C/man7/signal.7:655
5847 msgid "B<open>(2), if it can block (e.g., when opening a FIFO; see B<fifo>(7))."
5848 msgstr ""
5849
5850 #. type: Plain text
5851 #: build/C/man7/signal.7:662
5852 msgid "B<wait>(2), B<wait3>(2), B<wait4>(2), B<waitid>(2), and B<waitpid>(2)."
5853 msgstr ""
5854
5855 #.  If a timeout (setsockopt()) is in effect on the socket, then these
5856 #.  system calls switch to using EINTR.  Consequently, they and are not
5857 #.  automatically restarted, and they show the stop/cont behavior
5858 #.  described below.  (Verified from 2.6.26 source, and by experiment; mtk)
5859 #. type: Plain text
5860 #: build/C/man7/signal.7:678
5861 msgid ""
5862 "Socket interfaces: B<accept>(2), B<connect>(2), B<recv>(2), B<recvfrom>(2), "
5863 "B<recvmsg>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), unless a timeout "
5864 "has been set on the socket (see below)."
5865 msgstr ""
5866
5867 #. type: Plain text
5868 #: build/C/man7/signal.7:684
5869 msgid "File locking interfaces: B<flock>(2)  and B<fcntl>(2)  B<F_SETLKW>."
5870 msgstr ""
5871
5872 #. type: Plain text
5873 #: build/C/man7/signal.7:691
5874 msgid ""
5875 "POSIX message queue interfaces: B<mq_receive>(3), B<mq_timedreceive>(3), "
5876 "B<mq_send>(3), and B<mq_timedsend>(3)."
5877 msgstr ""
5878
5879 #. type: Plain text
5880 #: build/C/man7/signal.7:696
5881 msgid ""
5882 "B<futex>(2)  B<FUTEX_WAIT> (since Linux 2.6.22; beforehand, always failed "
5883 "with B<EINTR>)."
5884 msgstr ""
5885
5886 #. type: Plain text
5887 #: build/C/man7/signal.7:703
5888 msgid ""
5889 "POSIX semaphore interfaces: B<sem_wait>(3)  and B<sem_timedwait>(3)  (since "
5890 "Linux 2.6.22; beforehand, always failed with B<EINTR>)."
5891 msgstr ""
5892
5893 #.  These are the system calls that give EINTR or ERESTARTNOHAND
5894 #.  on interruption by a signal handler.
5895 #. type: Plain text
5896 #: build/C/man7/signal.7:714
5897 msgid ""
5898 "The following interfaces are never restarted after being interrupted by a "
5899 "signal handler, regardless of the use of B<SA_RESTART>; they always fail "
5900 "with the error B<EINTR> when interrupted by a signal handler:"
5901 msgstr ""
5902
5903 #. type: Plain text
5904 #: build/C/man7/signal.7:734 build/C/man7/signal.7:808
5905 msgid ""
5906 "Socket interfaces, when a timeout has been set on the socket using "
5907 "B<setsockopt>(2): B<accept>(2), B<recv>(2), B<recvfrom>(2), and "
5908 "B<recvmsg>(2), if a receive timeout (B<SO_RCVTIMEO>)  has been set; "
5909 "B<connect>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), if a send "
5910 "timeout (B<SO_SNDTIMEO>)  has been set."
5911 msgstr ""
5912
5913 #. type: Plain text
5914 #: build/C/man7/signal.7:741
5915 msgid ""
5916 "Interfaces used to wait for signals: B<pause>(2), B<sigsuspend>(2), "
5917 "B<sigtimedwait>(2), and B<sigwaitinfo>(2)."
5918 msgstr ""
5919
5920 #. type: Plain text
5921 #: build/C/man7/signal.7:750
5922 msgid ""
5923 "File descriptor multiplexing interfaces: B<epoll_wait>(2), "
5924 "B<epoll_pwait>(2), B<poll>(2), B<ppoll>(2), B<select>(2), and B<pselect>(2)."
5925 msgstr ""
5926
5927 #.  On some other systems, SA_RESTART does restart these system calls
5928 #. type: Plain text
5929 #: build/C/man7/signal.7:758
5930 msgid ""
5931 "System V IPC interfaces: B<msgrcv>(2), B<msgsnd>(2), B<semop>(2), and "
5932 "B<semtimedop>(2)."
5933 msgstr ""
5934
5935 #. type: Plain text
5936 #: build/C/man7/signal.7:764
5937 msgid "Sleep interfaces: B<clock_nanosleep>(2), B<nanosleep>(2), and B<usleep>(3)."
5938 msgstr ""
5939
5940 #. type: Plain text
5941 #: build/C/man7/signal.7:769 build/C/man7/signal.7:822
5942 msgid "B<read>(2)  from an B<inotify>(7)  file descriptor."
5943 msgstr ""
5944
5945 #. type: Plain text
5946 #: build/C/man7/signal.7:771
5947 msgid "B<io_getevents>(2)."
5948 msgstr ""
5949
5950 #. type: Plain text
5951 #: build/C/man7/signal.7:777
5952 msgid ""
5953 "The B<sleep>(3)  function is also never restarted if interrupted by a "
5954 "handler, but gives a success return: the number of seconds remaining to "
5955 "sleep."
5956 msgstr ""
5957
5958 #. type: SS
5959 #: build/C/man7/signal.7:777
5960 #, no-wrap
5961 msgid "Interruption of System Calls and Library Functions by Stop Signals"
5962 msgstr ""
5963
5964 #. type: Plain text
5965 #: build/C/man7/signal.7:786
5966 msgid ""
5967 "On Linux, even in the absence of signal handlers, certain blocking "
5968 "interfaces can fail with the error B<EINTR> after the process is stopped by "
5969 "one of the stop signals and then resumed via B<SIGCONT>.  This behavior is "
5970 "not sanctioned by POSIX.1, and doesn't occur on other systems."
5971 msgstr ""
5972
5973 #. type: Plain text
5974 #: build/C/man7/signal.7:788
5975 msgid "The Linux interfaces that display this behavior are:"
5976 msgstr ""
5977
5978 #. type: Plain text
5979 #: build/C/man7/signal.7:811
5980 msgid "B<epoll_wait>(2), B<epoll_pwait>(2)."
5981 msgstr ""
5982
5983 #. type: Plain text
5984 #: build/C/man7/signal.7:814
5985 msgid "B<semop>(2), B<semtimedop>(2)."
5986 msgstr ""
5987
5988 #. type: Plain text
5989 #: build/C/man7/signal.7:817
5990 msgid "B<sigtimedwait>(2), B<sigwaitinfo>(2)."
5991 msgstr ""
5992
5993 #. type: Plain text
5994 #: build/C/man7/signal.7:828
5995 msgid ""
5996 "Linux 2.6.21 and earlier: B<futex>(2)  B<FUTEX_WAIT>, B<sem_timedwait>(3), "
5997 "B<sem_wait>(3)."
5998 msgstr ""
5999
6000 #. type: Plain text
6001 #: build/C/man7/signal.7:832
6002 msgid "Linux 2.6.8 and earlier: B<msgrcv>(2), B<msgsnd>(2)."
6003 msgstr ""
6004
6005 #. type: Plain text
6006 #: build/C/man7/signal.7:835
6007 msgid "Linux 2.4 and earlier: B<nanosleep>(2)."
6008 msgstr ""
6009
6010 #.  It must be a *very* long time since this was true:
6011 #.  .SH BUGS
6012 #.  .B SIGIO
6013 #.  and
6014 #.  .B SIGLOST
6015 #.  have the same value.
6016 #.  The latter is commented out in the kernel source, but
6017 #.  the build process of some software still thinks that
6018 #.  signal 29 is
6019 #.  .BR SIGLOST .
6020 #. type: Plain text
6021 #: build/C/man7/signal.7:848
6022 msgid "POSIX.1, except as noted."
6023 msgstr ""
6024
6025 #. type: Plain text
6026 #: build/C/man7/signal.7:881
6027 msgid ""
6028 "B<kill>(1), B<getrlimit>(2), B<kill>(2), B<killpg>(2), "
6029 "B<rt_sigqueueinfo>(2), B<setitimer>(2), B<setrlimit>(2), B<sgetmask>(2), "
6030 "B<sigaction>(2), B<sigaltstack>(2), B<signal>(2), B<signalfd>(2), "
6031 "B<sigpending>(2), B<sigprocmask>(2), B<sigsuspend>(2), B<sigwaitinfo>(2), "
6032 "B<abort>(3), B<bsd_signal>(3), B<longjmp>(3), B<raise>(3), "
6033 "B<pthread_sigqueue>(3), B<sigqueue>(3), B<sigset>(3), B<sigsetops>(3), "
6034 "B<sigvec>(3), B<sigwait>(3), B<strsignal>(3), B<sysv_signal>(3), B<core>(5), "
6035 "B<proc>(5), B<pthreads>(7), B<sigevent>(7)"
6036 msgstr ""
6037
6038 #. type: TH
6039 #: build/C/man2/signalfd.2:19
6040 #, no-wrap
6041 msgid "SIGNALFD"
6042 msgstr ""
6043
6044 #. type: TH
6045 #: build/C/man2/signalfd.2:19
6046 #, no-wrap
6047 msgid "2009-01-13"
6048 msgstr ""
6049
6050 #. type: Plain text
6051 #: build/C/man2/signalfd.2:22
6052 msgid "signalfd - create a file descriptor for accepting signals"
6053 msgstr ""
6054
6055 #. type: Plain text
6056 #: build/C/man2/signalfd.2:24
6057 msgid "B<#include E<lt>sys/signalfd.hE<gt>>"
6058 msgstr ""
6059
6060 #. type: Plain text
6061 #: build/C/man2/signalfd.2:26
6062 msgid "B<int signalfd(int >I<fd>B<, const sigset_t *>I<mask>B<, int >I<flags>B<);>"
6063 msgstr ""
6064
6065 #. type: Plain text
6066 #: build/C/man2/signalfd.2:37
6067 msgid ""
6068 "B<signalfd>()  creates a file descriptor that can be used to accept signals "
6069 "targeted at the caller.  This provides an alternative to the use of a signal "
6070 "handler or B<sigwaitinfo>(2), and has the advantage that the file descriptor "
6071 "may be monitored by B<select>(2), B<poll>(2), and B<epoll>(7)."
6072 msgstr ""
6073
6074 #. type: Plain text
6075 #: build/C/man2/signalfd.2:57
6076 msgid ""
6077 "The I<mask> argument specifies the set of signals that the caller wishes to "
6078 "accept via the file descriptor.  This argument is a signal set whose "
6079 "contents can be initialized using the macros described in B<sigsetops>(3).  "
6080 "Normally, the set of signals to be received via the file descriptor should "
6081 "be blocked using B<sigprocmask>(2), to prevent the signals being handled "
6082 "according to their default dispositions.  It is not possible to receive "
6083 "B<SIGKILL> or B<SIGSTOP> signals via a signalfd file descriptor; these "
6084 "signals are silently ignored if specified in I<mask>."
6085 msgstr ""
6086
6087 #. type: Plain text
6088 #: build/C/man2/signalfd.2:71
6089 msgid ""
6090 "If the I<fd> argument is -1, then the call creates a new file descriptor and "
6091 "associates the signal set specified in I<mask> with that descriptor.  If "
6092 "I<fd> is not -1, then it must specify a valid existing signalfd file "
6093 "descriptor, and I<mask> is used to replace the signal set associated with "
6094 "that descriptor."
6095 msgstr ""
6096
6097 #. type: Plain text
6098 #: build/C/man2/signalfd.2:76
6099 msgid ""
6100 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
6101 "I<flags> to change the behaviour of B<signalfd>():"
6102 msgstr ""
6103
6104 #. type: TP
6105 #: build/C/man2/signalfd.2:76
6106 #, no-wrap
6107 msgid "B<SFD_NONBLOCK>"
6108 msgstr ""
6109
6110 #. type: TP
6111 #: build/C/man2/signalfd.2:84
6112 #, no-wrap
6113 msgid "B<SFD_CLOEXEC>"
6114 msgstr ""
6115
6116 #. type: Plain text
6117 #: build/C/man2/signalfd.2:101
6118 msgid ""
6119 "B<signalfd>()  returns a file descriptor that supports the following "
6120 "operations:"
6121 msgstr ""
6122
6123 #. type: Plain text
6124 #: build/C/man2/signalfd.2:120
6125 msgid ""
6126 "If one or more of the signals specified in I<mask> is pending for the "
6127 "process, then the buffer supplied to B<read>(2)  is used to return one or "
6128 "more I<signalfd_siginfo> structures (see below) that describe the signals.  "
6129 "The B<read>(2)  returns information for as many signals as are pending and "
6130 "will fit in the supplied buffer.  The buffer must be at least "
6131 "I<sizeof(struct signalfd_siginfo)> bytes.  The return value of the "
6132 "B<read>(2)  is the total number of bytes read."
6133 msgstr ""
6134
6135 #. type: Plain text
6136 #: build/C/man2/signalfd.2:128
6137 msgid ""
6138 "As a consequence of the B<read>(2), the signals are consumed, so that they "
6139 "are no longer pending for the process (i.e., will not be caught by signal "
6140 "handlers, and cannot be accepted using B<sigwaitinfo>(2))."
6141 msgstr ""
6142
6143 #. type: Plain text
6144 #: build/C/man2/signalfd.2:139
6145 msgid ""
6146 "If none of the signals in I<mask> is pending for the process, then the "
6147 "B<read>(2)  either blocks until one of the signals in I<mask> is generated "
6148 "for the process, or fails with the error B<EAGAIN> if the file descriptor "
6149 "has been made nonblocking."
6150 msgstr ""
6151
6152 #. type: Plain text
6153 #: build/C/man2/signalfd.2:152
6154 msgid ""
6155 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
6156 "B<poll>(2)  B<POLLIN> flag)  if one or more of the signals in I<mask> is "
6157 "pending for the process."
6158 msgstr ""
6159
6160 #. type: Plain text
6161 #: build/C/man2/signalfd.2:159
6162 msgid ""
6163 "The signalfd file descriptor also supports the other file-descriptor "
6164 "multiplexing APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
6165 msgstr ""
6166
6167 #. type: Plain text
6168 #: build/C/man2/signalfd.2:164
6169 msgid ""
6170 "When the file descriptor is no longer required it should be closed.  When "
6171 "all file descriptors associated with the same signalfd object have been "
6172 "closed, the resources for object are freed by the kernel."
6173 msgstr ""
6174
6175 #. type: SS
6176 #: build/C/man2/signalfd.2:164
6177 #, no-wrap
6178 msgid "The signalfd_siginfo structure"
6179 msgstr ""
6180
6181 #. type: Plain text
6182 #: build/C/man2/signalfd.2:170
6183 msgid ""
6184 "The format of the I<signalfd_siginfo> structure(s) returned by B<read>(2)s "
6185 "from a signalfd file descriptor is as follows:"
6186 msgstr ""
6187
6188 #.  ssi_trapno is unused on most arches
6189 #. type: Plain text
6190 #: build/C/man2/signalfd.2:195
6191 #, no-wrap
6192 msgid ""
6193 "struct signalfd_siginfo {\n"
6194 "    uint32_t ssi_signo;   /* Signal number */\n"
6195 "    int32_t  ssi_errno;   /* Error number (unused) */\n"
6196 "    int32_t  ssi_code;    /* Signal code */\n"
6197 "    uint32_t ssi_pid;     /* PID of sender */\n"
6198 "    uint32_t ssi_uid;     /* Real UID of sender */\n"
6199 "    int32_t  ssi_fd;      /* File descriptor (SIGIO) */\n"
6200 "    uint32_t ssi_tid;     /* Kernel timer ID (POSIX timers)\n"
6201 "    uint32_t ssi_band;    /* Band event (SIGIO) */\n"
6202 "    uint32_t ssi_overrun; /* POSIX timer overrun count */\n"
6203 "    uint32_t ssi_trapno;  /* Trap number that caused signal */\n"
6204 "    int32_t  ssi_status;  /* Exit status or signal (SIGCHLD) */\n"
6205 "    int32_t  ssi_int;     /* Integer sent by sigqueue(3) */\n"
6206 "    uint64_t ssi_ptr;     /* Pointer sent by sigqueue(3) */\n"
6207 "    uint64_t ssi_utime;   /* User CPU time consumed (SIGCHLD) */\n"
6208 "    uint64_t ssi_stime;   /* System CPU time consumed (SIGCHLD) */\n"
6209 "    uint64_t ssi_addr;    /* Address that generated signal\n"
6210 "                             (for hardware-generated signals) */\n"
6211 "    uint8_t  pad[I<X>];      /* Pad size to 128 bytes (allow for\n"
6212 "                              additional fields in the future) */\n"
6213 "};\n"
6214 msgstr ""
6215
6216 #. type: Plain text
6217 #: build/C/man2/signalfd.2:218
6218 msgid ""
6219 "Each of the fields in this structure is analogous to the similarly named "
6220 "field in the I<siginfo_t> structure.  The I<siginfo_t> structure is "
6221 "described in B<sigaction>(2).  Not all fields in the returned "
6222 "I<signalfd_siginfo> structure will be valid for a specific signal; the set "
6223 "of valid fields can be determined from the value returned in the I<ssi_code> "
6224 "field.  This field is the analog of the I<siginfo_t> I<si_code> field; see "
6225 "B<sigaction>(2)  for details."
6226 msgstr ""
6227
6228 #. type: SS
6229 #: build/C/man2/signalfd.2:218 build/C/man2/timerfd_create.2:268
6230 #, no-wrap
6231 msgid "fork(2) semantics"
6232 msgstr ""
6233
6234 #. type: Plain text
6235 #: build/C/man2/signalfd.2:226
6236 msgid ""
6237 "After a B<fork>(2), the child inherits a copy of the signalfd file "
6238 "descriptor.  A B<read>(2)  from the file descriptor in the child will return "
6239 "information about signals queued to the child."
6240 msgstr ""
6241
6242 #. type: SS
6243 #: build/C/man2/signalfd.2:226 build/C/man2/timerfd_create.2:280
6244 #, no-wrap
6245 msgid "execve(2) semantics"
6246 msgstr ""
6247
6248 #. type: Plain text
6249 #: build/C/man2/signalfd.2:238
6250 msgid ""
6251 "Just like any other file descriptor, a signalfd file descriptor remains open "
6252 "across an B<execve>(2), unless it has been marked for close-on-exec (see "
6253 "B<fcntl>(2)).  Any signals that were available for reading before the "
6254 "B<execve>(2)  remain available to the newly loaded program.  (This is "
6255 "analogous to traditional signal semantics, where a blocked signal that is "
6256 "pending remains pending across an B<execve>(2).)"
6257 msgstr ""
6258
6259 #. type: SS
6260 #: build/C/man2/signalfd.2:238
6261 #, no-wrap
6262 msgid "Thread semantics"
6263 msgstr ""
6264
6265 #. type: Plain text
6266 #: build/C/man2/signalfd.2:248
6267 msgid ""
6268 "The semantics of signalfd file descriptors in a multithreaded program mirror "
6269 "the standard semantics for signals.  In other words, when a thread reads "
6270 "from a signalfd file descriptor, it will read the signals that are directed "
6271 "to the thread itself and the signals that are directed to the process (i.e., "
6272 "the entire thread group).  (A thread will not be able to read signals that "
6273 "are directed to other threads in the process.)"
6274 msgstr ""
6275
6276 #. type: Plain text
6277 #: build/C/man2/signalfd.2:262
6278 msgid ""
6279 "On success, B<signalfd>()  returns a signalfd file descriptor; this is "
6280 "either a new file descriptor (if I<fd> was -1), or I<fd> if I<fd> was a "
6281 "valid signalfd file descriptor.  On error, -1 is returned and I<errno> is "
6282 "set to indicate the error."
6283 msgstr ""
6284
6285 #. type: TP
6286 #: build/C/man2/signalfd.2:263 build/C/man2/timerfd_create.2:337
6287 #, no-wrap
6288 msgid "B<EBADF>"
6289 msgstr ""
6290
6291 #. type: Plain text
6292 #: build/C/man2/signalfd.2:268
6293 msgid "The I<fd> file descriptor is not a valid file descriptor."
6294 msgstr ""
6295
6296 #.  or, the
6297 #.  .I sizemask
6298 #.  argument is not equal to
6299 #.  .IR sizeof(sigset_t) ;
6300 #. type: Plain text
6301 #: build/C/man2/signalfd.2:276
6302 msgid "I<fd> is not a valid signalfd file descriptor."
6303 msgstr ""
6304
6305 #. type: Plain text
6306 #: build/C/man2/signalfd.2:283 build/C/man2/timerfd_create.2:319
6307 msgid "I<flags> is invalid; or, in Linux 2.6.26 or earlier, I<flags> is nonzero."
6308 msgstr ""
6309
6310 #. type: Plain text
6311 #: build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:322
6312 msgid "The per-process limit of open file descriptors has been reached."
6313 msgstr ""
6314
6315 #. type: Plain text
6316 #: build/C/man2/signalfd.2:296
6317 msgid "There was insufficient memory to create a new signalfd file descriptor."
6318 msgstr ""
6319
6320 #.  signalfd() is in glibc 2.7, but reportedly does not build
6321 #. type: Plain text
6322 #: build/C/man2/signalfd.2:304
6323 msgid ""
6324 "B<signalfd>()  is available on Linux since kernel 2.6.22.  Working support "
6325 "is provided in glibc since version 2.8.  The B<signalfd4>()  system call "
6326 "(see NOTES) is available on Linux since kernel 2.6.27."
6327 msgstr ""
6328
6329 #. type: Plain text
6330 #: build/C/man2/signalfd.2:309
6331 msgid "B<signalfd>()  and B<signalfd4>()  are Linux-specific."
6332 msgstr ""
6333
6334 #. type: Plain text
6335 #: build/C/man2/signalfd.2:319
6336 msgid ""
6337 "The underlying Linux system call requires an additional argument, I<size_t "
6338 "sizemask>, which specifies the size of the I<mask> argument.  The glibc "
6339 "B<signalfd>()  wrapper function does not include this argument, since it "
6340 "provides the required value for the underlying system call."
6341 msgstr ""
6342
6343 #. type: Plain text
6344 #: build/C/man2/signalfd.2:333
6345 msgid ""
6346 "A process can create multiple signalfd file descriptors.  This makes it "
6347 "possible to accept different signals on different file descriptors.  (This "
6348 "may be useful if monitoring the file descriptors using B<select>(2), "
6349 "B<poll>(2), or B<epoll>(7): the arrival of different signals will make "
6350 "different descriptors ready.)  If a signal appears in the I<mask> of more "
6351 "than one of the file descriptors, then occurrences of that signal can be "
6352 "read (once) from any one of the descriptors."
6353 msgstr ""
6354
6355 #. type: Plain text
6356 #: build/C/man2/signalfd.2:349
6357 msgid ""
6358 "There are two underlying Linux system calls: B<signalfd>()  and the more "
6359 "recent B<signalfd4>().  The former system call does not implement a I<flags> "
6360 "argument.  The latter system call implements the I<flags> values described "
6361 "above.  Starting with glibc 2.9, the B<signalfd>()  wrapper function will "
6362 "use B<signalfd4>()  where it is available."
6363 msgstr ""
6364
6365 #.  The fix also was put into 2.6.24.5
6366 #. type: Plain text
6367 #: build/C/man2/signalfd.2:357
6368 msgid ""
6369 "In kernels before 2.6.25, the I<ssi_ptr> and I<ssi_int> fields are not "
6370 "filled in with the data accompanying a signal sent by B<sigqueue>(3)."
6371 msgstr ""
6372
6373 #. type: Plain text
6374 #: build/C/man2/signalfd.2:367
6375 msgid ""
6376 "The program below accepts the signals B<SIGINT> and B<SIGQUIT> via a "
6377 "signalfd file descriptor.  The program terminates after accepting a "
6378 "B<SIGQUIT> signal.  The following shell session demonstrates the use of the "
6379 "program:"
6380 msgstr ""
6381
6382 #. type: Plain text
6383 #: build/C/man2/signalfd.2:378
6384 #, no-wrap
6385 msgid ""
6386 "$B< ./signalfd_demo>\n"
6387 "B<^C>                   # Control-C generates SIGINT\n"
6388 "Got SIGINT\n"
6389 "B<^C>\n"
6390 "Got SIGINT\n"
6391 "B<^\\e>                    # Control-\\e generates SIGQUIT\n"
6392 "Got SIGQUIT\n"
6393 "$\n"
6394 msgstr ""
6395
6396 #. type: Plain text
6397 #: build/C/man2/signalfd.2:388
6398 #, no-wrap
6399 msgid ""
6400 "#include E<lt>sys/signalfd.hE<gt>\n"
6401 "#include E<lt>signal.hE<gt>\n"
6402 "#include E<lt>unistd.hE<gt>\n"
6403 "#include E<lt>stdlib.hE<gt>\n"
6404 "#include E<lt>stdio.hE<gt>\n"
6405 msgstr ""
6406
6407 #. type: Plain text
6408 #: build/C/man2/signalfd.2:399
6409 #, no-wrap
6410 msgid ""
6411 "int\n"
6412 "main(int argc, char *argv[])\n"
6413 "{\n"
6414 "    sigset_t mask;\n"
6415 "    int sfd;\n"
6416 "    struct signalfd_siginfo fdsi;\n"
6417 "    ssize_t s;\n"
6418 msgstr ""
6419
6420 #. type: Plain text
6421 #: build/C/man2/signalfd.2:403
6422 #, no-wrap
6423 msgid ""
6424 "    sigemptyset(&mask);\n"
6425 "    sigaddset(&mask, SIGINT);\n"
6426 "    sigaddset(&mask, SIGQUIT);\n"
6427 msgstr ""
6428
6429 #. type: Plain text
6430 #: build/C/man2/signalfd.2:406
6431 #, no-wrap
6432 msgid ""
6433 "    /* Block signals so that they aren\\(aqt handled\n"
6434 "       according to their default dispositions */\n"
6435 msgstr ""
6436
6437 #. type: Plain text
6438 #: build/C/man2/signalfd.2:409
6439 #, no-wrap
6440 msgid ""
6441 "    if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1)\n"
6442 "        handle_error(\"sigprocmask\");\n"
6443 msgstr ""
6444
6445 #. type: Plain text
6446 #: build/C/man2/signalfd.2:413
6447 #, no-wrap
6448 msgid ""
6449 "    sfd = signalfd(-1, &mask, 0);\n"
6450 "    if (sfd == -1)\n"
6451 "        handle_error(\"signalfd\");\n"
6452 msgstr ""
6453
6454 #. type: Plain text
6455 #: build/C/man2/signalfd.2:418
6456 #, no-wrap
6457 msgid ""
6458 "    for (;;) {\n"
6459 "        s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo));\n"
6460 "        if (s != sizeof(struct signalfd_siginfo))\n"
6461 "            handle_error(\"read\");\n"
6462 msgstr ""
6463
6464 #. type: Plain text
6465 #: build/C/man2/signalfd.2:429
6466 #, no-wrap
6467 msgid ""
6468 "        if (fdsi.ssi_signo == SIGINT) {\n"
6469 "            printf(\"Got SIGINT\\en\");\n"
6470 "        } else if (fdsi.ssi_signo == SIGQUIT) {\n"
6471 "            printf(\"Got SIGQUIT\\en\");\n"
6472 "            exit(EXIT_SUCCESS);\n"
6473 "        } else {\n"
6474 "            printf(\"Read unexpected signal\\en\");\n"
6475 "        }\n"
6476 "    }\n"
6477 "}\n"
6478 msgstr ""
6479
6480 #. type: Plain text
6481 #: build/C/man2/signalfd.2:443
6482 msgid ""
6483 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<sigaction>(2), "
6484 "B<sigprocmask>(2), B<sigwaitinfo>(2), B<timerfd_create>(2), B<sigsetops>(3), "
6485 "B<sigwait>(3), B<epoll>(7), B<signal>(7)"
6486 msgstr ""
6487
6488 #. type: TH
6489 #: build/C/man3/sigpause.3:23
6490 #, no-wrap
6491 msgid "SIGPAUSE"
6492 msgstr ""
6493
6494 #. type: TH
6495 #: build/C/man3/sigpause.3:23
6496 #, no-wrap
6497 msgid "2010-09-12"
6498 msgstr ""
6499
6500 #. type: Plain text
6501 #: build/C/man3/sigpause.3:26
6502 msgid "sigpause - atomically release blocked signals and wait for interrupt"
6503 msgstr ""
6504
6505 #. type: Plain text
6506 #: build/C/man3/sigpause.3:31
6507 #, no-wrap
6508 msgid "B<int sigpause(int >I<sigmask>B<);  /* BSD */>\n"
6509 msgstr ""
6510
6511 #. type: Plain text
6512 #: build/C/man3/sigpause.3:33
6513 #, no-wrap
6514 msgid "B<int sigpause(int >I<sig>B<);      /* System V / UNIX 95 */>\n"
6515 msgstr ""
6516
6517 #. type: Plain text
6518 #: build/C/man3/sigpause.3:39
6519 msgid "Don't use this function.  Use B<sigsuspend>(2)  instead."
6520 msgstr ""
6521
6522 #. type: Plain text
6523 #: build/C/man3/sigpause.3:46
6524 msgid ""
6525 "The function B<sigpause>()  is designed to wait for some signal.  It changes "
6526 "the process's signal mask (set of blocked signals), and then waits for a "
6527 "signal to arrive.  Upon arrival of a signal, the original signal mask is "
6528 "restored."
6529 msgstr ""
6530
6531 #. type: Plain text
6532 #: build/C/man3/sigpause.3:54
6533 msgid ""
6534 "If B<sigpause>()  returns, it was interrupted by a signal and the return "
6535 "value is -1 with I<errno> set to B<EINTR>."
6536 msgstr ""
6537
6538 #. type: Plain text
6539 #: build/C/man3/sigpause.3:58
6540 msgid "The System V version of B<sigpause>()  is standardized in POSIX.1-2001."
6541 msgstr ""
6542
6543 #.  __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
6544 #. type: Plain text
6545 #: build/C/man3/sigpause.3:75
6546 msgid ""
6547 "The classical BSD version of this function appeared in 4.2BSD.  It sets the "
6548 "process's signal mask to I<sigmask>.  UNIX 95 standardized the incompatible "
6549 "System V version of this function, which removes only the specified signal "
6550 "I<sig> from the process's signal mask.  The unfortunate situation with two "
6551 "incompatible functions with the same name was solved by the "
6552 "B<\\%sigsuspend>(2)  function, that takes a I<sigset_t *> argument (instead "
6553 "of an I<int>)."
6554 msgstr ""
6555
6556 #. type: Plain text
6557 #: build/C/man3/sigpause.3:78
6558 msgid ""
6559 "On Linux, this routine is a system call only on the Sparc (sparc64)  "
6560 "architecture."
6561 msgstr ""
6562
6563 #. type: Plain text
6564 #: build/C/man3/sigpause.3:80
6565 msgid "Libc4 and libc5 only know about the BSD version."
6566 msgstr ""
6567
6568 #
6569 #.  For the BSD version, one usually uses a zero
6570 #.  .I sigmask
6571 #.  to indicate that no signals are to be blocked.
6572 #. type: Plain text
6573 #: build/C/man3/sigpause.3:96
6574 msgid ""
6575 "Glibc uses the BSD version if the B<_BSD_SOURCE> feature test macro is "
6576 "defined and none of B<_POSIX_SOURCE>, B<_POSIX_C_SOURCE>, B<_XOPEN_SOURCE>, "
6577 "B<_GNU_SOURCE>, or B<_SVID_SOURCE> is defined.  Otherwise, the System V "
6578 "version is used."
6579 msgstr ""
6580
6581 #. type: Plain text
6582 #: build/C/man3/sigpause.3:104
6583 msgid ""
6584 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<sigsuspend>(2), "
6585 "B<sigblock>(3), B<sigvec>(3), B<feature_test_macros>(7)"
6586 msgstr ""
6587
6588 #. type: TH
6589 #: build/C/man2/sigpending.2:27
6590 #, no-wrap
6591 msgid "SIGPENDING"
6592 msgstr ""
6593
6594 #. type: TH
6595 #: build/C/man2/sigpending.2:27
6596 #, no-wrap
6597 msgid "2008-10-04"
6598 msgstr ""
6599
6600 #. type: Plain text
6601 #: build/C/man2/sigpending.2:30
6602 msgid "sigpending - examine pending signals"
6603 msgstr ""
6604
6605 #. type: Plain text
6606 #: build/C/man2/sigpending.2:34
6607 msgid "B<int sigpending(sigset_t *>I<set>B<);>"
6608 msgstr ""
6609
6610 #. type: Plain text
6611 #: build/C/man2/sigpending.2:43
6612 msgid ""
6613 "B<sigpending>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
6614 "_POSIX_SOURCE"
6615 msgstr ""
6616
6617 #. type: Plain text
6618 #: build/C/man2/sigpending.2:51
6619 msgid ""
6620 "B<sigpending>()  returns the set of signals that are pending for delivery to "
6621 "the calling thread (i.e., the signals which have been raised while "
6622 "blocked).  The mask of pending signals is returned in I<set>."
6623 msgstr ""
6624
6625 #. type: Plain text
6626 #: build/C/man2/sigpending.2:54
6627 msgid "B<sigpending>()  returns 0 on success and -1 on error."
6628 msgstr ""
6629
6630 #. type: Plain text
6631 #: build/C/man2/sigpending.2:59
6632 msgid ""
6633 "I<set> points to memory which is not a valid part of the process address "
6634 "space."
6635 msgstr ""
6636
6637 #. type: Plain text
6638 #: build/C/man2/sigpending.2:70
6639 msgid ""
6640 "The set of signals that is pending for a thread is the union of the set of "
6641 "signals that is pending for that thread and the set of signals that is "
6642 "pending for the process as a whole; see B<signal>(7)."
6643 msgstr ""
6644
6645 #. type: Plain text
6646 #: build/C/man2/sigpending.2:82
6647 msgid ""
6648 "In versions of glibc up to and including 2.2.1, there is a bug in the "
6649 "wrapper function for B<sigpending>()  which means that information about "
6650 "pending real-time signals is not correctly returned."
6651 msgstr ""
6652
6653 #. type: Plain text
6654 #: build/C/man2/sigpending.2:90
6655 msgid ""
6656 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
6657 "B<sigsuspend>(2), B<sigsetops>(3), B<signal>(7)"
6658 msgstr ""
6659
6660 #. type: TH
6661 #: build/C/man2/sigprocmask.2:27
6662 #, no-wrap
6663 msgid "SIGPROCMASK"
6664 msgstr ""
6665
6666 #. type: TH
6667 #: build/C/man2/sigprocmask.2:27
6668 #, no-wrap
6669 msgid "2012-04-15"
6670 msgstr ""
6671
6672 #. type: Plain text
6673 #: build/C/man2/sigprocmask.2:30
6674 msgid "sigprocmask - examine and change blocked signals"
6675 msgstr ""
6676
6677 #. type: Plain text
6678 #: build/C/man2/sigprocmask.2:35
6679 msgid ""
6680 "B<int sigprocmask(int >I<how>B<, const sigset_t *>I<set>B<,> B<sigset_t "
6681 "*>I<oldset>B<);>"
6682 msgstr ""
6683
6684 #. type: Plain text
6685 #: build/C/man2/sigprocmask.2:44
6686 msgid ""
6687 "B<sigprocmask>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
6688 "_POSIX_SOURCE"
6689 msgstr ""
6690
6691 #. type: Plain text
6692 #: build/C/man2/sigprocmask.2:53
6693 msgid ""
6694 "B<sigprocmask>()  is used to fetch and/or change the signal mask of the "
6695 "calling thread.  The signal mask is the set of signals whose delivery is "
6696 "currently blocked for the caller (see also B<signal>(7)  for more details)."
6697 msgstr ""
6698
6699 #. type: Plain text
6700 #: build/C/man2/sigprocmask.2:57
6701 msgid "The behavior of the call is dependent on the value of I<how>, as follows."
6702 msgstr ""
6703
6704 #. type: TP
6705 #: build/C/man2/sigprocmask.2:57
6706 #, no-wrap
6707 msgid "B<SIG_BLOCK>"
6708 msgstr ""
6709
6710 #. type: Plain text
6711 #: build/C/man2/sigprocmask.2:62
6712 msgid ""
6713 "The set of blocked signals is the union of the current set and the I<set> "
6714 "argument."
6715 msgstr ""
6716
6717 #. type: TP
6718 #: build/C/man2/sigprocmask.2:62
6719 #, no-wrap
6720 msgid "B<SIG_UNBLOCK>"
6721 msgstr ""
6722
6723 #. type: Plain text
6724 #: build/C/man2/sigprocmask.2:68
6725 msgid ""
6726 "The signals in I<set> are removed from the current set of blocked signals.  "
6727 "It is permissible to attempt to unblock a signal which is not blocked."
6728 msgstr ""
6729
6730 #. type: TP
6731 #: build/C/man2/sigprocmask.2:68
6732 #, no-wrap
6733 msgid "B<SIG_SETMASK>"
6734 msgstr ""
6735
6736 #. type: Plain text
6737 #: build/C/man2/sigprocmask.2:72
6738 msgid "The set of blocked signals is set to the argument I<set>."
6739 msgstr ""
6740
6741 #. type: Plain text
6742 #: build/C/man2/sigprocmask.2:77
6743 msgid ""
6744 "If I<oldset> is non-NULL, the previous value of the signal mask is stored in "
6745 "I<oldset>."
6746 msgstr ""
6747
6748 #. type: Plain text
6749 #: build/C/man2/sigprocmask.2:86
6750 msgid ""
6751 "If I<set> is NULL, then the signal mask is unchanged (i.e., I<how> is "
6752 "ignored), but the current value of the signal mask is nevertheless returned "
6753 "in I<oldset> (if it is not NULL)."
6754 msgstr ""
6755
6756 #. type: Plain text
6757 #: build/C/man2/sigprocmask.2:91
6758 msgid ""
6759 "The use of B<sigprocmask>()  is unspecified in a multithreaded process; see "
6760 "B<pthread_sigmask>(3)."
6761 msgstr ""
6762
6763 #. type: Plain text
6764 #: build/C/man2/sigprocmask.2:94
6765 msgid "B<sigprocmask>()  returns 0 on success and -1 on error."
6766 msgstr ""
6767
6768 #. type: Plain text
6769 #: build/C/man2/sigprocmask.2:102
6770 msgid ""
6771 "the I<set> or I<oldset> argument points outside the process's allocated "
6772 "address space."
6773 msgstr ""
6774
6775 #. type: Plain text
6776 #: build/C/man2/sigprocmask.2:107
6777 msgid "The value specified in I<how> was invalid."
6778 msgstr ""
6779
6780 #. type: Plain text
6781 #: build/C/man2/sigprocmask.2:113
6782 msgid ""
6783 "It is not possible to block B<SIGKILL> or B<SIGSTOP>.  Attempts to do so are "
6784 "silently ignored."
6785 msgstr ""
6786
6787 #. type: Plain text
6788 #: build/C/man2/sigprocmask.2:115
6789 msgid "Each of the threads in a process has its own signal mask."
6790 msgstr ""
6791
6792 #. type: Plain text
6793 #: build/C/man2/sigprocmask.2:135
6794 msgid ""
6795 "If B<SIGBUS>, B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> are generated while they "
6796 "are blocked, the result is undefined, unless the signal was generated by "
6797 "B<kill>(2), B<sigqueue>(3), or B<raise>(3)."
6798 msgstr ""
6799
6800 #. type: Plain text
6801 #: build/C/man2/sigprocmask.2:150
6802 msgid ""
6803 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigpending>(2), "
6804 "B<sigsuspend>(2), B<pthread_sigmask>(3), B<sigqueue>(3), B<sigsetops>(3), "
6805 "B<signal>(7)"
6806 msgstr ""
6807
6808 #. type: TH
6809 #: build/C/man3/sigqueue.3:26
6810 #, no-wrap
6811 msgid "SIGQUEUE"
6812 msgstr ""
6813
6814 #. type: TH
6815 #: build/C/man3/sigqueue.3:26
6816 #, no-wrap
6817 msgid "2012-03-25"
6818 msgstr ""
6819
6820 #. type: Plain text
6821 #: build/C/man3/sigqueue.3:29
6822 msgid "sigqueue - queue a signal and data to a process"
6823 msgstr ""
6824
6825 #. type: Plain text
6826 #: build/C/man3/sigqueue.3:33
6827 msgid ""
6828 "B<int sigqueue(pid_t >I<pid>B<, int >I<sig>B<, const union sigval "
6829 ">I<value>B<);>"
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man3/sigqueue.3:41
6834 msgid "B<sigqueue>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
6835 msgstr ""
6836
6837 #. type: Plain text
6838 #: build/C/man3/sigqueue.3:53
6839 msgid ""
6840 "B<sigqueue>()  sends the signal specified in I<sig> to the process whose PID "
6841 "is given in I<pid>.  The permissions required to send a signal are the same "
6842 "as for B<kill>(2).  As with B<kill>(2), the null signal (0) can be used to "
6843 "check if a process with a given PID exists."
6844 msgstr ""
6845
6846 #. type: Plain text
6847 #: build/C/man3/sigqueue.3:58
6848 msgid ""
6849 "The I<value> argument is used to specify an accompanying item of data "
6850 "(either an integer or a pointer value) to be sent with the signal, and has "
6851 "the following type:"
6852 msgstr ""
6853
6854 #. type: Plain text
6855 #: build/C/man3/sigqueue.3:65
6856 #, no-wrap
6857 msgid ""
6858 "union sigval {\n"
6859 "    int   sival_int;\n"
6860 "    void *sival_ptr;\n"
6861 "};\n"
6862 msgstr ""
6863
6864 #. type: Plain text
6865 #: build/C/man3/sigqueue.3:81
6866 msgid ""
6867 "If the receiving process has installed a handler for this signal using the "
6868 "B<SA_SIGINFO> flag to B<sigaction>(2), then it can obtain this data via the "
6869 "I<si_value> field of the I<siginfo_t> structure passed as the second "
6870 "argument to the handler.  Furthermore, the I<si_code> field of that "
6871 "structure will be set to B<SI_QUEUE>."
6872 msgstr ""
6873
6874 #. type: Plain text
6875 #: build/C/man3/sigqueue.3:89
6876 msgid ""
6877 "On success, B<sigqueue>()  returns 0, indicating that the signal was "
6878 "successfully queued to the receiving process.  Otherwise -1 is returned and "
6879 "I<errno> is set to indicate the error."
6880 msgstr ""
6881
6882 #. type: Plain text
6883 #: build/C/man3/sigqueue.3:100
6884 msgid "I<sig> was invalid."
6885 msgstr ""
6886
6887 #. type: Plain text
6888 #: build/C/man3/sigqueue.3:106
6889 msgid ""
6890 "The process does not have permission to send the signal to the receiving "
6891 "process.  For the required permissions, see B<kill>(2)."
6892 msgstr ""
6893
6894 #. type: Plain text
6895 #: build/C/man3/sigqueue.3:110
6896 msgid "No process has a PID matching I<pid>."
6897 msgstr ""
6898
6899 #. type: Plain text
6900 #: build/C/man3/sigqueue.3:112
6901 msgid "This system call first appeared in Linux 2.2."
6902 msgstr ""
6903
6904 #. type: Plain text
6905 #: build/C/man3/sigqueue.3:122
6906 msgid ""
6907 "If this function results in the sending of a signal to the process that "
6908 "invoked it, and that signal was not blocked by the calling thread, and no "
6909 "other threads were willing to handle this signal (either by having it "
6910 "unblocked, or by waiting for it using B<sigwait>(3)), then at least some "
6911 "signal must be delivered to this thread before this function returns."
6912 msgstr ""
6913
6914 #. type: Plain text
6915 #: build/C/man3/sigqueue.3:137
6916 msgid ""
6917 "On Linux, this function is implemented using the B<rt_sigqueueinfo>(2)  "
6918 "system call.  The system call differs in its third argument, which is the "
6919 "I<siginfo_t> structure that will be supplied to the receiving process's "
6920 "signal handler or returned by the receiving process's B<sigtimedwait>(2)  "
6921 "call.  Inside the glibc B<sigqueue>()  wrapper, this argument, I<uinfo>, is "
6922 "initialized as follows:"
6923 msgstr ""
6924
6925 #. type: Plain text
6926 #: build/C/man3/sigqueue.3:145
6927 #, no-wrap
6928 msgid ""
6929 "uinfo.si_signo = sig;      /* argument supplied to sigqueue() */\n"
6930 "uinfo.si_code = SI_QUEUE;\n"
6931 "uinfo.si_pid = getpid();   /* Process ID of sender */\n"
6932 "uinfo.si_uid = getuid();   /* Real UID of sender */\n"
6933 "uinfo.si_value = val;      /* argument supplied to sigqueue() */\n"
6934 msgstr ""
6935
6936 #. type: Plain text
6937 #: build/C/man3/sigqueue.3:155
6938 msgid ""
6939 "B<kill>(2), B<rt_sigqueueinfo>(2), B<sigaction>(2), B<signal>(2), "
6940 "B<pthread_sigqueue>(3), B<sigwait>(3), B<signal>(7)"
6941 msgstr ""
6942
6943 #. type: TH
6944 #: build/C/man2/sigreturn.2:27
6945 #, no-wrap
6946 msgid "SIGRETURN"
6947 msgstr ""
6948
6949 #. type: TH
6950 #: build/C/man2/sigreturn.2:27
6951 #, no-wrap
6952 msgid "2008-06-26"
6953 msgstr ""
6954
6955 #. type: Plain text
6956 #: build/C/man2/sigreturn.2:30
6957 msgid "sigreturn - return from signal handler and cleanup stack frame"
6958 msgstr ""
6959
6960 #. type: Plain text
6961 #: build/C/man2/sigreturn.2:32
6962 msgid "B<int sigreturn(unsigned long >I<__unused>B<);>"
6963 msgstr ""
6964
6965 #. type: Plain text
6966 #: build/C/man2/sigreturn.2:40
6967 msgid ""
6968 "When the Linux kernel creates the stack frame for a signal handler, a call "
6969 "to B<sigreturn>()  is inserted into the stack frame so that upon return from "
6970 "the signal handler, B<sigreturn>()  will be called."
6971 msgstr ""
6972
6973 #. type: Plain text
6974 #: build/C/man2/sigreturn.2:51
6975 msgid ""
6976 "This B<sigreturn>()  call undoes everything that was done\\(emchanging the "
6977 "process's signal mask, switching stacks (see B<sigaltstack>(2))\\(emin order "
6978 "to invoke the signal handler: it restores the process's signal mask, "
6979 "switches stacks, and restores the process's context (registers, processor "
6980 "flags), so that the process directly resumes execution at the point where it "
6981 "was interrupted by the signal."
6982 msgstr ""
6983
6984 #. type: Plain text
6985 #: build/C/man2/sigreturn.2:54
6986 msgid "B<sigreturn>()  never returns."
6987 msgstr ""
6988
6989 #. type: SH
6990 #: build/C/man2/sigreturn.2:54
6991 #, no-wrap
6992 msgid "FILES"
6993 msgstr ""
6994
6995 #. type: Plain text
6996 #: build/C/man2/sigreturn.2:56
6997 msgid "/usr/src/linux/arch/i386/kernel/signal.c"
6998 msgstr ""
6999
7000 #. type: Plain text
7001 #: build/C/man2/sigreturn.2:58
7002 msgid "/usr/src/linux/arch/alpha/kernel/entry.S"
7003 msgstr ""
7004
7005 #. type: Plain text
7006 #: build/C/man2/sigreturn.2:62
7007 msgid ""
7008 "B<sigreturn>()  is specific to Linux and should not be used in programs "
7009 "intended to be portable."
7010 msgstr ""
7011
7012 #. type: Plain text
7013 #: build/C/man2/sigreturn.2:72
7014 msgid ""
7015 "The B<sigreturn>()  call is used by the kernel to implement signal "
7016 "handlers.  It should B<never> be called directly.  Better yet, the specific "
7017 "use of the I<__unused> argument varies depending on the architecture."
7018 msgstr ""
7019
7020 #. type: Plain text
7021 #: build/C/man2/sigreturn.2:77
7022 msgid "B<kill>(2), B<sigaltstack>(2), B<signal>(2), B<signal>(7)"
7023 msgstr ""
7024
7025 #. type: TH
7026 #: build/C/man3/sigset.3:24
7027 #, no-wrap
7028 msgid "SIGSET"
7029 msgstr ""
7030
7031 #. type: Plain text
7032 #: build/C/man3/sigset.3:27
7033 msgid "sigset, sighold, sigrelse, sigignore - System V signal API"
7034 msgstr ""
7035
7036 #. type: Plain text
7037 #: build/C/man3/sigset.3:33
7038 msgid "B<sighandler_t sigset(int >I<sig>B<, sighandler_t >I<disp>B<);>"
7039 msgstr ""
7040
7041 #. type: Plain text
7042 #: build/C/man3/sigset.3:35
7043 msgid "B<int sighold(int >I<sig>B<);>"
7044 msgstr ""
7045
7046 #. type: Plain text
7047 #: build/C/man3/sigset.3:37
7048 msgid "B<int sigrelse(int >I<sig>B<);>"
7049 msgstr ""
7050
7051 #. type: Plain text
7052 #: build/C/man3/sigset.3:39
7053 msgid "B<int sigignore(int >I<sig>B<);>"
7054 msgstr ""
7055
7056 #. type: Plain text
7057 #: build/C/man3/sigset.3:50
7058 msgid "B<sigset>(), B<sighold>(), B<sigrelse>(), B<sigignore>():"
7059 msgstr ""
7060
7061 #. type: Plain text
7062 #: build/C/man3/sigset.3:54
7063 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
7064 msgstr ""
7065
7066 #. type: Plain text
7067 #: build/C/man3/sigset.3:63
7068 msgid ""
7069 "These functions are provided in glibc as a compatibility interface for "
7070 "programs that make use of the historical System V signal API.  This API is "
7071 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
7072 "B<sigprocmask>(2), etc.)"
7073 msgstr ""
7074
7075 #. type: Plain text
7076 #: build/C/man3/sigset.3:72
7077 msgid ""
7078 "The B<sigset>()  function modifies the disposition of the signal I<sig>.  "
7079 "The I<disp> argument can be the address of a signal handler function, or one "
7080 "of the following constants:"
7081 msgstr ""
7082
7083 #. type: TP
7084 #: build/C/man3/sigset.3:72
7085 #, no-wrap
7086 msgid "B<SIG_DFL>"
7087 msgstr ""
7088
7089 #. type: Plain text
7090 #: build/C/man3/sigset.3:77
7091 msgid "Reset the disposition of I<sig> to the default."
7092 msgstr ""
7093
7094 #. type: TP
7095 #: build/C/man3/sigset.3:77
7096 #, no-wrap
7097 msgid "B<SIG_IGN>"
7098 msgstr ""
7099
7100 #. type: Plain text
7101 #: build/C/man3/sigset.3:81
7102 msgid "Ignore I<sig>."
7103 msgstr ""
7104
7105 #. type: TP
7106 #: build/C/man3/sigset.3:81
7107 #, no-wrap
7108 msgid "B<SIG_HOLD>"
7109 msgstr ""
7110
7111 #. type: Plain text
7112 #: build/C/man3/sigset.3:88
7113 msgid ""
7114 "Add I<sig> to the process's signal mask, but leave the disposition of I<sig> "
7115 "unchanged."
7116 msgstr ""
7117
7118 #. type: Plain text
7119 #: build/C/man3/sigset.3:94
7120 msgid ""
7121 "If I<disp> specifies the address of a signal handler, then I<sig> is added "
7122 "to the process's signal mask during execution of the handler."
7123 msgstr ""
7124
7125 #. type: Plain text
7126 #: build/C/man3/sigset.3:102
7127 msgid ""
7128 "If I<disp> was specified as a value other than B<SIG_HOLD>, then I<sig> is "
7129 "removed from the process's signal mask."
7130 msgstr ""
7131
7132 #. type: Plain text
7133 #: build/C/man3/sigset.3:108 build/C/man3/sigvec.3:85
7134 msgid "The dispositions for B<SIGKILL> and B<SIGSTOP> cannot be changed."
7135 msgstr ""
7136
7137 #. type: Plain text
7138 #: build/C/man3/sigset.3:114
7139 msgid "The B<sighold>()  function adds I<sig> to the calling process's signal mask."
7140 msgstr ""
7141
7142 #. type: Plain text
7143 #: build/C/man3/sigset.3:120
7144 msgid ""
7145 "The B<sigrelse>()  function removes I<sig> from the calling process's signal "
7146 "mask."
7147 msgstr ""
7148
7149 #. type: Plain text
7150 #: build/C/man3/sigset.3:127
7151 msgid "The B<sigignore>()  function sets the disposition of I<sig> to B<SIG_IGN>."
7152 msgstr ""
7153
7154 #. type: Plain text
7155 #: build/C/man3/sigset.3:143
7156 msgid ""
7157 "On success, B<sigset>()  returns B<SIG_HOLD> if I<sig> was blocked before "
7158 "the call, or the signal's previous disposition if it was not blocked before "
7159 "the call.  On error, B<sigset>()  returns -1, with I<errno> set to indicate "
7160 "the error.  (But see BUGS below.)"
7161 msgstr ""
7162
7163 #. type: Plain text
7164 #: build/C/man3/sigset.3:152
7165 msgid ""
7166 "The B<sighold>(), B<sigrelse>(), and B<sigignore>()  functions return 0 on "
7167 "success; on error, these functions return -1 and set I<errno> to indicate "
7168 "the error."
7169 msgstr ""
7170
7171 #. type: Plain text
7172 #: build/C/man3/sigset.3:159
7173 msgid ""
7174 "For B<sigset>()  see the ERRORS under B<sigaction>(2)  and "
7175 "B<sigprocmask>(2)."
7176 msgstr ""
7177
7178 #. type: Plain text
7179 #: build/C/man3/sigset.3:166
7180 msgid "For B<sighold>()  and B<sigrelse>()  see the ERRORS under B<sigprocmask>(2)."
7181 msgstr ""
7182
7183 #. type: Plain text
7184 #: build/C/man3/sigset.3:171
7185 msgid "For B<sigignore>(), see the errors under B<sigaction>(2)."
7186 msgstr ""
7187
7188 #. type: Plain text
7189 #: build/C/man3/sigset.3:188
7190 msgid ""
7191 "SVr4, POSIX.1-2001.  These functions are obsolete: do not use them in new "
7192 "programs.  POSIX.1-2008 marks B<sighold>(), B<sigignore>(), B<sigpause>(), "
7193 "B<sigrelse>(), and B<sigset>()  as obsolete, recommending the use of "
7194 "B<sigaction>(2), B<sigprocmask>(2), B<pthread_sigmask>(3), and "
7195 "B<sigsuspend>(2)  instead."
7196 msgstr ""
7197
7198 #. type: Plain text
7199 #: build/C/man3/sigset.3:190
7200 msgid "These functions appeared in glibc version 2.1."
7201 msgstr ""
7202
7203 #. type: Plain text
7204 #: build/C/man3/sigset.3:196
7205 msgid ""
7206 "The I<sighandler_t> type is a GNU extension; it is only used on this page to "
7207 "make the B<sigset>()  prototype more easily readable."
7208 msgstr ""
7209
7210 #. type: Plain text
7211 #: build/C/man3/sigset.3:204
7212 msgid ""
7213 "The B<sigset>()  function provides reliable signal handling semantics (as "
7214 "when calling B<sigaction>(2)  with I<sa_mask> equal to 0)."
7215 msgstr ""
7216
7217 #. type: Plain text
7218 #: build/C/man3/sigset.3:222
7219 msgid ""
7220 "On System V, the B<signal>()  function provides unreliable semantics (as "
7221 "when calling B<sigaction>(2)  with I<sa_mask> equal to I<SA_RESETHAND | "
7222 "SA_NODEFER>).  On BSD, B<signal>()  provides reliable semantics.  "
7223 "POSIX.1-2001 leaves these aspects of B<signal>()  unspecified.  See "
7224 "B<signal>(2)  for further details."
7225 msgstr ""
7226
7227 #. type: Plain text
7228 #: build/C/man3/sigset.3:230 build/C/man3/sigvec.3:250
7229 msgid ""
7230 "In order to wait for a signal, BSD and System V both provided a function "
7231 "named B<sigpause>(3), but this function has a different argument on the two "
7232 "systems.  See B<sigpause>(3)  for details."
7233 msgstr ""
7234
7235 #. type: Plain text
7236 #: build/C/man3/sigset.3:239
7237 msgid ""
7238 "In versions of glibc before 2.2, B<sigset>()  did not unblock I<sig> if "
7239 "I<disp> was specified as a value other than B<SIG_HOLD>."
7240 msgstr ""
7241
7242 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
7243 #. type: Plain text
7244 #: build/C/man3/sigset.3:264
7245 msgid ""
7246 "In versions of glibc before 2.5, B<sigset>()  does not correctly return the "
7247 "previous disposition of the signal in two cases.  First, if I<disp> is "
7248 "specified as B<SIG_HOLD>, then a successful B<sigset>()  always returns "
7249 "B<SIG_HOLD>.  Instead, it should return the previous disposition of the "
7250 "signal (unless the signal was blocked, in which case B<SIG_HOLD> should be "
7251 "returned).  Second, if the signal is currently blocked, then the return "
7252 "value of a successful B<sigset>()  should be B<SIG_HOLD>.  Instead, the "
7253 "previous disposition of the signal is returned.  These problems have been "
7254 "fixed since glibc 2.5."
7255 msgstr ""
7256
7257 #. type: Plain text
7258 #: build/C/man3/sigset.3:274
7259 msgid ""
7260 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7261 "B<raise>(3), B<sigpause>(3), B<sigvec>(3), B<signal>(7)"
7262 msgstr ""
7263
7264 #. type: TH
7265 #: build/C/man3/sigsetops.3:29
7266 #, no-wrap
7267 msgid "SIGSETOPS"
7268 msgstr ""
7269
7270 #. type: TH
7271 #: build/C/man3/sigsetops.3:29
7272 #, no-wrap
7273 msgid "2008-09-01"
7274 msgstr ""
7275
7276 #. type: Plain text
7277 #: build/C/man3/sigsetops.3:33
7278 msgid ""
7279 "sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX signal "
7280 "set operations."
7281 msgstr ""
7282
7283 #. type: Plain text
7284 #: build/C/man3/sigsetops.3:37
7285 msgid "B<int sigemptyset(sigset_t *>I<set>B<);>"
7286 msgstr ""
7287
7288 #. type: Plain text
7289 #: build/C/man3/sigsetops.3:39
7290 msgid "B<int sigfillset(sigset_t *>I<set>B<);>"
7291 msgstr ""
7292
7293 #. type: Plain text
7294 #: build/C/man3/sigsetops.3:41
7295 msgid "B<int sigaddset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7296 msgstr ""
7297
7298 #. type: Plain text
7299 #: build/C/man3/sigsetops.3:43
7300 msgid "B<int sigdelset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7301 msgstr ""
7302
7303 #. type: Plain text
7304 #: build/C/man3/sigsetops.3:45
7305 msgid "B<int sigismember(const sigset_t *>I<set>B<, int >I<signum>B<);>"
7306 msgstr ""
7307
7308 #. type: Plain text
7309 #: build/C/man3/sigsetops.3:57
7310 msgid ""
7311 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), B<sigdelset>(), "
7312 "B<sigismember>():"
7313 msgstr ""
7314
7315 #. type: Plain text
7316 #: build/C/man3/sigsetops.3:59
7317 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
7318 msgstr ""
7319
7320 #. type: Plain text
7321 #: build/C/man3/sigsetops.3:63
7322 msgid "These functions allow the manipulation of POSIX signal sets."
7323 msgstr ""
7324
7325 #. type: Plain text
7326 #: build/C/man3/sigsetops.3:68
7327 msgid ""
7328 "B<sigemptyset>()  initializes the signal set given by I<set> to empty, with "
7329 "all signals excluded from the set."
7330 msgstr ""
7331
7332 #. type: Plain text
7333 #: build/C/man3/sigsetops.3:73
7334 msgid "B<sigfillset>()  initializes I<set> to full, including all signals."
7335 msgstr ""
7336
7337 #. type: Plain text
7338 #: build/C/man3/sigsetops.3:81
7339 msgid ""
7340 "B<sigaddset>()  and B<sigdelset>()  add and delete respectively signal "
7341 "I<signum> from I<set>."
7342 msgstr ""
7343
7344 #. type: Plain text
7345 #: build/C/man3/sigsetops.3:87
7346 msgid "B<sigismember>()  tests whether I<signum> is a member of I<set>."
7347 msgstr ""
7348
7349 #. type: Plain text
7350 #: build/C/man3/sigsetops.3:105
7351 msgid ""
7352 "Objects of type I<sigset_t> must be initialized by a call to either "
7353 "B<sigemptyset>()  or B<sigfillset>()  before being passed to the functions "
7354 "B<sigaddset>(), B<sigdelset>()  and B<sigismember>()  or the additional "
7355 "glibc functions described below (B<sigisemptyset>(), B<sigandset>(), and "
7356 "B<sigorset>()).  The results are undefined if this is not done."
7357 msgstr ""
7358
7359 #. type: Plain text
7360 #: build/C/man3/sigsetops.3:112
7361 msgid ""
7362 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), and B<sigdelset>()  "
7363 "return 0 on success and -1 on error."
7364 msgstr ""
7365
7366 #. type: Plain text
7367 #: build/C/man3/sigsetops.3:121
7368 msgid ""
7369 "B<sigismember>()  returns 1 if I<signum> is a member of I<set>, 0 if "
7370 "I<signum> is not a member, and -1 on error."
7371 msgstr ""
7372
7373 #. type: Plain text
7374 #: build/C/man3/sigsetops.3:126
7375 msgid "I<sig> is not a valid signal."
7376 msgstr ""
7377
7378 #. type: SS
7379 #: build/C/man3/sigsetops.3:129
7380 #, no-wrap
7381 msgid "Glibc Notes"
7382 msgstr ""
7383
7384 #. type: Plain text
7385 #: build/C/man3/sigsetops.3:135
7386 msgid ""
7387 "If the B<_GNU_SOURCE> feature test macro is defined, then "
7388 "I<E<lt>signal.hE<gt>> exposes three other functions for manipulating signal "
7389 "sets."
7390 msgstr ""
7391
7392 #. type: TP
7393 #: build/C/man3/sigsetops.3:135
7394 #, no-wrap
7395 msgid "B<int sigisemptyset(sigset_t *>I<set>B<);>"
7396 msgstr ""
7397
7398 #. type: Plain text
7399 #: build/C/man3/sigsetops.3:140
7400 msgid "returns 1 if I<set> contains no signals, and 0 otherwise."
7401 msgstr ""
7402
7403 #. type: TP
7404 #: build/C/man3/sigsetops.3:140
7405 #, no-wrap
7406 msgid ""
7407 "B<int sigorset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7408 "*>I<right>B<);>"
7409 msgstr ""
7410
7411 #. type: Plain text
7412 #: build/C/man3/sigsetops.3:149
7413 msgid "places the union of the sets I<left> and I<right> in I<dest>."
7414 msgstr ""
7415
7416 #. type: TP
7417 #: build/C/man3/sigsetops.3:149
7418 #, no-wrap
7419 msgid ""
7420 "B<int sigandset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7421 "*>I<right>B<);>"
7422 msgstr ""
7423
7424 #. type: Plain text
7425 #: build/C/man3/sigsetops.3:158
7426 msgid "places the intersection of the sets I<left> and I<right> in I<dest>."
7427 msgstr ""
7428
7429 #. type: Plain text
7430 #: build/C/man3/sigsetops.3:163
7431 msgid "B<sigorset>()  and B<sigandset>()  return 0 on success, and -1 on failure."
7432 msgstr ""
7433
7434 #. type: Plain text
7435 #: build/C/man3/sigsetops.3:166
7436 msgid ""
7437 "These functions are nonstandard (a few other systems provide similar "
7438 "functions) and their use should be avoided in portable applications."
7439 msgstr ""
7440
7441 #. type: Plain text
7442 #: build/C/man3/sigsetops.3:171
7443 msgid "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<sigsuspend>(2)"
7444 msgstr ""
7445
7446 #. type: TH
7447 #: build/C/man2/sigsuspend.2:27
7448 #, no-wrap
7449 msgid "SIGSUSPEND"
7450 msgstr ""
7451
7452 #. type: TH
7453 #: build/C/man2/sigsuspend.2:27
7454 #, no-wrap
7455 msgid "2008-08-29"
7456 msgstr ""
7457
7458 #. type: Plain text
7459 #: build/C/man2/sigsuspend.2:30
7460 msgid "sigsuspend - wait for a signal"
7461 msgstr ""
7462
7463 #. type: Plain text
7464 #: build/C/man2/sigsuspend.2:34
7465 msgid "B<int sigsuspend(const sigset_t *>I<mask>B<);>"
7466 msgstr ""
7467
7468 #. type: Plain text
7469 #: build/C/man2/sigsuspend.2:43
7470 msgid ""
7471 "B<sigsuspend>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7472 "_POSIX_SOURCE"
7473 msgstr ""
7474
7475 #. type: Plain text
7476 #: build/C/man2/sigsuspend.2:51
7477 msgid ""
7478 "B<sigsuspend>()  temporarily replaces the signal mask of the calling process "
7479 "with the mask given by I<mask> and then suspends the process until delivery "
7480 "of a signal whose action is to invoke a signal handler or to terminate a "
7481 "process."
7482 msgstr ""
7483
7484 #. type: Plain text
7485 #: build/C/man2/sigsuspend.2:60
7486 msgid ""
7487 "If the signal terminates the process, then B<sigsuspend>()  does not "
7488 "return.  If the signal is caught, then B<sigsuspend>()  returns after the "
7489 "signal handler returns, and the signal mask is restored to the state before "
7490 "the call to B<sigsuspend>()."
7491 msgstr ""
7492
7493 #. type: Plain text
7494 #: build/C/man2/sigsuspend.2:68
7495 msgid ""
7496 "It is not possible to block B<SIGKILL> or B<SIGSTOP>; specifying these "
7497 "signals in I<mask>, has no effect on the process's signal mask."
7498 msgstr ""
7499
7500 #. type: Plain text
7501 #: build/C/man2/sigsuspend.2:72
7502 msgid "B<sigsuspend>()  always returns -1, normally with the error B<EINTR>."
7503 msgstr ""
7504
7505 #. type: Plain text
7506 #: build/C/man2/sigsuspend.2:77
7507 msgid ""
7508 "I<mask> points to memory which is not a valid part of the process address "
7509 "space."
7510 msgstr ""
7511
7512 #. type: Plain text
7513 #: build/C/man2/sigsuspend.2:80
7514 msgid "The call was interrupted by a signal."
7515 msgstr ""
7516
7517 #. type: Plain text
7518 #: build/C/man2/sigsuspend.2:100
7519 msgid ""
7520 "Normally, B<sigsuspend>()  is used in conjunction with B<sigprocmask>(2)  in "
7521 "order to prevent delivery of a signal during the execution of a critical "
7522 "code section.  The caller first blocks the signals with B<sigprocmask>(2).  "
7523 "When the critical code has completed, the caller then waits for the signals "
7524 "by calling B<sigsuspend>()  with the signal mask that was returned by "
7525 "B<sigprocmask>(2)  (in the I<oldset> argument)."
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man2/sigsuspend.2:114
7530 msgid ""
7531 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7532 "B<sigwaitinfo>(2), B<sigsetops>(3), B<sigwait>(3), B<signal>(7)"
7533 msgstr ""
7534
7535 #. type: TH
7536 #: build/C/man3/sigvec.3:24
7537 #, no-wrap
7538 msgid "SIGVEC"
7539 msgstr ""
7540
7541 #. type: Plain text
7542 #: build/C/man3/sigvec.3:27
7543 msgid "sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal API"
7544 msgstr ""
7545
7546 #. type: Plain text
7547 #: build/C/man3/sigvec.3:31
7548 msgid ""
7549 "B<int sigvec(int >I<sig>B<, struct sigvec *>I<vec>B<, struct sigvec "
7550 "*>I<ovec>B<);>"
7551 msgstr ""
7552
7553 #. type: Plain text
7554 #: build/C/man3/sigvec.3:33
7555 msgid "B<int sigmask(int >I<signum>B<);>"
7556 msgstr ""
7557
7558 #. type: Plain text
7559 #: build/C/man3/sigvec.3:35
7560 msgid "B<int sigblock(int >I<mask>B<);>"
7561 msgstr ""
7562
7563 #. type: Plain text
7564 #: build/C/man3/sigvec.3:37
7565 msgid "B<int sigsetmask(int >I<mask>B<);>"
7566 msgstr ""
7567
7568 #. type: Plain text
7569 #: build/C/man3/sigvec.3:39
7570 msgid "B<int siggetmask(void);>"
7571 msgstr ""
7572
7573 #. type: Plain text
7574 #: build/C/man3/sigvec.3:47
7575 msgid "All functions shown above: _BSD_SOURCE"
7576 msgstr ""
7577
7578 #. type: Plain text
7579 #: build/C/man3/sigvec.3:54
7580 msgid ""
7581 "These functions are provided in glibc as a compatibility interface for "
7582 "programs that make use of the historical BSD signal API.  This API is "
7583 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
7584 "B<sigprocmask>(2), etc.)"
7585 msgstr ""
7586
7587 #. type: Plain text
7588 #: build/C/man3/sigvec.3:79
7589 msgid ""
7590 "The B<sigvec>()  function sets and/or gets the disposition of the signal "
7591 "I<sig> (like the POSIX B<sigaction>(2)).  If I<vec> is not NULL, it points "
7592 "to a I<sigvec> structure that defines the new disposition for I<sig>.  If "
7593 "I<ovec> is not NULL, it points to a I<sigvec> structure that is used to "
7594 "return the previous disposition of I<sig>.  To obtain the current "
7595 "disposition of I<sig> without changing it, specify NULL for I<vec>, and a "
7596 "non-NULL pointer for I<ovec>."
7597 msgstr ""
7598
7599 #. type: Plain text
7600 #: build/C/man3/sigvec.3:89
7601 msgid "The I<sigvec> structure has the following form:"
7602 msgstr ""
7603
7604 #. type: Plain text
7605 #: build/C/man3/sigvec.3:97
7606 #, no-wrap
7607 msgid ""
7608 "struct sigvec {\n"
7609 "    void (*sv_handler)();  /* Signal disposition */\n"
7610 "    int    sv_mask;        /* Signals to be blocked in handler */\n"
7611 "    int    sv_flags;       /* Flags */\n"
7612 "};\n"
7613 msgstr ""
7614
7615 #. type: Plain text
7616 #: build/C/man3/sigvec.3:108
7617 msgid ""
7618 "The I<sv_handler> field specifies the disposition of the signal, and is "
7619 "either: the address of a signal handler function; or B<SIG_DFL> meaning the "
7620 "default disposition applies for the signal; or B<SIG_IGN> meaning that the "
7621 "signal is ignored."
7622 msgstr ""
7623
7624 #. type: Plain text
7625 #: build/C/man3/sigvec.3:122
7626 msgid ""
7627 "If I<sv_handler> specifies the address of a signal handler, then I<sv_mask> "
7628 "specifies a mask of signals that are to be blocked while the handler is "
7629 "executing.  In addition, the signal for which the handler is invoked is also "
7630 "blocked by default.  Attempts to block B<SIGKILL> or B<SIGSTOP> are silently "
7631 "ignored."
7632 msgstr ""
7633
7634 #. type: Plain text
7635 #: build/C/man3/sigvec.3:129
7636 msgid ""
7637 "If I<sv_handler> specifies the address of a signal handler, then the "
7638 "I<sv_flags> field specifies flags controlling what happens when the handler "
7639 "is called.  This field may contain zero or more of the following flags:"
7640 msgstr ""
7641
7642 #. type: TP
7643 #: build/C/man3/sigvec.3:129
7644 #, no-wrap
7645 msgid "B<SV_INTERRUPT>"
7646 msgstr ""
7647
7648 #. type: Plain text
7649 #: build/C/man3/sigvec.3:137
7650 msgid ""
7651 "If the signal handler interrupts a blocking system call, then upon return "
7652 "from the handler the system call will not be restarted: instead it will fail "
7653 "with the error B<EINTR>.  If this flag is not specified, then system calls "
7654 "are restarted by default."
7655 msgstr ""
7656
7657 #. type: TP
7658 #: build/C/man3/sigvec.3:137
7659 #, no-wrap
7660 msgid "B<SV_RESETHAND>"
7661 msgstr ""
7662
7663 #. type: Plain text
7664 #: build/C/man3/sigvec.3:146
7665 msgid ""
7666 "Reset the disposition of the signal to the default before calling the signal "
7667 "handler.  If this flag is not specified, then the handler remains "
7668 "established until explicitly removed by a later call to B<sigvec>()  or "
7669 "until the process performs an B<execve>(2)."
7670 msgstr ""
7671
7672 #. type: TP
7673 #: build/C/man3/sigvec.3:146
7674 #, no-wrap
7675 msgid "B<SV_ONSTACK>"
7676 msgstr ""
7677
7678 #. type: Plain text
7679 #: build/C/man3/sigvec.3:153
7680 msgid ""
7681 "Handle the signal on the alternate signal stack (historically established "
7682 "under BSD using the obsolete B<sigstack>()  function; the POSIX replacement "
7683 "is B<sigaltstack>(2))."
7684 msgstr ""
7685
7686 #. type: Plain text
7687 #: build/C/man3/sigvec.3:163
7688 msgid ""
7689 "The B<sigmask>()  function constructs and returns a \"signal mask\" for "
7690 "I<signum>.  For example, we can initialize the I<vec.sv_mask> field given to "
7691 "B<sigvec>()  using code such as the following:"
7692 msgstr ""
7693
7694 #. type: Plain text
7695 #: build/C/man3/sigvec.3:168
7696 #, no-wrap
7697 msgid ""
7698 "    vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT);\n"
7699 "                /* Block SIGQUIT and SIGABRT during\n"
7700 "                   handler execution */\n"
7701 msgstr ""
7702
7703 #. type: Plain text
7704 #: build/C/man3/sigvec.3:183
7705 msgid ""
7706 "The B<sigblock>()  function adds the signals in I<mask> to the process's "
7707 "signal mask (like POSIX I<sigprocmask(SIG_BLOCK)>), and returns the "
7708 "process's previous signal mask.  Attempts to block B<SIGKILL> or B<SIGSTOP> "
7709 "are silently ignored."
7710 msgstr ""
7711
7712 #. type: Plain text
7713 #: build/C/man3/sigvec.3:191
7714 msgid ""
7715 "The B<sigsetmask>()  function sets the process's signal mask to the value "
7716 "given in I<mask> (like POSIX I<sigprocmask(SIG_SETMASK)>), and returns the "
7717 "process's previous signal mask."
7718 msgstr ""
7719
7720 #. type: Plain text
7721 #: build/C/man3/sigvec.3:197
7722 msgid ""
7723 "The B<siggetmask>()  function returns the process's current signal mask.  "
7724 "This call is equivalent to I<sigblock(0)>."
7725 msgstr ""
7726
7727 #. type: Plain text
7728 #: build/C/man3/sigvec.3:203
7729 msgid ""
7730 "The B<sigvec>()  function returns 0 on success; on error, it returns -1 and "
7731 "sets I<errno> to indicate the error."
7732 msgstr ""
7733
7734 #. type: Plain text
7735 #: build/C/man3/sigvec.3:209
7736 msgid ""
7737 "The B<sigblock>()  and B<sigsetmask>()  functions return the previous signal "
7738 "mask."
7739 msgstr ""
7740
7741 #. type: Plain text
7742 #: build/C/man3/sigvec.3:214
7743 msgid "The B<sigmask>()  function returns the signal mask for I<signum>."
7744 msgstr ""
7745
7746 #. type: Plain text
7747 #: build/C/man3/sigvec.3:219
7748 msgid "See the ERRORS under B<sigaction>(2)  and B<sigprocmask>(2)."
7749 msgstr ""
7750
7751 #. type: Plain text
7752 #: build/C/man3/sigvec.3:225
7753 msgid ""
7754 "All of these functions were in 4.3BSD, except B<siggetmask>(), whose origin "
7755 "is unclear.  These functions are obsolete: do not use them in new programs."
7756 msgstr ""
7757
7758 #. type: Plain text
7759 #: build/C/man3/sigvec.3:242
7760 msgid ""
7761 "On 4.3BSD, the B<signal>()  function provided reliable semantics (as when "
7762 "calling B<sigvec>()  with I<vec.sv_mask> equal to 0).  On System V, "
7763 "B<signal>()  provides unreliable semantics.  POSIX.1-2001 leaves these "
7764 "aspects of B<signal>()  unspecified.  See B<signal>(2)  for further details."
7765 msgstr ""
7766
7767 #. type: Plain text
7768 #: build/C/man3/sigvec.3:260
7769 msgid ""
7770 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7771 "B<raise>(3), B<sigpause>(3), B<sigset>(3), B<signal>(7)"
7772 msgstr ""
7773
7774 #. type: TH
7775 #: build/C/man3/sigwait.3:24
7776 #, no-wrap
7777 msgid "SIGWAIT"
7778 msgstr ""
7779
7780 #. type: TH
7781 #: build/C/man3/sigwait.3:24
7782 #, no-wrap
7783 msgid "2010-09-10"
7784 msgstr ""
7785
7786 #. type: Plain text
7787 #: build/C/man3/sigwait.3:27
7788 msgid "sigwait - wait for a signal"
7789 msgstr ""
7790
7791 #. type: Plain text
7792 #: build/C/man3/sigwait.3:32
7793 #, no-wrap
7794 msgid "B< int sigwait(const sigset_t *>I<set>B<, int *>I<sig>B<);>\n"
7795 msgstr ""
7796
7797 #. type: Plain text
7798 #: build/C/man3/sigwait.3:42
7799 msgid "B<sigwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
7800 msgstr ""
7801
7802 #. type: Plain text
7803 #: build/C/man3/sigwait.3:53
7804 msgid ""
7805 "The B<sigwait>()  function suspends execution of the calling thread until "
7806 "the delivery of one of the signals specified in the signal set I<set>.  The "
7807 "function accepts the signal (removes it from the pending list of signals), "
7808 "and returns the signal number in I<sig>."
7809 msgstr ""
7810
7811 #. type: Plain text
7812 #: build/C/man3/sigwait.3:59
7813 msgid ""
7814 "The operation of B<sigwait>()  is the same as B<sigwaitinfo>(2), except "
7815 "that:"
7816 msgstr ""
7817
7818 #. type: Plain text
7819 #: build/C/man3/sigwait.3:64
7820 msgid ""
7821 "B<sigwait>()  only returns the signal number, rather than a I<siginfo_t> "
7822 "structure describing the signal."
7823 msgstr ""
7824
7825 #. type: Plain text
7826 #: build/C/man3/sigwait.3:66
7827 msgid "The return values of the two functions are different."
7828 msgstr ""
7829
7830 #. type: Plain text
7831 #: build/C/man3/sigwait.3:71
7832 msgid ""
7833 "On success, B<sigwait>()  returns 0.  On error, it returns a positive error "
7834 "number (listed in ERRORS)."
7835 msgstr ""
7836
7837 #.  Does not occur for glibc.
7838 #. type: Plain text
7839 #: build/C/man3/sigwait.3:77
7840 msgid "I<set> contains an invalid signal number."
7841 msgstr ""
7842
7843 #. type: Plain text
7844 #: build/C/man3/sigwait.3:83
7845 msgid "B<sigwait>()  is implemented using B<sigtimedwait>(2)."
7846 msgstr ""
7847
7848 #. type: Plain text
7849 #: build/C/man3/sigwait.3:86
7850 msgid "See B<pthread_sigmask>(3)."
7851 msgstr ""
7852
7853 #. type: Plain text
7854 #: build/C/man3/sigwait.3:94
7855 msgid ""
7856 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigsuspend>(2), "
7857 "B<sigwaitinfo>(2), B<sigsetops>(3), B<signal>(7)"
7858 msgstr ""
7859
7860 #. type: TH
7861 #: build/C/man2/sigwaitinfo.2:23
7862 #, no-wrap
7863 msgid "SIGWAITINFO"
7864 msgstr ""
7865
7866 #. type: TH
7867 #: build/C/man2/sigwaitinfo.2:23
7868 #, no-wrap
7869 msgid "2012-05-02"
7870 msgstr ""
7871
7872 #. type: Plain text
7873 #: build/C/man2/sigwaitinfo.2:26
7874 msgid "sigwaitinfo, sigtimedwait - synchronously wait for queued signals"
7875 msgstr ""
7876
7877 #. type: Plain text
7878 #: build/C/man2/sigwaitinfo.2:31
7879 #, no-wrap
7880 msgid "B<int sigwaitinfo(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<);>\n"
7881 msgstr ""
7882
7883 #. type: Plain text
7884 #: build/C/man2/sigwaitinfo.2:34
7885 #, no-wrap
7886 msgid ""
7887 "B<int sigtimedwait(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<, >\n"
7888 "B<                 const struct timespec *>I<timeout>B<);>\n"
7889 msgstr ""
7890
7891 #. type: Plain text
7892 #: build/C/man2/sigwaitinfo.2:44
7893 msgid "B<sigwaitinfo>(), B<sigtimedwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
7894 msgstr ""
7895
7896 #. type: Plain text
7897 #: build/C/man2/sigwaitinfo.2:54
7898 msgid ""
7899 "B<sigwaitinfo>()  suspends execution of the calling thread until one of the "
7900 "signals in I<set> is delivered.  (If one of the signals in I<set> is already "
7901 "pending for the calling thread, B<sigwaitinfo>()  will return immediately "
7902 "with information about that signal.)"
7903 msgstr ""
7904
7905 #. type: Plain text
7906 #: build/C/man2/sigwaitinfo.2:66
7907 msgid ""
7908 "B<sigwaitinfo>()  removes the delivered signal from the set of pending "
7909 "signals and returns the signal number as its function result.  If the "
7910 "I<info> argument is not NULL, then it returns a structure of type "
7911 "I<siginfo_t> (see B<sigaction>(2))  containing information about the signal."
7912 msgstr ""
7913
7914 #. type: Plain text
7915 #: build/C/man2/sigwaitinfo.2:72
7916 msgid ""
7917 "Signals returned via B<sigwaitinfo>()  are delivered in the usual order; see "
7918 "B<signal>(7)  for further details."
7919 msgstr ""
7920
7921 #. type: Plain text
7922 #: build/C/man2/sigwaitinfo.2:84
7923 msgid ""
7924 "B<sigtimedwait>()  operates in exactly the same way as B<sigwaitinfo>()  "
7925 "except that it has an additional argument, I<timeout>, which specifies a "
7926 "minimum interval for which the thread is suspended waiting for a signal.  "
7927 "(This interval will be rounded up to the system clock granularity, and "
7928 "kernel scheduling delays mean that the interval may overrun by a small "
7929 "amount.)  This argument is of the following type:"
7930 msgstr ""
7931
7932 #. type: Plain text
7933 #: build/C/man2/sigwaitinfo.2:91
7934 #, no-wrap
7935 msgid ""
7936 "struct timespec {\n"
7937 "    long    tv_sec;         /* seconds */\n"
7938 "    long    tv_nsec;        /* nanoseconds */\n"
7939 "}\n"
7940 msgstr ""
7941
7942 #. type: Plain text
7943 #: build/C/man2/sigwaitinfo.2:101
7944 msgid ""
7945 "If both fields of this structure are specified as 0, a poll is performed: "
7946 "B<sigtimedwait>()  returns immediately, either with information about a "
7947 "signal that was pending for the caller, or with an error if none of the "
7948 "signals in I<set> was pending."
7949 msgstr ""
7950
7951 #. type: Plain text
7952 #: build/C/man2/sigwaitinfo.2:110
7953 msgid ""
7954 "On success, both B<sigwaitinfo>()  and B<sigtimedwait>()  return a signal "
7955 "number (i.e., a value greater than zero).  On failure both calls return -1, "
7956 "with I<errno> set to indicate the error."
7957 msgstr ""
7958
7959 #. type: Plain text
7960 #: build/C/man2/sigwaitinfo.2:119
7961 msgid ""
7962 "No signal in I<set> was delivered within the I<timeout> period specified to "
7963 "B<sigtimedwait>()."
7964 msgstr ""
7965
7966 #. type: Plain text
7967 #: build/C/man2/sigwaitinfo.2:125
7968 msgid ""
7969 "The wait was interrupted by a signal handler; see B<signal>(7).  (This "
7970 "handler was for a signal other than one of those in I<set>.)"
7971 msgstr ""
7972
7973 #. type: Plain text
7974 #: build/C/man2/sigwaitinfo.2:129
7975 msgid "I<timeout> was invalid."
7976 msgstr ""
7977
7978 #. type: Plain text
7979 #: build/C/man2/sigwaitinfo.2:148
7980 msgid ""
7981 "In normal usage, the calling program blocks the signals in I<set> via a "
7982 "prior call to B<sigprocmask>(2)  (so that the default disposition for these "
7983 "signals does not occur if they are delivered between successive calls to "
7984 "B<sigwaitinfo>()  or B<sigtimedwait>())  and does not establish handlers for "
7985 "these signals.  In a multithreaded program, the signal should be blocked in "
7986 "all threads to prevent the signal being delivered to a thread other than the "
7987 "one calling B<sigwaitinfo>()  or B<sigtimedwait>())."
7988 msgstr ""
7989
7990 #. type: Plain text
7991 #: build/C/man2/sigwaitinfo.2:153
7992 msgid ""
7993 "The set of signals that is pending for a given thread is the union of the "
7994 "set of signals that is pending specifically for that thread and the set of "
7995 "signals that is pending for the process as a whole (see B<signal>(7))."
7996 msgstr ""
7997
7998 #. type: Plain text
7999 #: build/C/man2/sigwaitinfo.2:159
8000 msgid "Attempts to wait for B<SIGKILL> and B<SIGSTOP> are silently ignored."
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man2/sigwaitinfo.2:168
8005 msgid ""
8006 "If multiple threads of a process are blocked waiting for the same signal(s) "
8007 "in B<sigwaitinfo>()  or B<sigtimedwait>(), then exactly one of the threads "
8008 "will actually receive the signal if it is delivered to the process as a "
8009 "whole; which of the threads receives the signal is indeterminate."
8010 msgstr ""
8011
8012 #. type: Plain text
8013 #: build/C/man2/sigwaitinfo.2:177
8014 msgid ""
8015 "POSIX leaves the meaning of a NULL value for the I<timeout> argument of "
8016 "B<sigtimedwait>()  unspecified, permitting the possibility that this has the "
8017 "same meaning as a call to B<sigwaitinfo>(), and indeed this is what is done "
8018 "on Linux."
8019 msgstr ""
8020
8021 #. type: Plain text
8022 #: build/C/man2/sigwaitinfo.2:182
8023 msgid ""
8024 "On Linux, B<sigwaitinfo>()  is a library function implemented on top of "
8025 "B<sigtimedwait>()."
8026 msgstr ""
8027
8028 #. type: Plain text
8029 #: build/C/man2/sigwaitinfo.2:194
8030 msgid ""
8031 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<signalfd>(2), B<sigpending>(2), "
8032 "B<sigprocmask>(2), B<sigqueue>(3), B<sigsetops>(3), B<sigwait>(3), "
8033 "B<signal>(7), B<time>(7)"
8034 msgstr ""
8035
8036 #. type: TH
8037 #: build/C/man3/sysv_signal.3:23
8038 #, no-wrap
8039 msgid "SYSV_SIGNAL"
8040 msgstr ""
8041
8042 #. type: TH
8043 #: build/C/man3/sysv_signal.3:23
8044 #, no-wrap
8045 msgid "2007-05-04"
8046 msgstr ""
8047
8048 #. type: Plain text
8049 #: build/C/man3/sysv_signal.3:26
8050 msgid "sysv_signal - signal handling with System V semantics"
8051 msgstr ""
8052
8053 #. type: Plain text
8054 #: build/C/man3/sysv_signal.3:28
8055 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
8056 msgstr ""
8057
8058 #. type: Plain text
8059 #: build/C/man3/sysv_signal.3:34
8060 msgid "B<sighandler_t sysv_signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
8061 msgstr ""
8062
8063 #. type: Plain text
8064 #: build/C/man3/sysv_signal.3:39
8065 msgid ""
8066 "The B<sysv_signal>()  function takes the same arguments, and performs the "
8067 "same task, as B<signal>(2)."
8068 msgstr ""
8069
8070 #. type: Plain text
8071 #: build/C/man3/sysv_signal.3:49
8072 msgid ""
8073 "However B<sysv_signal>()  provides the System V unreliable signal semantics, "
8074 "that is: a) the disposition of the signal is reset to the default when the "
8075 "handler is invoked; b) delivery of further instances of the signal is not "
8076 "blocked while the signal handler is executing; and c) if the handler "
8077 "interrupts (certain) blocking system calls, then the system call is not "
8078 "automatically restarted."
8079 msgstr ""
8080
8081 #. type: Plain text
8082 #: build/C/man3/sysv_signal.3:55
8083 msgid ""
8084 "The B<sysv_signal>()  function returns the previous value of the signal "
8085 "handler, or B<SIG_ERR> on error."
8086 msgstr ""
8087
8088 #. type: Plain text
8089 #: build/C/man3/sysv_signal.3:60
8090 msgid "This function is nonstandard."
8091 msgstr ""
8092
8093 #. type: Plain text
8094 #: build/C/man3/sysv_signal.3:66
8095 msgid "Use of B<sysv_signal>()  should be avoided; use B<sigaction>(2)  instead."
8096 msgstr ""
8097
8098 #. type: Plain text
8099 #: build/C/man3/sysv_signal.3:77
8100 msgid ""
8101 "On older Linux systems, B<sysv_signal>()  and B<signal>(2)  were "
8102 "equivalent.  But on newer systems, B<signal>(2)  provides reliable signal "
8103 "semantics; see B<signal>(2)  for details."
8104 msgstr ""
8105
8106 #. type: Plain text
8107 #: build/C/man3/sysv_signal.3:90
8108 msgid "B<sigaction>(2), B<signal>(2), B<bsd_signal>(3), B<signal>(7)"
8109 msgstr ""
8110
8111 #. type: TH
8112 #: build/C/man2/timer_create.2:29
8113 #, no-wrap
8114 msgid "TIMER_CREATE"
8115 msgstr ""
8116
8117 #. type: TH
8118 #: build/C/man2/timer_create.2:29
8119 #, no-wrap
8120 msgid "2010-09-27"
8121 msgstr ""
8122
8123 #. type: Plain text
8124 #: build/C/man2/timer_create.2:32
8125 msgid "timer_create - create a POSIX per-process timer"
8126 msgstr ""
8127
8128 #. type: Plain text
8129 #: build/C/man2/timer_create.2:36
8130 #, no-wrap
8131 msgid ""
8132 "B<#include E<lt>signal.hE<gt>>\n"
8133 "B<#include E<lt>time.hE<gt>>\n"
8134 msgstr ""
8135
8136 #. type: Plain text
8137 #: build/C/man2/timer_create.2:39
8138 #, no-wrap
8139 msgid ""
8140 "B<int timer_create(clockid_t >I<clockid>B<, struct sigevent *>I<sevp>B<,>\n"
8141 "B<                 timer_t *>I<timerid>B<);>\n"
8142 msgstr ""
8143
8144 #. type: Plain text
8145 #: build/C/man2/timer_create.2:42 build/C/man2/timer_delete.2:34 build/C/man2/timer_getoverrun.2:34 build/C/man2/timer_settime.2:38
8146 msgid "Link with I<-lrt>."
8147 msgstr ""
8148
8149 #. type: Plain text
8150 #: build/C/man2/timer_create.2:50
8151 msgid "B<timer_create>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8152 msgstr ""
8153
8154 #. type: Plain text
8155 #: build/C/man2/timer_create.2:58
8156 msgid ""
8157 "B<timer_create>()  creates a new per-process interval timer.  The ID of the "
8158 "new timer is returned in the buffer pointed to by I<timerid>, which must be "
8159 "a non-NULL pointer.  This ID is unique within the process, until the timer "
8160 "is deleted.  The new timer is initially disarmed."
8161 msgstr ""
8162
8163 #. type: Plain text
8164 #: build/C/man2/timer_create.2:63
8165 msgid ""
8166 "The I<clockid> argument specifies the clock that the new timer uses to "
8167 "measure time.  It can be specified as one of the following values:"
8168 msgstr ""
8169
8170 #. type: TP
8171 #: build/C/man2/timer_create.2:63
8172 #, no-wrap
8173 msgid "B<CLOCK_REALTIME>"
8174 msgstr ""
8175
8176 #. type: Plain text
8177 #: build/C/man2/timer_create.2:66
8178 msgid "A settable system-wide real-time clock."
8179 msgstr ""
8180
8181 #. type: TP
8182 #: build/C/man2/timer_create.2:66
8183 #, no-wrap
8184 msgid "B<CLOCK_MONOTONIC>"
8185 msgstr ""
8186
8187 #.  Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime()
8188 #.  in 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009
8189 #. type: Plain text
8190 #: build/C/man2/timer_create.2:73
8191 msgid ""
8192 "A nonsettable monotonically increasing clock that measures time from some "
8193 "unspecified point in the past that does not change after system startup."
8194 msgstr ""
8195
8196 #. type: TP
8197 #: build/C/man2/timer_create.2:73
8198 #, no-wrap
8199 msgid "B<CLOCK_PROCESS_CPUTIME_ID> (since Linux 2.6.12)"
8200 msgstr ""
8201
8202 #. type: Plain text
8203 #: build/C/man2/timer_create.2:77
8204 msgid ""
8205 "A clock that measures (user and system) CPU time consumed by (all of the "
8206 "threads in) the calling process."
8207 msgstr ""
8208
8209 #. type: TP
8210 #: build/C/man2/timer_create.2:77
8211 #, no-wrap
8212 msgid "B<CLOCK_THREAD_CPUTIME_ID> (since Linux 2.6.12)"
8213 msgstr ""
8214
8215 #.  The CLOCK_MONOTONIC_RAW that was added in 2.6.28 can't be used
8216 #.  to create a timer -- mtk, Feb 2009
8217 #. type: Plain text
8218 #: build/C/man2/timer_create.2:83
8219 msgid ""
8220 "A clock that measures (user and system) CPU time consumed by the calling "
8221 "thread."
8222 msgstr ""
8223
8224 #. type: Plain text
8225 #: build/C/man2/timer_create.2:92
8226 msgid ""
8227 "As well as the above values, I<clockid> can be specified as the I<clockid> "
8228 "returned by a call to B<clock_getcpuclockid>(3)  or "
8229 "B<pthread_getcpuclockid>(3)."
8230 msgstr ""
8231
8232 #. type: Plain text
8233 #: build/C/man2/timer_create.2:101
8234 msgid ""
8235 "The I<sevp> argument points to a I<sigevent> structure that specifies how "
8236 "the caller should be notified when the timer expires.  For the definition "
8237 "and general details of this structure, see B<sigevent>(7)."
8238 msgstr ""
8239
8240 #. type: Plain text
8241 #: build/C/man2/timer_create.2:105
8242 msgid "The I<sevp.sigev_notify> field can have the following values:"
8243 msgstr ""
8244
8245 #. type: Plain text
8246 #: build/C/man2/timer_create.2:110
8247 msgid ""
8248 "Don't asynchronously notify when the timer expires.  Progress of the timer "
8249 "can be monitored using B<timer_gettime>(2)."
8250 msgstr ""
8251
8252 #. type: Plain text
8253 #: build/C/man2/timer_create.2:128
8254 msgid ""
8255 "Upon timer expiration, generate the signal I<sigev_signo> for the process.  "
8256 "See B<sigevent>(7)  for general details.  The I<si_code> field of the "
8257 "I<siginfo_t> structure will be set to B<SI_TIMER>.  At any point in time, at "
8258 "most one signal is queued to the process for a given timer; see "
8259 "B<timer_getoverrun>(2)  for more details."
8260 msgstr ""
8261
8262 #. type: Plain text
8263 #: build/C/man2/timer_create.2:136
8264 msgid ""
8265 "Upon timer expiration, invoke I<sigev_notify_function> as if it were the "
8266 "start function of a new thread.  See B<sigevent>(7)  for details."
8267 msgstr ""
8268
8269 #. type: Plain text
8270 #: build/C/man2/timer_create.2:150
8271 msgid ""
8272 "As for B<SIGEV_SIGNAL>, but the signal is targeted at the thread whose ID is "
8273 "given in I<sigev_notify_thread_id>, which must be a thread in the same "
8274 "process as the caller.  The I<sigev_notify_thread_id> field specifies a "
8275 "kernel thread ID, that is, the value returned by B<clone>(2)  or "
8276 "B<gettid>(2).  This flag is only intended for use by threading libraries."
8277 msgstr ""
8278
8279 #. type: Plain text
8280 #: build/C/man2/timer_create.2:165
8281 msgid ""
8282 "Specifying I<sevp> as NULL is equivalent to specifying a pointer to a "
8283 "I<sigevent> structure in which I<sigev_notify> is B<SIGEV_SIGNAL>, "
8284 "I<sigev_signo> is B<SIGALRM>, and I<sigev_value.sival_int> is the timer ID."
8285 msgstr ""
8286
8287 #. type: Plain text
8288 #: build/C/man2/timer_create.2:173
8289 msgid ""
8290 "On success, B<timer_create>()  returns 0, and the ID of the new timer is "
8291 "placed in I<*timerid>.  On failure, -1 is returned, and I<errno> is set to "
8292 "indicate the error."
8293 msgstr ""
8294
8295 #. type: Plain text
8296 #: build/C/man2/timer_create.2:177
8297 msgid "Temporary error during kernel allocation of timer structures."
8298 msgstr ""
8299
8300 #. type: Plain text
8301 #: build/C/man2/timer_create.2:185
8302 msgid ""
8303 "Clock ID, I<sigev_notify>, I<sigev_signo>, or I<sigev_notify_thread_id> is "
8304 "invalid."
8305 msgstr ""
8306
8307 #.  glibc layer: malloc()
8308 #. type: Plain text
8309 #: build/C/man2/timer_create.2:189
8310 msgid "Could not allocate memory."
8311 msgstr ""
8312
8313 #. type: Plain text
8314 #: build/C/man2/timer_create.2:191 build/C/man2/timer_delete.2:64 build/C/man2/timer_getoverrun.2:94
8315 msgid "This system call is available since Linux 2.6."
8316 msgstr ""
8317
8318 #. type: Plain text
8319 #: build/C/man2/timer_create.2:196
8320 msgid "A program may create multiple interval timers using B<timer_create>()."
8321 msgstr ""
8322
8323 #. type: Plain text
8324 #: build/C/man2/timer_create.2:201
8325 msgid ""
8326 "Timers are not inherited by the child of a B<fork>(2), and are disarmed and "
8327 "deleted during an B<execve>(2)."
8328 msgstr ""
8329
8330 #. type: Plain text
8331 #: build/C/man2/timer_create.2:209
8332 msgid ""
8333 "The kernel preallocates a \"queued real-time signal\" for each timer created "
8334 "using B<timer_create>().  Consequently, the number of timers is limited by "
8335 "the B<RLIMIT_SIGPENDING> resource limit (see B<setrlimit>(2))."
8336 msgstr ""
8337
8338 #. type: Plain text
8339 #: build/C/man2/timer_create.2:214
8340 msgid ""
8341 "The timers created by B<timer_create>()  are commonly known as \"POSIX "
8342 "(interval) timers\".  The POSIX timers API consists of the following "
8343 "interfaces:"
8344 msgstr ""
8345
8346 #. type: Plain text
8347 #: build/C/man2/timer_create.2:217
8348 msgid "B<timer_create>(): Create a timer."
8349 msgstr ""
8350
8351 #. type: Plain text
8352 #: build/C/man2/timer_create.2:220
8353 msgid "B<timer_settime>(2): Arm (start) or disarm (stop) a timer."
8354 msgstr ""
8355
8356 #. type: Plain text
8357 #: build/C/man2/timer_create.2:224
8358 msgid ""
8359 "B<timer_gettime>(2): Fetch the time remaining until the next expiration of a "
8360 "timer, along with the interval setting of the timer."
8361 msgstr ""
8362
8363 #. type: Plain text
8364 #: build/C/man2/timer_create.2:227
8365 msgid ""
8366 "B<timer_getoverrun>(2): Return the overrun count for the last timer "
8367 "expiration."
8368 msgstr ""
8369
8370 #. type: Plain text
8371 #: build/C/man2/timer_create.2:230
8372 msgid "B<timer_delete>(2): Disarm and delete a timer."
8373 msgstr ""
8374
8375 #. type: Plain text
8376 #: build/C/man2/timer_create.2:233
8377 msgid ""
8378 "Part of the implementation of the POSIX timers API is provided by glibc.  In "
8379 "particular:"
8380 msgstr ""
8381
8382 #. type: Plain text
8383 #: build/C/man2/timer_create.2:237
8384 msgid ""
8385 "The functionality for B<SIGEV_THREAD> is implemented within glibc, rather "
8386 "than the kernel."
8387 msgstr ""
8388
8389 #.  See the glibc source file kernel-posix-timers.h for the structure
8390 #.  that glibc uses to map userspace timer IDs to kernel timer IDs
8391 #.  The kernel-level timer ID is exposed via siginfo.si_tid.
8392 #. type: Plain text
8393 #: build/C/man2/timer_create.2:243
8394 msgid ""
8395 "The timer IDs presented at user level are maintained by glibc, which maps "
8396 "these IDs to the timer IDs employed by the kernel."
8397 msgstr ""
8398
8399 #. type: Plain text
8400 #: build/C/man2/timer_create.2:251
8401 msgid ""
8402 "The POSIX timers system calls first appeared in Linux 2.6.  Prior to this, "
8403 "glibc provided an incomplete userspace implementation (B<CLOCK_REALTIME> "
8404 "timers only) using POSIX threads, and current glibc falls back to this "
8405 "implementation on systems running pre-2.6 Linux kernels."
8406 msgstr ""
8407
8408 #. type: Plain text
8409 #: build/C/man2/timer_create.2:263
8410 msgid ""
8411 "The program below takes two arguments: a sleep period in seconds, and a "
8412 "timer frequency in nanoseconds.  The program establishes a handler for the "
8413 "signal it uses for the timer, blocks that signal, creates and arms a timer "
8414 "that expires with the given frequency, sleeps for the specified number of "
8415 "seconds, and then unblocks the timer signal.  Assuming that the timer "
8416 "expired at least once while the program slept, the signal handler will be "
8417 "invoked, and the handler displays some information about the timer "
8418 "notification.  The program terminates after one invocation of the signal "
8419 "handler."
8420 msgstr ""
8421
8422 #. type: Plain text
8423 #: build/C/man2/timer_create.2:268
8424 msgid ""
8425 "In the following example run, the program sleeps for 1 second, after "
8426 "creating a timer that has a frequency of 100 nanoseconds.  By the time the "
8427 "signal is unblocked and delivered, there have been around ten million "
8428 "overruns."
8429 msgstr ""
8430
8431 #. type: Plain text
8432 #: build/C/man2/timer_create.2:280
8433 #, no-wrap
8434 msgid ""
8435 "$ B<./a.out 1 100>\n"
8436 "Establishing handler for signal 34\n"
8437 "Blocking signal 34\n"
8438 "timer ID is 0x804c008\n"
8439 "Sleeping for 1 seconds\n"
8440 "Unblocking signal 34\n"
8441 "Caught signal 34\n"
8442 "    sival_ptr = 0xbfb174f4;     *sival_ptr = 0x804c008\n"
8443 "    overrun count = 10004886\n"
8444 msgstr ""
8445
8446 #. type: SS
8447 #: build/C/man2/timer_create.2:282
8448 #, no-wrap
8449 msgid "Program Source"
8450 msgstr ""
8451
8452 #. type: Plain text
8453 #: build/C/man2/timer_create.2:290
8454 #, no-wrap
8455 msgid ""
8456 "#include E<lt>stdlib.hE<gt>\n"
8457 "#include E<lt>unistd.hE<gt>\n"
8458 "#include E<lt>stdio.hE<gt>\n"
8459 "#include E<lt>signal.hE<gt>\n"
8460 "#include E<lt>time.hE<gt>\n"
8461 msgstr ""
8462
8463 #. type: Plain text
8464 #: build/C/man2/timer_create.2:293
8465 #, no-wrap
8466 msgid ""
8467 "#define CLOCKID CLOCK_REALTIME\n"
8468 "#define SIG SIGRTMIN\n"
8469 msgstr ""
8470
8471 #. type: Plain text
8472 #: build/C/man2/timer_create.2:296
8473 #, no-wrap
8474 msgid ""
8475 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
8476 "                        } while (0)\n"
8477 msgstr ""
8478
8479 #. type: Plain text
8480 #: build/C/man2/timer_create.2:302
8481 #, no-wrap
8482 msgid ""
8483 "static void\n"
8484 "print_siginfo(siginfo_t *si)\n"
8485 "{\n"
8486 "    timer_t *tidp;\n"
8487 "    int or;\n"
8488 msgstr ""
8489
8490 #. type: Plain text
8491 #: build/C/man2/timer_create.2:304
8492 #, no-wrap
8493 msgid "    tidp = si-E<gt>si_value.sival_ptr;\n"
8494 msgstr ""
8495
8496 #. type: Plain text
8497 #: build/C/man2/timer_create.2:307
8498 #, no-wrap
8499 msgid ""
8500 "    printf(\"    sival_ptr = %p; \", si-E<gt>si_value.sival_ptr);\n"
8501 "    printf(\"    *sival_ptr = 0x%lx\\en\", (long) *tidp);\n"
8502 msgstr ""
8503
8504 #. type: Plain text
8505 #: build/C/man2/timer_create.2:314
8506 #, no-wrap
8507 msgid ""
8508 "    or = timer_getoverrun(*tidp);\n"
8509 "    if (or == -1)\n"
8510 "        errExit(\"timer_getoverrun\");\n"
8511 "    else\n"
8512 "        printf(\"    overrun count = %d\\en\", or);\n"
8513 "}\n"
8514 msgstr ""
8515
8516 #. type: Plain text
8517 #: build/C/man2/timer_create.2:321
8518 #, no-wrap
8519 msgid ""
8520 "static void\n"
8521 "handler(int sig, siginfo_t *si, void *uc)\n"
8522 "{\n"
8523 "    /* Note: calling printf() from a signal handler is not\n"
8524 "       strictly correct, since printf() is not async-signal-safe;\n"
8525 "       see signal(7) */\n"
8526 msgstr ""
8527
8528 #. type: Plain text
8529 #: build/C/man2/timer_create.2:326
8530 #, no-wrap
8531 msgid ""
8532 "    printf(\"Caught signal %d\\en\", sig);\n"
8533 "    print_siginfo(si);\n"
8534 "    signal(sig, SIG_IGN);\n"
8535 "}\n"
8536 msgstr ""
8537
8538 #. type: Plain text
8539 #: build/C/man2/timer_create.2:336
8540 #, no-wrap
8541 msgid ""
8542 "int\n"
8543 "main(int argc, char *argv[])\n"
8544 "{\n"
8545 "    timer_t timerid;\n"
8546 "    struct sigevent sev;\n"
8547 "    struct itimerspec its;\n"
8548 "    long long freq_nanosecs;\n"
8549 "    sigset_t mask;\n"
8550 "    struct sigaction sa;\n"
8551 msgstr ""
8552
8553 #. type: Plain text
8554 #: build/C/man2/timer_create.2:342
8555 #, no-wrap
8556 msgid ""
8557 "    if (argc != 3) {\n"
8558 "        fprintf(stderr, \"Usage: %s E<lt>sleep-secsE<gt> "
8559 "E<lt>freq-nanosecsE<gt>\\en\",\n"
8560 "                argv[0]);\n"
8561 "        exit(EXIT_FAILURE);\n"
8562 "    }\n"
8563 msgstr ""
8564
8565 #. type: Plain text
8566 #: build/C/man2/timer_create.2:344
8567 #, no-wrap
8568 msgid "    /* Establish handler for timer signal */\n"
8569 msgstr ""
8570
8571 #. type: Plain text
8572 #: build/C/man2/timer_create.2:351
8573 #, no-wrap
8574 msgid ""
8575 "    printf(\"Establishing handler for signal %d\\en\", SIG);\n"
8576 "    sa.sa_flags = SA_SIGINFO;\n"
8577 "    sa.sa_sigaction = handler;\n"
8578 "    sigemptyset(&sa.sa_mask);\n"
8579 "    if (sigaction(SIG, &sa, NULL) == -1)\n"
8580 "        errExit(\"sigaction\");\n"
8581 msgstr ""
8582
8583 #. type: Plain text
8584 #: build/C/man2/timer_create.2:353
8585 #, no-wrap
8586 msgid "    /* Block timer signal temporarily */\n"
8587 msgstr ""
8588
8589 #. type: Plain text
8590 #: build/C/man2/timer_create.2:359
8591 #, no-wrap
8592 msgid ""
8593 "    printf(\"Blocking signal %d\\en\", SIG);\n"
8594 "    sigemptyset(&mask);\n"
8595 "    sigaddset(&mask, SIG);\n"
8596 "    if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)\n"
8597 "        errExit(\"sigprocmask\");\n"
8598 msgstr ""
8599
8600 #. type: Plain text
8601 #: build/C/man2/timer_create.2:361
8602 #, no-wrap
8603 msgid "    /* Create the timer */\n"
8604 msgstr ""
8605
8606 #. type: Plain text
8607 #: build/C/man2/timer_create.2:367
8608 #, no-wrap
8609 msgid ""
8610 "    sev.sigev_notify = SIGEV_SIGNAL;\n"
8611 "    sev.sigev_signo = SIG;\n"
8612 "    sev.sigev_value.sival_ptr = &timerid;\n"
8613 "    if (timer_create(CLOCKID, &sev, &timerid) == -1)\n"
8614 "        errExit(\"timer_create\");\n"
8615 msgstr ""
8616
8617 #. type: Plain text
8618 #: build/C/man2/timer_create.2:369
8619 #, no-wrap
8620 msgid "    printf(\"timer ID is 0x%lx\\en\", (long) timerid);\n"
8621 msgstr ""
8622
8623 #. type: Plain text
8624 #: build/C/man2/timer_create.2:371
8625 #, no-wrap
8626 msgid "    /* Start the timer */\n"
8627 msgstr ""
8628
8629 #. type: Plain text
8630 #: build/C/man2/timer_create.2:377
8631 #, no-wrap
8632 msgid ""
8633 "    freq_nanosecs = atoll(argv[2]);\n"
8634 "    its.it_value.tv_sec = freq_nanosecs / 1000000000;\n"
8635 "    its.it_value.tv_nsec = freq_nanosecs % 1000000000;\n"
8636 "    its.it_interval.tv_sec = its.it_value.tv_sec;\n"
8637 "    its.it_interval.tv_nsec = its.it_value.tv_nsec;\n"
8638 msgstr ""
8639
8640 #. type: Plain text
8641 #: build/C/man2/timer_create.2:380
8642 #, no-wrap
8643 msgid ""
8644 "    if (timer_settime(timerid, 0, &its, NULL) == -1)\n"
8645 "         errExit(\"timer_settime\");\n"
8646 msgstr ""
8647
8648 #. type: Plain text
8649 #: build/C/man2/timer_create.2:383
8650 #, no-wrap
8651 msgid ""
8652 "    /* Sleep for a while; meanwhile, the timer may expire\n"
8653 "       multiple times */\n"
8654 msgstr ""
8655
8656 #. type: Plain text
8657 #: build/C/man2/timer_create.2:386
8658 #, no-wrap
8659 msgid ""
8660 "    printf(\"Sleeping for %d seconds\\en\", atoi(argv[1]));\n"
8661 "    sleep(atoi(argv[1]));\n"
8662 msgstr ""
8663
8664 #. type: Plain text
8665 #: build/C/man2/timer_create.2:389
8666 #, no-wrap
8667 msgid ""
8668 "    /* Unlock the timer signal, so that timer notification\n"
8669 "       can be delivered */\n"
8670 msgstr ""
8671
8672 #. type: Plain text
8673 #: build/C/man2/timer_create.2:393
8674 #, no-wrap
8675 msgid ""
8676 "    printf(\"Unblocking signal %d\\en\", SIG);\n"
8677 "    if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)\n"
8678 "        errExit(\"sigprocmask\");\n"
8679 msgstr ""
8680
8681 #. type: Plain text
8682 #: build/C/man2/timer_create.2:396 build/C/man2/timerfd_create.2:533
8683 #, no-wrap
8684 msgid ""
8685 "    exit(EXIT_SUCCESS);\n"
8686 "}\n"
8687 msgstr ""
8688
8689 #. type: Plain text
8690 #: build/C/man2/timer_create.2:410
8691 msgid ""
8692 "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
8693 "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
8694 "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
8695 "B<sigevent>(7), B<signal>(7), B<time>(7)"
8696 msgstr ""
8697
8698 #. type: TH
8699 #: build/C/man2/timer_delete.2:23
8700 #, no-wrap
8701 msgid "TIMER_DELETE"
8702 msgstr ""
8703
8704 #. type: TH
8705 #: build/C/man2/timer_delete.2:23 build/C/man2/timer_getoverrun.2:23 build/C/man2/timer_settime.2:23
8706 #, no-wrap
8707 msgid "2009-02-20"
8708 msgstr ""
8709
8710 #. type: Plain text
8711 #: build/C/man2/timer_delete.2:26
8712 msgid "timer_delete - delete a POSIX per-process timer"
8713 msgstr ""
8714
8715 #. type: Plain text
8716 #: build/C/man2/timer_delete.2:29 build/C/man2/timer_getoverrun.2:29 build/C/man2/timer_settime.2:30
8717 #, no-wrap
8718 msgid "B<#include E<lt>time.hE<gt>>\n"
8719 msgstr ""
8720
8721 #. type: Plain text
8722 #: build/C/man2/timer_delete.2:31
8723 #, no-wrap
8724 msgid "B<int timer_delete(timer_t >I<timerid>B<);>\n"
8725 msgstr ""
8726
8727 #. type: Plain text
8728 #: build/C/man2/timer_delete.2:42
8729 msgid "B<timer_delete>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8730 msgstr ""
8731
8732 #. type: Plain text
8733 #: build/C/man2/timer_delete.2:50
8734 msgid ""
8735 "B<timer_delete>()  deletes the timer whose ID is given in I<timerid>.  If "
8736 "the timer was armed at the time of this call, it is disarmed before being "
8737 "deleted.  The treatment of any pending signal generated by the deleted timer "
8738 "is unspecified."
8739 msgstr ""
8740
8741 #. type: Plain text
8742 #: build/C/man2/timer_delete.2:57
8743 msgid ""
8744 "On success, B<timer_delete>()  returns 0.  On failure, -1 is returned, and "
8745 "I<errno> is set to indicate the error."
8746 msgstr ""
8747
8748 #. type: Plain text
8749 #: build/C/man2/timer_delete.2:62 build/C/man2/timer_getoverrun.2:92
8750 msgid "I<timerid> is not a valid timer ID."
8751 msgstr ""
8752
8753 #. type: Plain text
8754 #: build/C/man2/timer_delete.2:72
8755 msgid ""
8756 "B<clock_gettime>(2), B<timer_create>(2), B<timer_getoverrun>(2), "
8757 "B<timer_settime>(2), B<time>(7)"
8758 msgstr ""
8759
8760 #. type: TH
8761 #: build/C/man2/timer_getoverrun.2:23
8762 #, no-wrap
8763 msgid "TIMER_GETOVERRUN"
8764 msgstr ""
8765
8766 #. type: Plain text
8767 #: build/C/man2/timer_getoverrun.2:26
8768 msgid "timer_getoverrun - get overrun count for a POSIX per-process timer"
8769 msgstr ""
8770
8771 #. type: Plain text
8772 #: build/C/man2/timer_getoverrun.2:31
8773 #, no-wrap
8774 msgid "B<int timer_getoverrun(timer_t >I<timerid>B<);>\n"
8775 msgstr ""
8776
8777 #. type: Plain text
8778 #: build/C/man2/timer_getoverrun.2:42
8779 msgid "B<timer_getoverrun>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8780 msgstr ""
8781
8782 #. type: Plain text
8783 #: build/C/man2/timer_getoverrun.2:53
8784 msgid ""
8785 "B<timer_getoverrun>()  returns the \"overrun count\" for the timer referred "
8786 "to by I<timerid>.  An application can use the overrun count to accurately "
8787 "calculate the number of timer expirations that would have occurred over a "
8788 "given time interval.  Timer overruns can occur both when receiving "
8789 "expiration notifications via signals (B<SIGEV_SIGNAL>), and via threads "
8790 "(B<SIGEV_THREAD>)."
8791 msgstr ""
8792
8793 #. type: Plain text
8794 #: build/C/man2/timer_getoverrun.2:73
8795 msgid ""
8796 "When expiration notifications are delivered via a signal, overruns can occur "
8797 "as follows.  Regardless of whether or not a real-time signal is used for "
8798 "timer notifications, the system queues at most one signal per timer.  (This "
8799 "is the behavior specified by POSIX.1-2001.  The alternative, queuing one "
8800 "signal for each timer expiration, could easily result in overflowing the "
8801 "allowed limits for queued signals on the system.)  Because of system "
8802 "scheduling delays, or because the signal may be temporarily blocked, there "
8803 "can be a delay between the time when the notification signal is generated "
8804 "and the time when it is delivered (e.g., caught by a signal handler) or "
8805 "accepted (e.g., using B<sigwaitinfo>(2)).  In this interval, further timer "
8806 "expirations may occur.  The timer overrun count is the number of additional "
8807 "timer expirations that occurred between the time when the signal was "
8808 "generated and when it was delivered or accepted."
8809 msgstr ""
8810
8811 #. type: Plain text
8812 #: build/C/man2/timer_getoverrun.2:79
8813 msgid ""
8814 "Timer overruns can also occur when expiration notifications are delivered "
8815 "via invocation of a thread, since there may be an arbitrary delay between an "
8816 "expiration of the timer and the invocation of the notification thread, and "
8817 "in that delay interval, additional timer expirations may occur"
8818 msgstr ""
8819
8820 #. type: Plain text
8821 #: build/C/man2/timer_getoverrun.2:87
8822 msgid ""
8823 "On success, B<timer_getoverrun>()  returns the overrun count of the "
8824 "specified timer; this count may be 0 if no overruns have occurred.  On "
8825 "failure, -1 is returned, and I<errno> is set to indicate the error."
8826 msgstr ""
8827
8828 #. type: Plain text
8829 #: build/C/man2/timer_getoverrun.2:108
8830 msgid ""
8831 "When timer notifications are delivered via signals (B<SIGEV_SIGNAL>), on "
8832 "Linux it is also possible to obtain the overrun count via the I<si_overrun> "
8833 "field of the I<siginfo_t> structure (see B<sigaction>(2)).  This allows an "
8834 "application to avoid the overhead of making a system call to obtain the "
8835 "overrun count, but is a nonportable extension to POSIX.1-2001."
8836 msgstr ""
8837
8838 #.  FIXME . Austin bug filed, 11 Feb 09
8839 #. type: Plain text
8840 #: build/C/man2/timer_getoverrun.2:112
8841 msgid ""
8842 "POSIX.1-2001 only discusses timer overruns in the context of timer "
8843 "notifications using signals."
8844 msgstr ""
8845
8846 #.  Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665
8847 #.  http://thread.gmane.org/gmane.linux.kernel/113276/
8848 #. type: Plain text
8849 #: build/C/man2/timer_getoverrun.2:125
8850 msgid ""
8851 "POSIX.1-2001 specifies that if the timer overrun count is equal to or "
8852 "greater than an implementation-defined maximum, B<DELAYTIMER_MAX>, then "
8853 "B<timer_getoverrun>()  should return B<DELAYTIMER_MAX>.  However, Linux does "
8854 "not implement this feature: instead, if the timer overrun value exceeds the "
8855 "maximum representable integer, the counter cycles, starting once more from "
8856 "low values."
8857 msgstr ""
8858
8859 #. type: Plain text
8860 #: build/C/man2/timer_getoverrun.2:128 build/C/man2/timer_settime.2:208
8861 msgid "See B<timer_create>(2)."
8862 msgstr ""
8863
8864 #. type: Plain text
8865 #: build/C/man2/timer_getoverrun.2:138
8866 msgid ""
8867 "B<clock_gettime>(2), B<sigaction>(2), B<signalfd>(2), B<sigwaitinfo>(2), "
8868 "B<timer_create>(2), B<timer_delete>(2), B<timer_settime>(2), B<signal>(7), "
8869 "B<time>(7)"
8870 msgstr ""
8871
8872 #. type: TH
8873 #: build/C/man2/timer_settime.2:23
8874 #, no-wrap
8875 msgid "TIMER_SETTIME"
8876 msgstr ""
8877
8878 #. type: Plain text
8879 #: build/C/man2/timer_settime.2:27
8880 msgid ""
8881 "timer_settime, timer_gettime - arm/disarm and fetch state of POSIX "
8882 "per-process timer"
8883 msgstr ""
8884
8885 #. type: Plain text
8886 #: build/C/man2/timer_settime.2:35
8887 #, no-wrap
8888 msgid ""
8889 "B<int timer_settime(timer_t >I<timerid>B<, int >I<flags>B<,>\n"
8890 "B<                  const struct itimerspec *>I<new_value>B<,>\n"
8891 "B<                  struct itimerspec * >I<old_value>B<);>\n"
8892 "B<int timer_gettime(timer_t >I<timerid>B<, struct itimerspec "
8893 "*>I<curr_value>B<);>\n"
8894 msgstr ""
8895
8896 #. type: Plain text
8897 #: build/C/man2/timer_settime.2:47
8898 msgid "B<timer_settime>(), B<timer_gettime>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8899 msgstr ""
8900
8901 #. type: Plain text
8902 #: build/C/man2/timer_settime.2:60
8903 msgid ""
8904 "B<timer_settime>()  arms or disarms the timer identified by I<timerid>.  The "
8905 "I<new_value> argument is an I<itimerspec> structure that specifies the new "
8906 "initial value and the new interval for the timer.  The I<itimerspec> "
8907 "structure is defined as follows:"
8908 msgstr ""
8909
8910 #. type: Plain text
8911 #: build/C/man2/timer_settime.2:67 build/C/man2/timerfd_create.2:127
8912 #, no-wrap
8913 msgid ""
8914 "struct timespec {\n"
8915 "    time_t tv_sec;                /* Seconds */\n"
8916 "    long   tv_nsec;               /* Nanoseconds */\n"
8917 "};\n"
8918 msgstr ""
8919
8920 #. type: Plain text
8921 #: build/C/man2/timer_settime.2:72
8922 #, no-wrap
8923 msgid ""
8924 "struct itimerspec {\n"
8925 "    struct timespec it_interval;  /* Timer interval */\n"
8926 "    struct timespec it_value;     /* Initial expiration */\n"
8927 "};\n"
8928 msgstr ""
8929
8930 #. type: Plain text
8931 #: build/C/man2/timer_settime.2:84
8932 msgid ""
8933 "Each of the substructures of the I<itimerspec> structure is a I<timespec> "
8934 "structure that allows a time value to be specified in seconds and "
8935 "nanoseconds.  These time values are measured according to the clock that was "
8936 "specified when the timer was created by B<timer_create>(2)"
8937 msgstr ""
8938
8939 #. type: Plain text
8940 #: build/C/man2/timer_settime.2:98
8941 msgid ""
8942 "If I<new_value-E<gt>it_value> specifies a nonzero value (i.e., either "
8943 "subfield is nonzero), then B<timer_settime>()  arms (starts) the timer, "
8944 "setting it to initially expire at the given time.  (If the timer was already "
8945 "armed, then the previous settings are overwritten.)  If "
8946 "I<new_value-E<gt>it_value> specifies a zero value (i.e., both subfields are "
8947 "zero), then the timer is disarmed."
8948 msgstr ""
8949
8950 #. type: Plain text
8951 #: build/C/man2/timer_settime.2:110
8952 msgid ""
8953 "The I<new_value-E<gt>it_interval> field specifies the period of the timer, "
8954 "in seconds and nanoseconds.  If this field is nonzero, then each time that "
8955 "an armed timer expires, the timer is reloaded from the value specified in "
8956 "I<new_value-E<gt>it_interval>.  If I<new_value-E<gt>it_interval> specifies a "
8957 "zero value then the timer expires just once, at the time specified by "
8958 "I<it_value>."
8959 msgstr ""
8960
8961 #.  By experiment: the overrun count is set correctly, for CLOCK_REALTIME.
8962 #. type: Plain text
8963 #: build/C/man2/timer_settime.2:131
8964 msgid ""
8965 "By default, the initial expiration time specified in "
8966 "I<new_value-E<gt>it_value> is interpreted relative to the current time on "
8967 "the timer's clock at the time of the call.  This can be modified by "
8968 "specifying B<TIMER_ABSTIME> in I<flags>, in which case "
8969 "I<new_value-E<gt>it_value> is interpreted as an absolute value as measured "
8970 "on the timer's clock; that is, the timer will expire when the clock value "
8971 "reaches the value specified by I<new_value-E<gt>it_value>.  If the specified "
8972 "absolute time has already passed, then the timer expires immediately, and "
8973 "the overrun count (see B<timer_getoverrun>(2))  will be set correctly."
8974 msgstr ""
8975
8976 #.  Similar remarks might apply with respect to process and thread CPU time
8977 #.  clocks, but these clocks are not currently (2.6.28) settable on Linux.
8978 #. type: Plain text
8979 #: build/C/man2/timer_settime.2:141
8980 msgid ""
8981 "If the value of the B<CLOCK_REALTIME> clock is adjusted while an absolute "
8982 "timer based on that clock is armed, then the expiration of the timer will be "
8983 "appropriately adjusted.  Adjustments to the B<CLOCK_REALTIME> clock have no "
8984 "effect on relative timers based on that clock."
8985 msgstr ""
8986
8987 #. type: Plain text
8988 #: build/C/man2/timer_settime.2:149
8989 msgid ""
8990 "If I<old_value> is not NULL, then it returns the previous interval of the "
8991 "timer (in I<old_value-E<gt>it_interval>)  and the amount of time until the "
8992 "timer would previously have next expired (in I<old_value-E<gt>it_value>)."
8993 msgstr ""
8994
8995 #. type: Plain text
8996 #: build/C/man2/timer_settime.2:169
8997 msgid ""
8998 "B<timer_gettime>()  returns the time until next expiration, and the "
8999 "interval, for the timer specified by I<timerid>, in the buffer pointed to by "
9000 "I<curr_value>.  The time remaining until the next timer expiration is "
9001 "returned in I<curr_value-E<gt>it_value>; this is always a relative value, "
9002 "regardless of whether the B<TIMER_ABSTIME> flag was used when arming the "
9003 "timer.  If the value returned in I<curr_value-E<gt>it_value> is zero, then "
9004 "the timer is currently disarmed.  The timer interval is returned in "
9005 "I<curr_value-E<gt>it_interval>.  If the value returned in "
9006 "I<curr_value-E<gt>it_interval> is zero, then this is a \"one-shot\" timer."
9007 msgstr ""
9008
9009 #. type: Plain text
9010 #: build/C/man2/timer_settime.2:178
9011 msgid ""
9012 "On success, B<timer_settime>()  and B<timer_gettime>()  return 0.  On error, "
9013 "-1 is returned, and I<errno> is set to indicate the error."
9014 msgstr ""
9015
9016 #. type: Plain text
9017 #: build/C/man2/timer_settime.2:180
9018 msgid "These functions may fail with the following errors:"
9019 msgstr ""
9020
9021 #. type: Plain text
9022 #: build/C/man2/timer_settime.2:187
9023 msgid "I<new_value>, I<old_value>, or I<curr_value> is not a valid pointer."
9024 msgstr ""
9025
9026 #.  FIXME . eventually: invalid value in flags
9027 #. type: Plain text
9028 #: build/C/man2/timer_settime.2:192
9029 msgid "I<timerid> is invalid."
9030 msgstr ""
9031
9032 #. type: Plain text
9033 #: build/C/man2/timer_settime.2:195
9034 msgid "B<timer_settime>()  may fail with the following errors:"
9035 msgstr ""
9036
9037 #. type: Plain text
9038 #: build/C/man2/timer_settime.2:201
9039 msgid ""
9040 "I<new_value.it_value> is negative; or I<new_value.it_value.tv_nsec> is "
9041 "negative or greater than 999,999,999."
9042 msgstr ""
9043
9044 #. type: Plain text
9045 #: build/C/man2/timer_settime.2:203
9046 msgid "These system calls are available since Linux 2.6."
9047 msgstr ""
9048
9049 #. type: Plain text
9050 #: build/C/man2/timer_settime.2:212
9051 msgid "B<timer_create>(2), B<timer_getoverrun>(2), B<time>(7)"
9052 msgstr ""
9053
9054 #. type: TH
9055 #: build/C/man2/timerfd_create.2:20
9056 #, no-wrap
9057 msgid "TIMERFD_CREATE"
9058 msgstr ""
9059
9060 #. type: TH
9061 #: build/C/man2/timerfd_create.2:20
9062 #, no-wrap
9063 msgid "2011-09-14"
9064 msgstr ""
9065
9066 #. type: Plain text
9067 #: build/C/man2/timerfd_create.2:24
9068 msgid ""
9069 "timerfd_create, timerfd_settime, timerfd_gettime - timers that notify via "
9070 "file descriptors"
9071 msgstr ""
9072
9073 #. type: Plain text
9074 #: build/C/man2/timerfd_create.2:27
9075 #, no-wrap
9076 msgid "B<#include E<lt>sys/timerfd.hE<gt>>\n"
9077 msgstr ""
9078
9079 #. type: Plain text
9080 #: build/C/man2/timerfd_create.2:29
9081 #, no-wrap
9082 msgid "B<int timerfd_create(int >I<clockid>B<, int >I<flags>B<);>\n"
9083 msgstr ""
9084
9085 #. type: Plain text
9086 #: build/C/man2/timerfd_create.2:33
9087 #, no-wrap
9088 msgid ""
9089 "B<int timerfd_settime(int >I<fd>B<, int >I<flags>B<,>\n"
9090 "B<                    const struct itimerspec *>I<new_value>B<,>\n"
9091 "B<                    struct itimerspec *>I<old_value>B<);>\n"
9092 msgstr ""
9093
9094 #. type: Plain text
9095 #: build/C/man2/timerfd_create.2:35
9096 #, no-wrap
9097 msgid "B<int timerfd_gettime(int >I<fd>B<, struct itimerspec *>I<curr_value>B<);>\n"
9098 msgstr ""
9099
9100 #. type: Plain text
9101 #: build/C/man2/timerfd_create.2:48
9102 msgid ""
9103 "These system calls create and operate on a timer that delivers timer "
9104 "expiration notifications via a file descriptor.  They provide an alternative "
9105 "to the use of B<setitimer>(2)  or B<timer_create>(2), with the advantage "
9106 "that the file descriptor may be monitored by B<select>(2), B<poll>(2), and "
9107 "B<epoll>(7)."
9108 msgstr ""
9109
9110 #. type: Plain text
9111 #: build/C/man2/timerfd_create.2:60
9112 msgid ""
9113 "The use of these three system calls is analogous to the use of "
9114 "B<timer_create>(2), B<timer_settime>(2), and B<timer_gettime>(2).  (There is "
9115 "no analog of B<timer_getoverrun>(2), since that functionality is provided by "
9116 "B<read>(2), as described below.)"
9117 msgstr ""
9118
9119 #. type: SS
9120 #: build/C/man2/timerfd_create.2:60
9121 #, no-wrap
9122 msgid "timerfd_create()"
9123 msgstr ""
9124
9125 #. type: Plain text
9126 #: build/C/man2/timerfd_create.2:79
9127 msgid ""
9128 "B<timerfd_create>()  creates a new timer object, and returns a file "
9129 "descriptor that refers to that timer.  The I<clockid> argument specifies the "
9130 "clock that is used to mark the progress of the timer, and must be either "
9131 "B<CLOCK_REALTIME> or B<CLOCK_MONOTONIC>.  B<CLOCK_REALTIME> is a settable "
9132 "system-wide clock.  B<CLOCK_MONOTONIC> is a nonsettable clock that is not "
9133 "affected by discontinuous changes in the system clock (e.g., manual changes "
9134 "to system time).  The current value of each of these clocks can be retrieved "
9135 "using B<clock_gettime>(2)."
9136 msgstr ""
9137
9138 #. type: Plain text
9139 #: build/C/man2/timerfd_create.2:84
9140 msgid ""
9141 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
9142 "I<flags> to change the behavior of B<timerfd_create>():"
9143 msgstr ""
9144
9145 #. type: TP
9146 #: build/C/man2/timerfd_create.2:84
9147 #, no-wrap
9148 msgid "B<TFD_NONBLOCK>"
9149 msgstr ""
9150
9151 #. type: TP
9152 #: build/C/man2/timerfd_create.2:92
9153 #, no-wrap
9154 msgid "B<TFD_CLOEXEC>"
9155 msgstr ""
9156
9157 #. type: Plain text
9158 #: build/C/man2/timerfd_create.2:106
9159 msgid ""
9160 "In Linux versions up to and including 2.6.26, I<flags> must be specified as "
9161 "zero."
9162 msgstr ""
9163
9164 #. type: SS
9165 #: build/C/man2/timerfd_create.2:106
9166 #, no-wrap
9167 msgid "timerfd_settime()"
9168 msgstr ""
9169
9170 #. type: Plain text
9171 #: build/C/man2/timerfd_create.2:111
9172 msgid ""
9173 "B<timerfd_settime>()  arms (starts) or disarms (stops)  the timer referred "
9174 "to by the file descriptor I<fd>."
9175 msgstr ""
9176
9177 #. type: Plain text
9178 #: build/C/man2/timerfd_create.2:120
9179 msgid ""
9180 "The I<new_value> argument specifies the initial expiration and interval for "
9181 "the timer.  The I<itimer> structure used for this argument contains two "
9182 "fields, each of which is in turn a structure of type I<timespec>:"
9183 msgstr ""
9184
9185 #. type: Plain text
9186 #: build/C/man2/timerfd_create.2:132
9187 #, no-wrap
9188 msgid ""
9189 "struct itimerspec {\n"
9190 "    struct timespec it_interval;  /* Interval for periodic timer */\n"
9191 "    struct timespec it_value;     /* Initial expiration */\n"
9192 "};\n"
9193 msgstr ""
9194
9195 #. type: Plain text
9196 #: build/C/man2/timerfd_create.2:144
9197 msgid ""
9198 "I<new_value.it_value> specifies the initial expiration of the timer, in "
9199 "seconds and nanoseconds.  Setting either field of I<new_value.it_value> to a "
9200 "nonzero value arms the timer.  Setting both fields of I<new_value.it_value> "
9201 "to zero disarms the timer."
9202 msgstr ""
9203
9204 #. type: Plain text
9205 #: build/C/man2/timerfd_create.2:153
9206 msgid ""
9207 "Setting one or both fields of I<new_value.it_interval> to nonzero values "
9208 "specifies the period, in seconds and nanoseconds, for repeated timer "
9209 "expirations after the initial expiration.  If both fields of "
9210 "I<new_value.it_interval> are zero, the timer expires just once, at the time "
9211 "specified by I<new_value.it_value>."
9212 msgstr ""
9213
9214 #. type: Plain text
9215 #: build/C/man2/timerfd_create.2:169
9216 msgid ""
9217 "The I<flags> argument is either 0, to start a relative timer "
9218 "(I<new_value.it_value> specifies a time relative to the current value of the "
9219 "clock specified by I<clockid>), or B<TFD_TIMER_ABSTIME>, to start an "
9220 "absolute timer (I<new_value.it_value> specifies an absolute time for the "
9221 "clock specified by I<clockid>; that is, the timer will expire when the value "
9222 "of that clock reaches the value specified in I<new_value.it_value>)."
9223 msgstr ""
9224
9225 #. type: Plain text
9226 #: build/C/man2/timerfd_create.2:180
9227 msgid ""
9228 "If the I<old_value> argument is not NULL, then the I<itimerspec> structure "
9229 "that it points to is used to return the setting of the timer that was "
9230 "current at the time of the call; see the description of B<timerfd_gettime>()  "
9231 "following."
9232 msgstr ""
9233
9234 #. type: SS
9235 #: build/C/man2/timerfd_create.2:180
9236 #, no-wrap
9237 msgid "timerfd_gettime()"
9238 msgstr ""
9239
9240 #. type: Plain text
9241 #: build/C/man2/timerfd_create.2:189
9242 msgid ""
9243 "B<timerfd_gettime>()  returns, in I<curr_value>, an I<itimerspec> structure "
9244 "that contains the current setting of the timer referred to by the file "
9245 "descriptor I<fd>."
9246 msgstr ""
9247
9248 #. type: Plain text
9249 #: build/C/man2/timerfd_create.2:199
9250 msgid ""
9251 "The I<it_value> field returns the amount of time until the timer will next "
9252 "expire.  If both fields of this structure are zero, then the timer is "
9253 "currently disarmed.  This field always contains a relative value, regardless "
9254 "of whether the B<TFD_TIMER_ABSTIME> flag was specified when setting the "
9255 "timer."
9256 msgstr ""
9257
9258 #. type: Plain text
9259 #: build/C/man2/timerfd_create.2:206
9260 msgid ""
9261 "The I<it_interval> field returns the interval of the timer.  If both fields "
9262 "of this structure are zero, then the timer is set to expire just once, at "
9263 "the time specified by I<curr_value.it_value>."
9264 msgstr ""
9265
9266 #. type: SS
9267 #: build/C/man2/timerfd_create.2:206
9268 #, no-wrap
9269 msgid "Operating on a timer file descriptor"
9270 msgstr ""
9271
9272 #. type: Plain text
9273 #: build/C/man2/timerfd_create.2:210
9274 msgid ""
9275 "The file descriptor returned by B<timerfd_create>()  supports the following "
9276 "operations:"
9277 msgstr ""
9278
9279 #. type: Plain text
9280 #: build/C/man2/timerfd_create.2:224
9281 msgid ""
9282 "If the timer has already expired one or more times since its settings were "
9283 "last modified using B<timerfd_settime>(), or since the last successful "
9284 "B<read>(2), then the buffer given to B<read>(2)  returns an unsigned 8-byte "
9285 "integer (I<uint64_t>)  containing the number of expirations that have "
9286 "occurred.  (The returned value is in host byte order, i.e., the native byte "
9287 "order for integers on the host machine.)"
9288 msgstr ""
9289
9290 #. type: Plain text
9291 #: build/C/man2/timerfd_create.2:237
9292 msgid ""
9293 "If no timer expirations have occurred at the time of the B<read>(2), then "
9294 "the call either blocks until the next timer expiration, or fails with the "
9295 "error B<EAGAIN> if the file descriptor has been made nonblocking (via the "
9296 "use of the B<fcntl>(2)  B<F_SETFL> operation to set the B<O_NONBLOCK> flag)."
9297 msgstr ""
9298
9299 #. type: Plain text
9300 #: build/C/man2/timerfd_create.2:243
9301 msgid ""
9302 "A B<read>(2)  will fail with the error B<EINVAL> if the size of the supplied "
9303 "buffer is less than 8 bytes."
9304 msgstr ""
9305
9306 #. type: Plain text
9307 #: build/C/man2/timerfd_create.2:254
9308 msgid ""
9309 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
9310 "B<poll>(2)  B<POLLIN> flag)  if one or more timer expirations have occurred."
9311 msgstr ""
9312
9313 #. type: Plain text
9314 #: build/C/man2/timerfd_create.2:261
9315 msgid ""
9316 "The file descriptor also supports the other file-descriptor multiplexing "
9317 "APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
9318 msgstr ""
9319
9320 #. type: Plain text
9321 #: build/C/man2/timerfd_create.2:268
9322 msgid ""
9323 "When the file descriptor is no longer required it should be closed.  When "
9324 "all file descriptors associated with the same timer object have been closed, "
9325 "the timer is disarmed and its resources are freed by the kernel."
9326 msgstr ""
9327
9328 #. type: Plain text
9329 #: build/C/man2/timerfd_create.2:280
9330 msgid ""
9331 "After a B<fork>(2), the child inherits a copy of the file descriptor created "
9332 "by B<timerfd_create>().  The file descriptor refers to the same underlying "
9333 "timer object as the corresponding file descriptor in the parent, and "
9334 "B<read>(2)s in the child will return information about expirations of the "
9335 "timer."
9336 msgstr ""
9337
9338 #. type: Plain text
9339 #: build/C/man2/timerfd_create.2:286
9340 msgid ""
9341 "A file descriptor created by B<timerfd_create>()  is preserved across "
9342 "B<execve>(2), and continues to generate timer expirations if the timer was "
9343 "armed."
9344 msgstr ""
9345
9346 #. type: Plain text
9347 #: build/C/man2/timerfd_create.2:293
9348 msgid ""
9349 "On success, B<timerfd_create>()  returns a new file descriptor.  On error, "
9350 "-1 is returned and I<errno> is set to indicate the error."
9351 msgstr ""
9352
9353 #. type: Plain text
9354 #: build/C/man2/timerfd_create.2:301
9355 msgid ""
9356 "B<timerfd_settime>()  and B<timerfd_gettime>()  return 0 on success; on "
9357 "error they return -1, and set I<errno> to indicate the error."
9358 msgstr ""
9359
9360 #. type: Plain text
9361 #: build/C/man2/timerfd_create.2:304
9362 msgid "B<timerfd_create>()  can fail with the following errors:"
9363 msgstr ""
9364
9365 #. type: Plain text
9366 #: build/C/man2/timerfd_create.2:312
9367 msgid "The I<clockid> argument is neither B<CLOCK_MONOTONIC> nor B<CLOCK_REALTIME>;"
9368 msgstr ""
9369
9370 #. type: Plain text
9371 #: build/C/man2/timerfd_create.2:332
9372 msgid "There was insufficient kernel memory to create the timer."
9373 msgstr ""
9374
9375 #. type: Plain text
9376 #: build/C/man2/timerfd_create.2:337
9377 msgid ""
9378 "B<timerfd_settime>()  and B<timerfd_gettime>()  can fail with the following "
9379 "errors:"
9380 msgstr ""
9381
9382 #. type: Plain text
9383 #: build/C/man2/timerfd_create.2:341
9384 msgid "I<fd> is not a valid file descriptor."
9385 msgstr ""
9386
9387 #. type: Plain text
9388 #: build/C/man2/timerfd_create.2:352
9389 msgid "I<fd> is not a valid timerfd file descriptor."
9390 msgstr ""
9391
9392 #. type: Plain text
9393 #: build/C/man2/timerfd_create.2:355
9394 msgid "B<timerfd_settime>()  can also fail with the following errors:"
9395 msgstr ""
9396
9397 #. type: Plain text
9398 #: build/C/man2/timerfd_create.2:361
9399 msgid ""
9400 "I<new_value> is not properly initialized (one of the I<tv_nsec> falls "
9401 "outside the range zero to 999,999,999)."
9402 msgstr ""
9403
9404 #.  This case only checked since 2.6.29, and 2.2.2[78].some-stable-version.
9405 #.  In older kernel versions, no check was made for invalid flags.
9406 #. type: Plain text
9407 #: build/C/man2/timerfd_create.2:367
9408 msgid "I<flags> is invalid."
9409 msgstr ""
9410
9411 #. type: Plain text
9412 #: build/C/man2/timerfd_create.2:370
9413 msgid ""
9414 "These system calls are available on Linux since kernel 2.6.25.  Library "
9415 "support is provided by glibc since version 2.8."
9416 msgstr ""
9417
9418 #. type: Plain text
9419 #: build/C/man2/timerfd_create.2:381
9420 msgid ""
9421 "The following program creates a timer and then monitors its progress.  The "
9422 "program accepts up to three command-line arguments.  The first argument "
9423 "specifies the number of seconds for the initial expiration of the timer.  "
9424 "The second argument specifies the interval for the timer, in seconds.  The "
9425 "third argument specifies the number of times the program should allow the "
9426 "timer to expire before terminating.  The second and third command-line "
9427 "arguments are optional."
9428 msgstr ""
9429
9430 #. type: Plain text
9431 #: build/C/man2/timerfd_create.2:383 build/C/man2/wait.2:541
9432 msgid "The following shell session demonstrates the use of the program:"
9433 msgstr ""
9434
9435 #. type: Plain text
9436 #: build/C/man2/timerfd_create.2:398
9437 #, no-wrap
9438 msgid ""
9439 "$B< a.out 3 1 100>\n"
9440 "0.000: timer started\n"
9441 "3.000: read: 1; total=1\n"
9442 "4.000: read: 1; total=2\n"
9443 "B<^Z >                 # type control-Z to suspend the program\n"
9444 "[1]+  Stopped                 ./timerfd3_demo 3 1 100\n"
9445 "$ B<fg>                # Resume execution after a few seconds\n"
9446 "a.out 3 1 100\n"
9447 "9.660: read: 5; total=7\n"
9448 "10.000: read: 1; total=8\n"
9449 "11.000: read: 1; total=9\n"
9450 "B<^C >                 # type control-C to suspend the program\n"
9451 msgstr ""
9452
9453 #.  The commented out code here is what we currently need until
9454 #.  the required stuff is in glibc
9455 #
9456 #
9457 #. /* Link with -lrt */
9458 #. #define _GNU_SOURCE
9459 #. #include <sys/syscall.h>
9460 #. #include <unistd.h>
9461 #. #include <time.h>
9462 #. #if defined(__i386__)
9463 #. #define __NR_timerfd_create 322
9464 #. #define __NR_timerfd_settime 325
9465 #. #define __NR_timerfd_gettime 326
9466 #. #endif
9467 #
9468 #. static int
9469 #. timerfd_create(int clockid, int flags)
9470 #. {
9471 #.     return syscall(__NR_timerfd_create, clockid, flags);
9472 #. }
9473 #
9474 #. static int
9475 #. timerfd_settime(int fd, int flags, struct itimerspec *new_value,
9476 #.         struct itimerspec *curr_value)
9477 #. {
9478 #.     return syscall(__NR_timerfd_settime, fd, flags, new_value,
9479 #.                    curr_value);
9480 #. }
9481 #
9482 #. static int
9483 #. timerfd_gettime(int fd, struct itimerspec *curr_value)
9484 #. {
9485 #.     return syscall(__NR_timerfd_gettime, fd, curr_value);
9486 #. }
9487 #
9488 #. #define TFD_TIMER_ABSTIME (1 << 0)
9489 #
9490 #. ////////////////////////////////////////////////////////////
9491 #. type: Plain text
9492 #: build/C/man2/timerfd_create.2:447
9493 #, no-wrap
9494 msgid ""
9495 "#include E<lt>sys/timerfd.hE<gt>\n"
9496 "#include E<lt>time.hE<gt>\n"
9497 "#include E<lt>unistd.hE<gt>\n"
9498 "#include E<lt>stdlib.hE<gt>\n"
9499 "#include E<lt>stdio.hE<gt>\n"
9500 "#include E<lt>stdint.hE<gt>        /* Definition of uint64_t */\n"
9501 msgstr ""
9502
9503 #. type: Plain text
9504 #: build/C/man2/timerfd_create.2:450
9505 #, no-wrap
9506 msgid ""
9507 "#define handle_error(msg) \\e\n"
9508 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
9509 msgstr ""
9510
9511 #. type: Plain text
9512 #: build/C/man2/timerfd_create.2:458
9513 #, no-wrap
9514 msgid ""
9515 "static void\n"
9516 "print_elapsed_time(void)\n"
9517 "{\n"
9518 "    static struct timespec start;\n"
9519 "    struct timespec curr;\n"
9520 "    static int first_call = 1;\n"
9521 "    int secs, nsecs;\n"
9522 msgstr ""
9523
9524 #. type: Plain text
9525 #: build/C/man2/timerfd_create.2:464
9526 #, no-wrap
9527 msgid ""
9528 "    if (first_call) {\n"
9529 "        first_call = 0;\n"
9530 "        if (clock_gettime(CLOCK_MONOTONIC, &start) == -1)\n"
9531 "            handle_error(\"clock_gettime\");\n"
9532 "    }\n"
9533 msgstr ""
9534
9535 #. type: Plain text
9536 #: build/C/man2/timerfd_create.2:467
9537 #, no-wrap
9538 msgid ""
9539 "    if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1)\n"
9540 "        handle_error(\"clock_gettime\");\n"
9541 msgstr ""
9542
9543 #. type: Plain text
9544 #: build/C/man2/timerfd_create.2:476
9545 #, no-wrap
9546 msgid ""
9547 "    secs = curr.tv_sec - start.tv_sec;\n"
9548 "    nsecs = curr.tv_nsec - start.tv_nsec;\n"
9549 "    if (nsecs E<lt> 0) {\n"
9550 "        secs--;\n"
9551 "        nsecs += 1000000000;\n"
9552 "    }\n"
9553 "    printf(\"%d.%03d: \", secs, (nsecs + 500000) / 1000000);\n"
9554 "}\n"
9555 msgstr ""
9556
9557 #. type: Plain text
9558 #: build/C/man2/timerfd_create.2:485
9559 #, no-wrap
9560 msgid ""
9561 "int\n"
9562 "main(int argc, char *argv[])\n"
9563 "{\n"
9564 "    struct itimerspec new_value;\n"
9565 "    int max_exp, fd;\n"
9566 "    struct timespec now;\n"
9567 "    uint64_t exp, tot_exp;\n"
9568 "    ssize_t s;\n"
9569 msgstr ""
9570
9571 #. type: Plain text
9572 #: build/C/man2/timerfd_create.2:491
9573 #, no-wrap
9574 msgid ""
9575 "    if ((argc != 2) && (argc != 4)) {\n"
9576 "        fprintf(stderr, \"%s init-secs [interval-secs max-exp]\\en\",\n"
9577 "                argv[0]);\n"
9578 "        exit(EXIT_FAILURE);\n"
9579 "    }\n"
9580 msgstr ""
9581
9582 #. type: Plain text
9583 #: build/C/man2/timerfd_create.2:494
9584 #, no-wrap
9585 msgid ""
9586 "    if (clock_gettime(CLOCK_REALTIME, &now) == -1)\n"
9587 "        handle_error(\"clock_gettime\");\n"
9588 msgstr ""
9589
9590 #. type: Plain text
9591 #: build/C/man2/timerfd_create.2:497
9592 #, no-wrap
9593 msgid ""
9594 "    /* Create a CLOCK_REALTIME absolute timer with initial\n"
9595 "       expiration and interval as specified in command line */\n"
9596 msgstr ""
9597
9598 #. type: Plain text
9599 #: build/C/man2/timerfd_create.2:508
9600 #, no-wrap
9601 msgid ""
9602 "    new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]);\n"
9603 "    new_value.it_value.tv_nsec = now.tv_nsec;\n"
9604 "    if (argc == 2) {\n"
9605 "        new_value.it_interval.tv_sec = 0;\n"
9606 "        max_exp = 1;\n"
9607 "    } else {\n"
9608 "        new_value.it_interval.tv_sec = atoi(argv[2]);\n"
9609 "        max_exp = atoi(argv[3]);\n"
9610 "    }\n"
9611 "    new_value.it_interval.tv_nsec = 0;\n"
9612 msgstr ""
9613
9614 #. type: Plain text
9615 #: build/C/man2/timerfd_create.2:512
9616 #, no-wrap
9617 msgid ""
9618 "    fd = timerfd_create(CLOCK_REALTIME, 0);\n"
9619 "    if (fd == -1)\n"
9620 "        handle_error(\"timerfd_create\");\n"
9621 msgstr ""
9622
9623 #. type: Plain text
9624 #: build/C/man2/timerfd_create.2:515
9625 #, no-wrap
9626 msgid ""
9627 "    if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == -1)\n"
9628 "        handle_error(\"timerfd_settime\");\n"
9629 msgstr ""
9630
9631 #. type: Plain text
9632 #: build/C/man2/timerfd_create.2:518
9633 #, no-wrap
9634 msgid ""
9635 "    print_elapsed_time();\n"
9636 "    printf(\"timer started\\en\");\n"
9637 msgstr ""
9638
9639 #. type: Plain text
9640 #: build/C/man2/timerfd_create.2:523
9641 #, no-wrap
9642 msgid ""
9643 "    for (tot_exp = 0; tot_exp E<lt> max_exp;) {\n"
9644 "        s = read(fd, &exp, sizeof(uint64_t));\n"
9645 "        if (s != sizeof(uint64_t))\n"
9646 "            handle_error(\"read\");\n"
9647 msgstr ""
9648
9649 #. type: Plain text
9650 #: build/C/man2/timerfd_create.2:530
9651 #, no-wrap
9652 msgid ""
9653 "        tot_exp += exp;\n"
9654 "        print_elapsed_time();\n"
9655 "        printf(\"read: %llu; total=%llu\\en\",\n"
9656 "                (unsigned long long) exp,\n"
9657 "                (unsigned long long) tot_exp);\n"
9658 "    }\n"
9659 msgstr ""
9660
9661 #.  2.6.29
9662 #. type: Plain text
9663 #: build/C/man2/timerfd_create.2:540
9664 msgid ""
9665 "Currently, B<timerfd_create>()  supports fewer types of clock IDs than "
9666 "B<timer_create>(2)."
9667 msgstr ""
9668
9669 #. type: Plain text
9670 #: build/C/man2/timerfd_create.2:552
9671 msgid ""
9672 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<setitimer>(2), "
9673 "B<signalfd>(2), B<timer_create>(2), B<timer_gettime>(2), "
9674 "B<timer_settime>(2), B<epoll>(7), B<time>(7)"
9675 msgstr ""
9676
9677 #. type: TH
9678 #: build/C/man2/tkill.2:29
9679 #, no-wrap
9680 msgid "TKILL"
9681 msgstr ""
9682
9683 #. type: Plain text
9684 #: build/C/man2/tkill.2:32
9685 msgid "tkill, tgkill - send a signal to a thread"
9686 msgstr ""
9687
9688 #. type: Plain text
9689 #: build/C/man2/tkill.2:35
9690 #, no-wrap
9691 msgid "B<int tkill(int >I<tid>B<, int >I<sig>B<);>\n"
9692 msgstr ""
9693
9694 #. type: Plain text
9695 #: build/C/man2/tkill.2:37
9696 #, no-wrap
9697 msgid "B<int tgkill(int >I<tgid>B<, int >I<tid>B<, int >I<sig>B<);>\n"
9698 msgstr ""
9699
9700 #. type: Plain text
9701 #: build/C/man2/tkill.2:51
9702 msgid ""
9703 "B<tgkill>()  sends the signal I<sig> to the thread with the thread ID I<tid> "
9704 "in the thread group I<tgid>.  (By contrast, B<kill>(2)  can only be used to "
9705 "send a signal to a process (i.e., thread group)  as a whole, and the signal "
9706 "will be delivered to an arbitrary thread within that process.)"
9707 msgstr ""
9708
9709 #. type: Plain text
9710 #: build/C/man2/tkill.2:59
9711 msgid ""
9712 "B<tkill>()  is an obsolete predecessor to B<tgkill>().  It only allows the "
9713 "target thread ID to be specified, which may result in the wrong thread being "
9714 "signaled if a thread terminates and its thread ID is recycled.  Avoid using "
9715 "this system call."
9716 msgstr ""
9717
9718 #. type: Plain text
9719 #: build/C/man2/tkill.2:66
9720 msgid "If I<tgid> is specified as -1, B<tgkill>()  is equivalent to B<tkill>()."
9721 msgstr ""
9722
9723 #. type: Plain text
9724 #: build/C/man2/tkill.2:69
9725 msgid ""
9726 "These are the raw system call interfaces, meant for internal thread library "
9727 "use."
9728 msgstr ""
9729
9730 #. type: Plain text
9731 #: build/C/man2/tkill.2:77
9732 msgid "An invalid thread ID, thread group ID, or signal was specified."
9733 msgstr ""
9734
9735 #. type: Plain text
9736 #: build/C/man2/tkill.2:82
9737 msgid "Permission denied.  For the required permissions, see B<kill>(2)."
9738 msgstr ""
9739
9740 #. type: Plain text
9741 #: build/C/man2/tkill.2:85
9742 msgid "No process with the specified thread ID (and thread group ID) exists."
9743 msgstr ""
9744
9745 #. type: Plain text
9746 #: build/C/man2/tkill.2:90
9747 msgid ""
9748 "B<tkill>()  is supported since Linux 2.4.19 / 2.5.4.  B<tgkill>()  was added "
9749 "in Linux 2.5.75."
9750 msgstr ""
9751
9752 #. type: Plain text
9753 #: build/C/man2/tkill.2:96
9754 msgid ""
9755 "B<tkill>()  and B<tgkill>()  are Linux-specific and should not be used in "
9756 "programs that are intended to be portable."
9757 msgstr ""
9758
9759 #. type: Plain text
9760 #: build/C/man2/tkill.2:102
9761 msgid ""
9762 "See the description of B<CLONE_THREAD> in B<clone>(2)  for an explanation of "
9763 "thread groups."
9764 msgstr ""
9765
9766 #. type: Plain text
9767 #: build/C/man2/tkill.2:105
9768 msgid ""
9769 "Glibc does not provide wrappers for these system calls; call them using "
9770 "B<syscall>(2)."
9771 msgstr ""
9772
9773 #. type: Plain text
9774 #: build/C/man2/tkill.2:110
9775 msgid "B<clone>(2), B<gettid>(2), B<kill>(2), B<rt_sigqueueinfo>(2)"
9776 msgstr ""
9777
9778 #. type: TH
9779 #: build/C/man2/wait.2:50
9780 #, no-wrap
9781 msgid "WAIT"
9782 msgstr ""
9783
9784 #. type: Plain text
9785 #: build/C/man2/wait.2:53
9786 msgid "wait, waitpid, waitid - wait for process to change state"
9787 msgstr ""
9788
9789 #. type: Plain text
9790 #: build/C/man2/wait.2:55
9791 msgid "B<#include E<lt>sys/types.hE<gt>>"
9792 msgstr ""
9793
9794 #. type: Plain text
9795 #: build/C/man2/wait.2:57
9796 msgid "B<#include E<lt>sys/wait.hE<gt>>"
9797 msgstr ""
9798
9799 #. type: Plain text
9800 #: build/C/man2/wait.2:59
9801 msgid "B<pid_t wait(int *>I<status>B<);>"
9802 msgstr ""
9803
9804 #. type: Plain text
9805 #: build/C/man2/wait.2:61
9806 msgid "B<pid_t waitpid(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<);>"
9807 msgstr ""
9808
9809 #. type: Plain text
9810 #: build/C/man2/wait.2:64
9811 msgid ""
9812 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, "
9813 "int >I<options>B<);>"
9814 msgstr ""
9815
9816 #. type: Plain text
9817 #: build/C/man2/wait.2:73
9818 msgid "B<waitid>():"
9819 msgstr ""
9820
9821 #. type: Plain text
9822 #: build/C/man2/wait.2:77
9823 msgid ""
9824 "_SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
9825 "_XOPEN_SOURCE_EXTENDED"
9826 msgstr ""
9827
9828 #. type: Plain text
9829 #: build/C/man2/wait.2:92
9830 msgid ""
9831 "All of these system calls are used to wait for state changes in a child of "
9832 "the calling process, and obtain information about the child whose state has "
9833 "changed.  A state change is considered to be: the child terminated; the "
9834 "child was stopped by a signal; or the child was resumed by a signal.  In the "
9835 "case of a terminated child, performing a wait allows the system to release "
9836 "the resources associated with the child; if a wait is not performed, then "
9837 "the terminated child remains in a \"zombie\" state (see NOTES below)."
9838 msgstr ""
9839
9840 #. type: Plain text
9841 #: build/C/man2/wait.2:104
9842 msgid ""
9843 "If a child has already changed state, then these calls return immediately.  "
9844 "Otherwise they block until either a child changes state or a signal handler "
9845 "interrupts the call (assuming that system calls are not automatically "
9846 "restarted using the B<SA_RESTART> flag of B<sigaction>(2)).  In the "
9847 "remainder of this page, a child whose state has changed and which has not "
9848 "yet been waited upon by one of these system calls is termed I<waitable>."
9849 msgstr ""
9850
9851 #. type: SS
9852 #: build/C/man2/wait.2:104
9853 #, no-wrap
9854 msgid "wait() and waitpid()"
9855 msgstr ""
9856
9857 #. type: Plain text
9858 #: build/C/man2/wait.2:112
9859 msgid ""
9860 "The B<wait>()  system call suspends execution of the calling process until "
9861 "one of its children terminates.  The call I<wait(&status)> is equivalent to:"
9862 msgstr ""
9863
9864 #. type: Plain text
9865 #: build/C/man2/wait.2:115
9866 #, no-wrap
9867 msgid "    waitpid(-1, &status, 0);\n"
9868 msgstr ""
9869
9870 #. type: Plain text
9871 #: build/C/man2/wait.2:129
9872 msgid ""
9873 "The B<waitpid>()  system call suspends execution of the calling process "
9874 "until a child specified by I<pid> argument has changed state.  By default, "
9875 "B<waitpid>()  waits only for terminated children, but this behavior is "
9876 "modifiable via the I<options> argument, as described below."
9877 msgstr ""
9878
9879 #. type: Plain text
9880 #: build/C/man2/wait.2:133
9881 msgid "The value of I<pid> can be:"
9882 msgstr ""
9883
9884 #. type: IP
9885 #: build/C/man2/wait.2:133
9886 #, no-wrap
9887 msgid "E<lt> -1"
9888 msgstr ""
9889
9890 #. type: Plain text
9891 #: build/C/man2/wait.2:137
9892 msgid ""
9893 "meaning wait for any child process whose process group ID is equal to the "
9894 "absolute value of I<pid>."
9895 msgstr ""
9896
9897 #. type: IP
9898 #: build/C/man2/wait.2:137
9899 #, no-wrap
9900 msgid "-1"
9901 msgstr ""
9902
9903 #. type: Plain text
9904 #: build/C/man2/wait.2:139
9905 msgid "meaning wait for any child process."
9906 msgstr ""
9907
9908 #. type: IP
9909 #: build/C/man2/wait.2:139
9910 #, no-wrap
9911 msgid "0"
9912 msgstr ""
9913
9914 #. type: Plain text
9915 #: build/C/man2/wait.2:142
9916 msgid ""
9917 "meaning wait for any child process whose process group ID is equal to that "
9918 "of the calling process."
9919 msgstr ""
9920
9921 #. type: IP
9922 #: build/C/man2/wait.2:142
9923 #, no-wrap
9924 msgid "E<gt> 0"
9925 msgstr ""
9926
9927 #. type: Plain text
9928 #: build/C/man2/wait.2:146
9929 msgid "meaning wait for the child whose process ID is equal to the value of I<pid>."
9930 msgstr ""
9931
9932 #. type: Plain text
9933 #: build/C/man2/wait.2:150
9934 msgid "The value of I<options> is an OR of zero or more of the following constants:"
9935 msgstr ""
9936
9937 #. type: TP
9938 #: build/C/man2/wait.2:150 build/C/man2/wait.2:279
9939 #, no-wrap
9940 msgid "B<WNOHANG>"
9941 msgstr ""
9942
9943 #. type: Plain text
9944 #: build/C/man2/wait.2:153
9945 msgid "return immediately if no child has exited."
9946 msgstr ""
9947
9948 #. type: TP
9949 #: build/C/man2/wait.2:153
9950 #, no-wrap
9951 msgid "B<WUNTRACED>"
9952 msgstr ""
9953
9954 #. type: Plain text
9955 #: build/C/man2/wait.2:162
9956 msgid ""
9957 "also return if a child has stopped (but not traced via B<ptrace>(2)).  "
9958 "Status for I<traced> children which have stopped is provided even if this "
9959 "option is not specified."
9960 msgstr ""
9961
9962 #. type: TP
9963 #: build/C/man2/wait.2:162
9964 #, no-wrap
9965 msgid "B<WCONTINUED> (since Linux 2.6.10)"
9966 msgstr ""
9967
9968 #. type: Plain text
9969 #: build/C/man2/wait.2:166
9970 msgid "also return if a stopped child has been resumed by delivery of B<SIGCONT>."
9971 msgstr ""
9972
9973 #. type: Plain text
9974 #: build/C/man2/wait.2:168
9975 msgid "(For Linux-only options, see below.)"
9976 msgstr ""
9977
9978 #. type: Plain text
9979 #: build/C/man2/wait.2:182
9980 msgid ""
9981 "If I<status> is not NULL, B<wait>()  and B<waitpid>()  store status "
9982 "information in the I<int> to which it points.  This integer can be inspected "
9983 "with the following macros (which take the integer itself as an argument, not "
9984 "a pointer to it, as is done in B<wait>()  and B<waitpid>()!):"
9985 msgstr ""
9986
9987 #. type: TP
9988 #: build/C/man2/wait.2:182
9989 #, no-wrap
9990 msgid "B<WIFEXITED(>I<status>B<)>"
9991 msgstr ""
9992
9993 #. type: Plain text
9994 #: build/C/man2/wait.2:190
9995 msgid ""
9996 "returns true if the child terminated normally, that is, by calling "
9997 "B<exit>(3)  or B<_exit>(2), or by returning from main()."
9998 msgstr ""
9999
10000 #. type: TP
10001 #: build/C/man2/wait.2:190
10002 #, no-wrap
10003 msgid "B<WEXITSTATUS(>I<status>B<)>"
10004 msgstr ""
10005
10006 #. type: Plain text
10007 #: build/C/man2/wait.2:203
10008 msgid ""
10009 "returns the exit status of the child.  This consists of the least "
10010 "significant 8 bits of the I<status> argument that the child specified in a "
10011 "call to B<exit>(3)  or B<_exit>(2)  or as the argument for a return "
10012 "statement in main().  This macro should only be employed if B<WIFEXITED> "
10013 "returned true."
10014 msgstr ""
10015
10016 #. type: TP
10017 #: build/C/man2/wait.2:203
10018 #, no-wrap
10019 msgid "B<WIFSIGNALED(>I<status>B<)>"
10020 msgstr ""
10021
10022 #. type: Plain text
10023 #: build/C/man2/wait.2:206
10024 msgid "returns true if the child process was terminated by a signal."
10025 msgstr ""
10026
10027 #. type: TP
10028 #: build/C/man2/wait.2:206
10029 #, no-wrap
10030 msgid "B<WTERMSIG(>I<status>B<)>"
10031 msgstr ""
10032
10033 #. type: Plain text
10034 #: build/C/man2/wait.2:213
10035 msgid ""
10036 "returns the number of the signal that caused the child process to "
10037 "terminate.  This macro should only be employed if B<WIFSIGNALED> returned "
10038 "true."
10039 msgstr ""
10040
10041 #. type: TP
10042 #: build/C/man2/wait.2:213
10043 #, no-wrap
10044 msgid "B<WCOREDUMP(>I<status>B<)>"
10045 msgstr ""
10046
10047 #. type: Plain text
10048 #: build/C/man2/wait.2:222
10049 msgid ""
10050 "returns true if the child produced a core dump.  This macro should only be "
10051 "employed if B<WIFSIGNALED> returned true.  This macro is not specified in "
10052 "POSIX.1-2001 and is not available on some UNIX implementations (e.g., AIX, "
10053 "SunOS).  Only use this enclosed in #ifdef WCOREDUMP ... #endif."
10054 msgstr ""
10055
10056 #. type: TP
10057 #: build/C/man2/wait.2:222
10058 #, no-wrap
10059 msgid "B<WIFSTOPPED(>I<status>B<)>"
10060 msgstr ""
10061
10062 #. type: Plain text
10063 #: build/C/man2/wait.2:229
10064 msgid ""
10065 "returns true if the child process was stopped by delivery of a signal; this "
10066 "is only possible if the call was done using B<WUNTRACED> or when the child "
10067 "is being traced (see B<ptrace>(2))."
10068 msgstr ""
10069
10070 #. type: TP
10071 #: build/C/man2/wait.2:229
10072 #, no-wrap
10073 msgid "B<WSTOPSIG(>I<status>B<)>"
10074 msgstr ""
10075
10076 #. type: Plain text
10077 #: build/C/man2/wait.2:235
10078 msgid ""
10079 "returns the number of the signal which caused the child to stop.  This macro "
10080 "should only be employed if B<WIFSTOPPED> returned true."
10081 msgstr ""
10082
10083 #. type: TP
10084 #: build/C/man2/wait.2:235
10085 #, no-wrap
10086 msgid "B<WIFCONTINUED(>I<status>B<)>"
10087 msgstr ""
10088
10089 #. type: Plain text
10090 #: build/C/man2/wait.2:240
10091 msgid ""
10092 "(since Linux 2.6.10)  returns true if the child process was resumed by "
10093 "delivery of B<SIGCONT>."
10094 msgstr ""
10095
10096 #. type: SS
10097 #: build/C/man2/wait.2:240
10098 #, no-wrap
10099 msgid "waitid()"
10100 msgstr ""
10101
10102 #. type: Plain text
10103 #: build/C/man2/wait.2:245
10104 msgid ""
10105 "The B<waitid>()  system call (available since Linux 2.6.9) provides more "
10106 "precise control over which child state changes to wait for."
10107 msgstr ""
10108
10109 #. type: Plain text
10110 #: build/C/man2/wait.2:251
10111 msgid ""
10112 "The I<idtype> and I<id> arguments select the child(ren) to wait for, as "
10113 "follows:"
10114 msgstr ""
10115
10116 #. type: IP
10117 #: build/C/man2/wait.2:251
10118 #, no-wrap
10119 msgid "I<idtype> == B<P_PID>"
10120 msgstr ""
10121
10122 #. type: Plain text
10123 #: build/C/man2/wait.2:254
10124 msgid "Wait for the child whose process ID matches I<id>."
10125 msgstr ""
10126
10127 #. type: IP
10128 #: build/C/man2/wait.2:254
10129 #, no-wrap
10130 msgid "I<idtype> == B<P_PGID>"
10131 msgstr ""
10132
10133 #. type: Plain text
10134 #: build/C/man2/wait.2:257
10135 msgid "Wait for any child whose process group ID matches I<id>."
10136 msgstr ""
10137
10138 #. type: IP
10139 #: build/C/man2/wait.2:257
10140 #, no-wrap
10141 msgid "I<idtype> == B<P_ALL>"
10142 msgstr ""
10143
10144 #. type: Plain text
10145 #: build/C/man2/wait.2:261
10146 msgid "Wait for any child; I<id> is ignored."
10147 msgstr ""
10148
10149 #. type: Plain text
10150 #: build/C/man2/wait.2:265
10151 msgid ""
10152 "The child state changes to wait for are specified by ORing one or more of "
10153 "the following flags in I<options>:"
10154 msgstr ""
10155
10156 #. type: TP
10157 #: build/C/man2/wait.2:265
10158 #, no-wrap
10159 msgid "B<WEXITED>"
10160 msgstr ""
10161
10162 #. type: Plain text
10163 #: build/C/man2/wait.2:268
10164 msgid "Wait for children that have terminated."
10165 msgstr ""
10166
10167 #. type: TP
10168 #: build/C/man2/wait.2:268
10169 #, no-wrap
10170 msgid "B<WSTOPPED>"
10171 msgstr ""
10172
10173 #. type: Plain text
10174 #: build/C/man2/wait.2:271
10175 msgid "Wait for children that have been stopped by delivery of a signal."
10176 msgstr ""
10177
10178 #. type: TP
10179 #: build/C/man2/wait.2:271
10180 #, no-wrap
10181 msgid "B<WCONTINUED>"
10182 msgstr ""
10183
10184 #. type: Plain text
10185 #: build/C/man2/wait.2:276
10186 msgid ""
10187 "Wait for (previously stopped) children that have been resumed by delivery of "
10188 "B<SIGCONT>."
10189 msgstr ""
10190
10191 #. type: Plain text
10192 #: build/C/man2/wait.2:279
10193 msgid "The following flags may additionally be ORed in I<options>:"
10194 msgstr ""
10195
10196 #. type: Plain text
10197 #: build/C/man2/wait.2:283
10198 msgid "As for B<waitpid>()."
10199 msgstr ""
10200
10201 #. type: TP
10202 #: build/C/man2/wait.2:283
10203 #, no-wrap
10204 msgid "B<WNOWAIT>"
10205 msgstr ""
10206
10207 #. type: Plain text
10208 #: build/C/man2/wait.2:287
10209 msgid ""
10210 "Leave the child in a waitable state; a later wait call can be used to again "
10211 "retrieve the child status information."
10212 msgstr ""
10213
10214 #. type: Plain text
10215 #: build/C/man2/wait.2:294
10216 msgid ""
10217 "Upon successful return, B<waitid>()  fills in the following fields of the "
10218 "I<siginfo_t> structure pointed to by I<infop>:"
10219 msgstr ""
10220
10221 #. type: Plain text
10222 #: build/C/man2/wait.2:297
10223 msgid "The process ID of the child."
10224 msgstr ""
10225
10226 #. type: Plain text
10227 #: build/C/man2/wait.2:301
10228 msgid ""
10229 "The real user ID of the child.  (This field is not set on most other "
10230 "implementations.)"
10231 msgstr ""
10232
10233 #. type: Plain text
10234 #: build/C/man2/wait.2:305
10235 msgid "Always set to B<SIGCHLD>."
10236 msgstr ""
10237
10238 #. type: TP
10239 #: build/C/man2/wait.2:305
10240 #, no-wrap
10241 msgid "I<si_status>"
10242 msgstr ""
10243
10244 #. type: Plain text
10245 #: build/C/man2/wait.2:315
10246 msgid ""
10247 "Either the exit status of the child, as given to B<_exit>(2)  (or "
10248 "B<exit>(3)), or the signal that caused the child to terminate, stop, or "
10249 "continue.  The I<si_code> field can be used to determine how to interpret "
10250 "this field."
10251 msgstr ""
10252
10253 #. type: Plain text
10254 #: build/C/man2/wait.2:332
10255 msgid ""
10256 "Set to one of: B<CLD_EXITED> (child called B<_exit>(2)); B<CLD_KILLED> "
10257 "(child killed by signal); B<CLD_DUMPED> (child killed by signal, and dumped "
10258 "core); B<CLD_STOPPED> (child stopped by signal); B<CLD_TRAPPED> (traced "
10259 "child has trapped); or B<CLD_CONTINUED> (child continued by B<SIGCONT>)."
10260 msgstr ""
10261
10262 #.  POSIX.1-2001 leaves this possibility unspecified; most
10263 #.  implementations (including Linux) zero out the structure
10264 #.  in this case, but at least one implementation (AIX 5.1)
10265 #.  does not -- MTK Nov 04
10266 #. type: Plain text
10267 #: build/C/man2/wait.2:354
10268 msgid ""
10269 "If B<WNOHANG> was specified in I<options> and there were no children in a "
10270 "waitable state, then B<waitid>()  returns 0 immediately and the state of the "
10271 "I<siginfo_t> structure pointed to by I<infop> is unspecified.  To "
10272 "distinguish this case from that where a child was in a waitable state, zero "
10273 "out the I<si_pid> field before the call and check for a nonzero value in "
10274 "this field after the call returns."
10275 msgstr ""
10276
10277 #. type: Plain text
10278 #: build/C/man2/wait.2:358
10279 msgid ""
10280 "B<wait>(): on success, returns the process ID of the terminated child; on "
10281 "error, -1 is returned."
10282 msgstr ""
10283
10284 #. type: Plain text
10285 #: build/C/man2/wait.2:367
10286 msgid ""
10287 "B<waitpid>(): on success, returns the process ID of the child whose state "
10288 "has changed; if B<WNOHANG> was specified and one or more child(ren) "
10289 "specified by I<pid> exist, but have not yet changed state, then 0 is "
10290 "returned.  On error, -1 is returned."
10291 msgstr ""
10292
10293 #.  FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid()
10294 #.  returns the PID of the child.  Either this is a bug, or it is intended
10295 #.  behavior that needs to be documented.  See my Jan 2009 LKML mail
10296 #.  "waitid() return value strangeness when infop is NULL".
10297 #. type: Plain text
10298 #: build/C/man2/wait.2:383
10299 msgid ""
10300 "B<waitid>(): returns 0 on success or if B<WNOHANG> was specified and no "
10301 "child(ren) specified by I<id> has yet changed state; on error, -1 is "
10302 "returned.  Each of these calls sets I<errno> to an appropriate value in the "
10303 "case of an error."
10304 msgstr ""
10305
10306 #. type: TP
10307 #: build/C/man2/wait.2:384 build/C/man2/wait.2:389
10308 #, no-wrap
10309 msgid "B<ECHILD>"
10310 msgstr ""
10311
10312 #. type: Plain text
10313 #: build/C/man2/wait.2:389
10314 msgid ""
10315 "(for B<wait>())  The calling process does not have any unwaited-for "
10316 "children."
10317 msgstr ""
10318
10319 #. type: Plain text
10320 #: build/C/man2/wait.2:409
10321 msgid ""
10322 "(for B<waitpid>()  or B<waitid>())  The process specified by I<pid> "
10323 "(B<waitpid>())  or I<idtype> and I<id> (B<waitid>())  does not exist or is "
10324 "not a child of the calling process.  (This can happen for one's own child if "
10325 "the action for B<SIGCHLD> is set to B<SIG_IGN>.  See also the I<Linux Notes> "
10326 "section about threads.)"
10327 msgstr ""
10328
10329 #. type: Plain text
10330 #: build/C/man2/wait.2:416
10331 msgid ""
10332 "B<WNOHANG> was not set and an unblocked signal or a B<SIGCHLD> was caught; "
10333 "see B<signal>(7)."
10334 msgstr ""
10335
10336 #. type: Plain text
10337 #: build/C/man2/wait.2:421
10338 msgid "The I<options> argument was invalid."
10339 msgstr ""
10340
10341 #. type: Plain text
10342 #: build/C/man2/wait.2:436
10343 msgid ""
10344 "A child that terminates, but has not been waited for becomes a \"zombie\".  "
10345 "The kernel maintains a minimal set of information about the zombie process "
10346 "(PID, termination status, resource usage information)  in order to allow the "
10347 "parent to later perform a wait to obtain information about the child.  As "
10348 "long as a zombie is not removed from the system via a wait, it will consume "
10349 "a slot in the kernel process table, and if this table fills, it will not be "
10350 "possible to create further processes.  If a parent process terminates, then "
10351 "its \"zombie\" children (if any)  are adopted by B<init>(8), which "
10352 "automatically performs a wait to remove the zombies."
10353 msgstr ""
10354
10355 #. type: Plain text
10356 #: build/C/man2/wait.2:477
10357 msgid ""
10358 "POSIX.1-2001 specifies that if the disposition of B<SIGCHLD> is set to "
10359 "B<SIG_IGN> or the B<SA_NOCLDWAIT> flag is set for B<SIGCHLD> (see "
10360 "B<sigaction>(2)), then children that terminate do not become zombies and a "
10361 "call to B<wait>()  or B<waitpid>()  will block until all children have "
10362 "terminated, and then fail with I<errno> set to B<ECHILD>.  (The original "
10363 "POSIX standard left the behavior of setting B<SIGCHLD> to B<SIG_IGN> "
10364 "unspecified.  Note that even though the default disposition of B<SIGCHLD> is "
10365 "\"ignore\", explicitly setting the disposition to B<SIG_IGN> results in "
10366 "different treatment of zombie process children.)  Linux 2.6 conforms to this "
10367 "specification.  However, Linux 2.4 (and earlier) does not: if a B<wait>()  "
10368 "or B<waitpid>()  call is made while B<SIGCHLD> is being ignored, the call "
10369 "behaves just as though B<SIGCHLD> were not being ignored, that is, the call "
10370 "blocks until the next child terminates and then returns the process ID and "
10371 "status of that child."
10372 msgstr ""
10373
10374 #. type: Plain text
10375 #: build/C/man2/wait.2:493
10376 msgid ""
10377 "In the Linux kernel, a kernel-scheduled thread is not a distinct construct "
10378 "from a process.  Instead, a thread is simply a process that is created using "
10379 "the Linux-unique B<clone>(2)  system call; other routines such as the "
10380 "portable B<pthread_create>(3)  call are implemented using B<clone>(2).  "
10381 "Before Linux 2.4, a thread was just a special case of a process, and as a "
10382 "consequence one thread could not wait on the children of another thread, "
10383 "even when the latter belongs to the same thread group.  However, POSIX "
10384 "prescribes such functionality, and since Linux 2.4 a thread can, and by "
10385 "default will, wait on children of other threads in the same thread group."
10386 msgstr ""
10387
10388 #. type: Plain text
10389 #: build/C/man2/wait.2:500
10390 msgid ""
10391 "The following Linux-specific I<options> are for use with children created "
10392 "using B<clone>(2); they cannot be used with B<waitid>():"
10393 msgstr ""
10394
10395 #. type: TP
10396 #: build/C/man2/wait.2:500
10397 #, no-wrap
10398 msgid "B<__WCLONE>"
10399 msgstr ""
10400
10401 #.  since 0.99pl10
10402 #. type: Plain text
10403 #: build/C/man2/wait.2:511
10404 msgid ""
10405 "Wait for \"clone\" children only.  If omitted then wait for \"non-clone\" "
10406 "children only.  (A \"clone\" child is one which delivers no signal, or a "
10407 "signal other than B<SIGCHLD> to its parent upon termination.)  This option "
10408 "is ignored if B<__WALL> is also specified."
10409 msgstr ""
10410
10411 #. type: TP
10412 #: build/C/man2/wait.2:511
10413 #, no-wrap
10414 msgid "B<__WALL> (since Linux 2.4)"
10415 msgstr ""
10416
10417 #.  since patch-2.3.48
10418 #. type: Plain text
10419 #: build/C/man2/wait.2:516
10420 msgid "Wait for all children, regardless of type (\"clone\" or \"non-clone\")."
10421 msgstr ""
10422
10423 #. type: TP
10424 #: build/C/man2/wait.2:516
10425 #, no-wrap
10426 msgid "B<__WNOTHREAD> (since Linux 2.4)"
10427 msgstr ""
10428
10429 #.  since patch-2.4.0-test8
10430 #. type: Plain text
10431 #: build/C/man2/wait.2:522
10432 msgid ""
10433 "Do not wait for children of other threads in the same thread group.  This "
10434 "was the default before Linux 2.4."
10435 msgstr ""
10436
10437 #.  fork.2 refers to this example program.
10438 #. type: Plain text
10439 #: build/C/man2/wait.2:539
10440 msgid ""
10441 "The following program demonstrates the use of B<fork>(2)  and B<waitpid>().  "
10442 "The program creates a child process.  If no command-line argument is "
10443 "supplied to the program, then the child suspends its execution using "
10444 "B<pause>(2), to allow the user to send signals to the child.  Otherwise, if "
10445 "a command-line argument is supplied, then the child exits immediately, using "
10446 "the integer supplied on the command line as the exit status.  The parent "
10447 "process executes a loop that monitors the child using B<waitpid>(), and uses "
10448 "the W*() macros described above to analyze the wait status value."
10449 msgstr ""
10450
10451 #. type: Plain text
10452 #: build/C/man2/wait.2:555
10453 #, no-wrap
10454 msgid ""
10455 "$B< ./a.out &>\n"
10456 "Child PID is 32360\n"
10457 "[1] 32359\n"
10458 "$B< kill -STOP 32360>\n"
10459 "stopped by signal 19\n"
10460 "$B< kill -CONT 32360>\n"
10461 "continued\n"
10462 "$B< kill -TERM 32360>\n"
10463 "killed by signal 15\n"
10464 "[1]+  Done                    ./a.out\n"
10465 "$\n"
10466 msgstr ""
10467
10468 #. type: Plain text
10469 #: build/C/man2/wait.2:564
10470 #, no-wrap
10471 msgid ""
10472 "#include E<lt>sys/wait.hE<gt>\n"
10473 "#include E<lt>stdlib.hE<gt>\n"
10474 "#include E<lt>unistd.hE<gt>\n"
10475 "#include E<lt>stdio.hE<gt>\n"
10476 msgstr ""
10477
10478 #. type: Plain text
10479 #: build/C/man2/wait.2:570
10480 #, no-wrap
10481 msgid ""
10482 "int\n"
10483 "main(int argc, char *argv[])\n"
10484 "{\n"
10485 "    pid_t cpid, w;\n"
10486 "    int status;\n"
10487 msgstr ""
10488
10489 #. type: Plain text
10490 #: build/C/man2/wait.2:576
10491 #, no-wrap
10492 msgid ""
10493 "    cpid = fork();\n"
10494 "    if (cpid == -1) {\n"
10495 "        perror(\"fork\");\n"
10496 "        exit(EXIT_FAILURE);\n"
10497 "    }\n"
10498 msgstr ""
10499
10500 #. type: Plain text
10501 #: build/C/man2/wait.2:582
10502 #, no-wrap
10503 msgid ""
10504 "    if (cpid == 0) {            /* Code executed by child */\n"
10505 "        printf(\"Child PID is %ld\\en\", (long) getpid());\n"
10506 "        if (argc == 1)\n"
10507 "            pause();                    /* Wait for signals */\n"
10508 "        _exit(atoi(argv[1]));\n"
10509 msgstr ""
10510
10511 #. type: Plain text
10512 #: build/C/man2/wait.2:590
10513 #, no-wrap
10514 msgid ""
10515 "    } else {                    /* Code executed by parent */\n"
10516 "        do {\n"
10517 "            w = waitpid(cpid, &status, WUNTRACED | WCONTINUED);\n"
10518 "            if (w == -1) {\n"
10519 "                perror(\"waitpid\");\n"
10520 "                exit(EXIT_FAILURE);\n"
10521 "            }\n"
10522 msgstr ""
10523
10524 #. type: Plain text
10525 #: build/C/man2/wait.2:604
10526 #, no-wrap
10527 msgid ""
10528 "            if (WIFEXITED(status)) {\n"
10529 "                printf(\"exited, status=%d\\en\", WEXITSTATUS(status));\n"
10530 "            } else if (WIFSIGNALED(status)) {\n"
10531 "                printf(\"killed by signal %d\\en\", WTERMSIG(status));\n"
10532 "            } else if (WIFSTOPPED(status)) {\n"
10533 "                printf(\"stopped by signal %d\\en\", WSTOPSIG(status));\n"
10534 "            } else if (WIFCONTINUED(status)) {\n"
10535 "                printf(\"continued\\en\");\n"
10536 "            }\n"
10537 "        } while (!WIFEXITED(status) && !WIFSIGNALED(status));\n"
10538 "        exit(EXIT_SUCCESS);\n"
10539 "    }\n"
10540 "}\n"
10541 msgstr ""
10542
10543 #. type: Plain text
10544 #: build/C/man2/wait.2:617
10545 msgid ""
10546 "B<_exit>(2), B<clone>(2), B<fork>(2), B<kill>(2), B<ptrace>(2), "
10547 "B<sigaction>(2), B<signal>(2), B<wait4>(2), B<pthread_create>(3), "
10548 "B<credentials>(7), B<signal>(7)"
10549 msgstr ""
10550
10551 #. type: TH
10552 #: build/C/man2/wait4.2:34
10553 #, no-wrap
10554 msgid "WAIT4"
10555 msgstr ""
10556
10557 #. type: Plain text
10558 #: build/C/man2/wait4.2:37
10559 msgid "wait3, wait4 - wait for process to change state, BSD style"
10560 msgstr ""
10561
10562 #. type: Plain text
10563 #: build/C/man2/wait4.2:43
10564 #, no-wrap
10565 msgid ""
10566 "B<#include E<lt>sys/types.hE<gt>>\n"
10567 "B<#include E<lt>sys/time.hE<gt>>\n"
10568 "B<#include E<lt>sys/resource.hE<gt>>\n"
10569 "B<#include E<lt>sys/wait.hE<gt>>\n"
10570 msgstr ""
10571
10572 #. type: Plain text
10573 #: build/C/man2/wait4.2:46
10574 #, no-wrap
10575 msgid ""
10576 "B<pid_t wait3(int *>I<status>B<, int >I<options>B<,>\n"
10577 "B<            struct rusage *>I<rusage>B<);>\n"
10578 msgstr ""
10579
10580 #. type: Plain text
10581 #: build/C/man2/wait4.2:49
10582 #, no-wrap
10583 msgid ""
10584 "B<pid_t wait4(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<,>\n"
10585 "B<            struct rusage *>I<rusage>B<);>\n"
10586 msgstr ""
10587
10588 #. type: Plain text
10589 #: build/C/man2/wait4.2:58
10590 msgid "B<wait3>():"
10591 msgstr ""
10592
10593 #. type: Plain text
10594 #: build/C/man2/wait4.2:64
10595 msgid "B<wait4>():"
10596 msgstr ""
10597
10598 #. type: Plain text
10599 #: build/C/man2/wait4.2:66
10600 msgid "_BSD_SOURCE"
10601 msgstr ""
10602
10603 #. type: Plain text
10604 #: build/C/man2/wait4.2:78
10605 msgid ""
10606 "The B<wait3>()  and B<wait4>()  system calls are similar to B<waitpid>(2), "
10607 "but additionally return resource usage information about the child in the "
10608 "structure pointed to by I<rusage>."
10609 msgstr ""
10610
10611 #. type: Plain text
10612 #: build/C/man2/wait4.2:84
10613 msgid ""
10614 "Other than the use of the I<rusage> argument, the following B<wait3>()  "
10615 "call:"
10616 msgstr ""
10617
10618 #. type: Plain text
10619 #: build/C/man2/wait4.2:87
10620 #, no-wrap
10621 msgid "    wait3(status, options, rusage);\n"
10622 msgstr ""
10623
10624 #. type: Plain text
10625 #: build/C/man2/wait4.2:90 build/C/man2/wait4.2:104
10626 msgid "is equivalent to:"
10627 msgstr ""
10628
10629 #. type: Plain text
10630 #: build/C/man2/wait4.2:93
10631 #, no-wrap
10632 msgid "    waitpid(-1, status, options);\n"
10633 msgstr ""
10634
10635 #. type: Plain text
10636 #: build/C/man2/wait4.2:98
10637 msgid "Similarly, the following B<wait4>()  call:"
10638 msgstr ""
10639
10640 #. type: Plain text
10641 #: build/C/man2/wait4.2:101
10642 #, no-wrap
10643 msgid "    wait4(pid, status, options, rusage);\n"
10644 msgstr ""
10645
10646 #. type: Plain text
10647 #: build/C/man2/wait4.2:107
10648 #, no-wrap
10649 msgid "    waitpid(pid, status, options);\n"
10650 msgstr ""
10651
10652 #. type: Plain text
10653 #: build/C/man2/wait4.2:117
10654 msgid ""
10655 "In other words, B<wait3>()  waits of any child, while B<wait4>()  can be "
10656 "used to select a specific child, or children, on which to wait.  See "
10657 "B<wait>(2)  for further details."
10658 msgstr ""
10659
10660 #. type: Plain text
10661 #: build/C/man2/wait4.2:127
10662 msgid ""
10663 "If I<rusage> is not NULL, the I<struct rusage> to which it points will be "
10664 "filled with accounting information about the child.  See B<getrusage>(2)  "
10665 "for details."
10666 msgstr ""
10667
10668 #. type: Plain text
10669 #: build/C/man2/wait4.2:130 build/C/man2/wait4.2:133
10670 msgid "As for B<waitpid>(2)."
10671 msgstr ""
10672
10673 #. type: Plain text
10674 #: build/C/man2/wait4.2:135
10675 msgid "4.3BSD."
10676 msgstr ""
10677
10678 #. type: Plain text
10679 #: build/C/man2/wait4.2:147
10680 msgid ""
10681 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
10682 "portability.  (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
10683 "structure with fields of type I<struct timeval> defined in "
10684 "I<E<lt>sys/time.hE<gt>>.)"
10685 msgstr ""
10686
10687 #. type: Plain text
10688 #: build/C/man2/wait4.2:153
10689 msgid ""
10690 "On Linux, B<wait3>()  is a library function implemented on top of the "
10691 "B<wait4>()  system call."
10692 msgstr ""
10693
10694 #. type: Plain text
10695 #: build/C/man2/wait4.2:160
10696 msgid ""
10697 "B<fork>(2), B<getrusage>(2), B<sigaction>(2), B<signal>(2), B<wait>(2), "
10698 "B<signal>(7)"
10699 msgstr ""