OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.54
[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: 2013-09-28 04:06+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:25
21 #, no-wrap
22 msgid "BSD_SIGNAL"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/bsd_signal.3:25
27 #, no-wrap
28 msgid "2009-03-15"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/bsd_signal.3:25 build/C/man2/eventfd.2:22 build/C/man2/getitimer.2:12 build/C/man3/gsignal.3:27 build/C/man2/kill.2:44 build/C/man2/killpg.2:42 build/C/man2/pause.2:30 build/C/man2/prctl.2:52 build/C/man3/profil.3:28 build/C/man3/psignal.3:30 build/C/man3/raise.3:29 build/C/man2/restart_syscall.2:33 build/C/man2/rt_sigqueueinfo.2:25 build/C/man2/s390_runtime_instr.2:25 build/C/man2/sgetmask.2:26 build/C/man2/sigaction.2:47 build/C/man2/sigaltstack.2:27 build/C/man7/sigevent.7:26 build/C/man3/siginterrupt.3:31 build/C/man2/signal.2:36 build/C/man7/signal.7:46 build/C/man2/signalfd.2:20 build/C/man3/sigpause.3:25 build/C/man2/sigpending.2:29 build/C/man2/sigprocmask.2:29 build/C/man3/sigqueue.3:28 build/C/man2/sigreturn.2:29 build/C/man3/sigset.3:26 build/C/man3/sigsetops.3:31 build/C/man2/sigsuspend.2:29 build/C/man3/sigvec.3:26 build/C/man3/sigwait.3:26 build/C/man2/sigwaitinfo.2:25 build/C/man3/sysv_signal.3:25 build/C/man2/timer_create.2:31 build/C/man2/timer_delete.2:26 build/C/man2/timer_getoverrun.2:26 build/C/man2/timer_settime.2:26 build/C/man2/timerfd_create.2:21 build/C/man2/tkill.2:29 build/C/man2/wait.2:49 build/C/man2/wait4.2:33
33 #, no-wrap
34 msgid "Linux Programmer's Manual"
35 msgstr ""
36
37 #. type: SH
38 #: build/C/man3/bsd_signal.3:26 build/C/man2/eventfd.2:23 build/C/man2/getitimer.2:13 build/C/man3/gsignal.3:28 build/C/man2/kill.2:45 build/C/man2/killpg.2:43 build/C/man2/pause.2:31 build/C/man2/prctl.2:53 build/C/man3/profil.3:29 build/C/man3/psignal.3:31 build/C/man3/raise.3:30 build/C/man2/restart_syscall.2:34 build/C/man2/rt_sigqueueinfo.2:26 build/C/man2/s390_runtime_instr.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/man7/signal.7:47 build/C/man2/signalfd.2:21 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:32 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:27 build/C/man2/timer_getoverrun.2:27 build/C/man2/timer_settime.2:27 build/C/man2/timerfd_create.2:22 build/C/man2/tkill.2:30 build/C/man2/wait.2:50 build/C/man2/wait4.2:34
39 #, no-wrap
40 msgid "NAME"
41 msgstr ""
42
43 #. type: Plain text
44 #: build/C/man3/bsd_signal.3:28
45 msgid "bsd_signal - signal handling with BSD semantics"
46 msgstr ""
47
48 #. type: SH
49 #: build/C/man3/bsd_signal.3:28 build/C/man2/eventfd.2:25 build/C/man2/getitimer.2:15 build/C/man3/gsignal.3:30 build/C/man2/kill.2:47 build/C/man2/killpg.2:45 build/C/man2/pause.2:33 build/C/man2/prctl.2:55 build/C/man3/profil.3:31 build/C/man3/psignal.3:33 build/C/man3/raise.3:32 build/C/man2/restart_syscall.2:36 build/C/man2/rt_sigqueueinfo.2:28 build/C/man2/s390_runtime_instr.2:28 build/C/man2/sgetmask.2:29 build/C/man2/sigaction.2:50 build/C/man2/sigaltstack.2:30 build/C/man7/sigevent.7:29 build/C/man3/siginterrupt.3:34 build/C/man2/signal.2:39 build/C/man2/signalfd.2:23 build/C/man3/sigpause.3:28 build/C/man2/sigpending.2:32 build/C/man2/sigprocmask.2:32 build/C/man3/sigqueue.3:31 build/C/man2/sigreturn.2:32 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/sigwait.3:29 build/C/man2/sigwaitinfo.2:28 build/C/man3/sysv_signal.3:28 build/C/man2/timer_create.2:34 build/C/man2/timer_delete.2:29 build/C/man2/timer_getoverrun.2:29 build/C/man2/timer_settime.2:30 build/C/man2/timerfd_create.2:25 build/C/man2/tkill.2:32 build/C/man2/wait.2:52 build/C/man2/wait4.2:36
50 #, no-wrap
51 msgid "SYNOPSIS"
52 msgstr ""
53
54 #. type: Plain text
55 #: build/C/man3/bsd_signal.3:30
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:32 build/C/man2/killpg.2:47 build/C/man2/sigaltstack.2:32 build/C/man2/signal.2:41 build/C/man2/sigpending.2:34 build/C/man2/sigprocmask.2:34 build/C/man3/sigqueue.3:33 build/C/man3/sigset.3:31 build/C/man3/sigsetops.3:37 build/C/man2/sigsuspend.2:34 build/C/man3/sigvec.3:31 build/C/man3/sysv_signal.3:32
61 msgid "B<#include E<lt>signal.hE<gt>>"
62 msgstr ""
63
64 #. type: Plain text
65 #: build/C/man3/bsd_signal.3:34 build/C/man2/signal.2:43 build/C/man3/sigset.3:33 build/C/man3/sysv_signal.3:34
66 msgid "B<typedef void (*sighandler_t)(int);>"
67 msgstr ""
68
69 #. type: Plain text
70 #: build/C/man3/bsd_signal.3:36
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:36 build/C/man2/eventfd.2:29 build/C/man2/getitimer.2:24 build/C/man3/gsignal.3:49 build/C/man2/kill.2:65 build/C/man2/killpg.2:60 build/C/man2/pause.2:37 build/C/man2/prctl.2:62 build/C/man3/profil.3:46 build/C/man3/psignal.3:56 build/C/man3/raise.3:38 build/C/man2/restart_syscall.2:41 build/C/man2/rt_sigqueueinfo.2:38 build/C/man2/s390_runtime_instr.2:34 build/C/man2/sgetmask.2:36 build/C/man2/sigaction.2:70 build/C/man2/sigaltstack.2:51 build/C/man7/sigevent.7:52 build/C/man3/siginterrupt.3:55 build/C/man2/signal.2:45 build/C/man7/signal.7:49 build/C/man2/signalfd.2:27 build/C/man3/sigpause.3:36 build/C/man2/sigpending.2:46 build/C/man2/sigprocmask.2:47 build/C/man3/sigqueue.3:43 build/C/man2/sigreturn.2:34 build/C/man3/sigset.3:58 build/C/man3/sigsetops.3:63 build/C/man2/sigsuspend.2:46 build/C/man3/sigvec.3:49 build/C/man3/sigwait.3:45 build/C/man2/sigwaitinfo.2:46 build/C/man3/sysv_signal.3:36 build/C/man2/timer_create.2:52 build/C/man2/timer_delete.2:45 build/C/man2/timer_getoverrun.2:45 build/C/man2/timer_settime.2:50 build/C/man2/timerfd_create.2:37 build/C/man2/tkill.2:41 build/C/man2/wait.2:83 build/C/man2/wait4.2:67
76 #, no-wrap
77 msgid "DESCRIPTION"
78 msgstr ""
79
80 #. type: Plain text
81 #: build/C/man3/bsd_signal.3:41
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:54
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:54 build/C/man2/eventfd.2:222 build/C/man2/getitimer.2:122 build/C/man2/kill.2:100 build/C/man2/killpg.2:89 build/C/man2/pause.2:42 build/C/man2/prctl.2:775 build/C/man3/profil.3:68 build/C/man3/psignal.3:89 build/C/man3/raise.3:61 build/C/man2/restart_syscall.2:84 build/C/man2/rt_sigqueueinfo.2:129 build/C/man2/s390_runtime_instr.2:54 build/C/man2/sgetmask.2:59 build/C/man2/sigaction.2:660 build/C/man2/sigaltstack.2:133 build/C/man3/siginterrupt.3:73 build/C/man2/signal.2:97 build/C/man2/signalfd.2:251 build/C/man3/sigpause.3:48 build/C/man2/sigpending.2:53 build/C/man2/sigprocmask.2:93 build/C/man3/sigqueue.3:83 build/C/man2/sigreturn.2:53 build/C/man3/sigset.3:129 build/C/man3/sigsetops.3:107 build/C/man2/sigsuspend.2:70 build/C/man3/sigvec.3:199 build/C/man3/sigwait.3:69 build/C/man2/sigwaitinfo.2:105 build/C/man3/sysv_signal.3:51 build/C/man2/timer_create.2:167 build/C/man2/timer_delete.2:53 build/C/man2/timer_getoverrun.2:82 build/C/man2/timer_settime.2:173 build/C/man2/timerfd_create.2:287 build/C/man2/tkill.2:95 build/C/man2/wait.2:355 build/C/man2/wait4.2:132
101 #, no-wrap
102 msgid "RETURN VALUE"
103 msgstr ""
104
105 #. type: Plain text
106 #: build/C/man3/bsd_signal.3:60
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:60 build/C/man2/eventfd.2:229 build/C/man2/getitimer.2:127 build/C/man2/kill.2:105 build/C/man2/killpg.2:94 build/C/man2/pause.2:53 build/C/man2/prctl.2:793 build/C/man2/restart_syscall.2:88 build/C/man2/rt_sigqueueinfo.2:134 build/C/man2/s390_runtime_instr.2:65 build/C/man2/sgetmask.2:64 build/C/man2/sigaction.2:665 build/C/man2/sigaltstack.2:137 build/C/man3/siginterrupt.3:83 build/C/man2/signal.2:105 build/C/man2/signalfd.2:265 build/C/man2/sigpending.2:59 build/C/man2/sigprocmask.2:99 build/C/man3/sigqueue.3:91 build/C/man3/sigset.3:154 build/C/man3/sigsetops.3:126 build/C/man2/sigsuspend.2:76 build/C/man3/sigvec.3:216 build/C/man3/sigwait.3:74 build/C/man2/sigwaitinfo.2:114 build/C/man3/sysv_signal.3:57 build/C/man2/timer_create.2:175 build/C/man2/timer_delete.2:60 build/C/man2/timer_getoverrun.2:90 build/C/man2/timer_settime.2:182 build/C/man2/timerfd_create.2:302 build/C/man2/tkill.2:99 build/C/man2/wait.2:384 build/C/man2/wait4.2:135
114 #, no-wrap
115 msgid "ERRORS"
116 msgstr ""
117
118 #. type: Plain text
119 #: build/C/man3/bsd_signal.3:63 build/C/man3/sysv_signal.3:60
120 msgid "As for B<signal>(2)."
121 msgstr ""
122
123 #. type: SH
124 #: build/C/man3/bsd_signal.3:63 build/C/man2/eventfd.2:266 build/C/man2/getitimer.2:148 build/C/man3/gsignal.3:95 build/C/man2/kill.2:121 build/C/man2/killpg.2:111 build/C/man2/pause.2:57 build/C/man2/prctl.2:965 build/C/man3/profil.3:70 build/C/man3/psignal.3:99 build/C/man3/raise.3:64 build/C/man2/restart_syscall.2:96 build/C/man2/rt_sigqueueinfo.2:176 build/C/man2/s390_runtime_instr.2:81 build/C/man2/sgetmask.2:66 build/C/man2/sigaction.2:677 build/C/man2/sigaltstack.2:156 build/C/man7/sigevent.7:130 build/C/man3/siginterrupt.3:87 build/C/man2/signal.2:110 build/C/man7/signal.7:838 build/C/man2/signalfd.2:307 build/C/man3/sigpause.3:56 build/C/man2/sigpending.2:64 build/C/man2/sigprocmask.2:112 build/C/man3/sigqueue.3:114 build/C/man2/sigreturn.2:60 build/C/man3/sigset.3:173 build/C/man3/sigsetops.3:131 build/C/man2/sigsuspend.2:84 build/C/man3/sigvec.3:221 build/C/man3/sigwait.3:80 build/C/man2/sigwaitinfo.2:133 build/C/man3/sysv_signal.3:60 build/C/man2/timer_create.2:193 build/C/man2/timer_delete.2:67 build/C/man2/timer_getoverrun.2:97 build/C/man2/timer_settime.2:207 build/C/man2/timerfd_create.2:371 build/C/man2/tkill.2:116 build/C/man2/wait.2:422 build/C/man2/wait4.2:138
125 #, no-wrap
126 msgid "CONFORMING TO"
127 msgstr ""
128
129 #. type: Plain text
130 #: build/C/man3/bsd_signal.3:70
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:70 build/C/man2/eventfd.2:271 build/C/man2/getitimer.2:158 build/C/man2/kill.2:123 build/C/man2/killpg.2:115 build/C/man3/raise.3:66 build/C/man2/restart_syscall.2:98 build/C/man2/rt_sigqueueinfo.2:178 build/C/man2/s390_runtime_instr.2:84 build/C/man2/sgetmask.2:68 build/C/man2/sigaction.2:680 build/C/man2/sigaltstack.2:158 build/C/man2/signal.2:112 build/C/man2/signalfd.2:312 build/C/man3/sigpause.3:60 build/C/man2/sigpending.2:66 build/C/man2/sigprocmask.2:114 build/C/man3/sigqueue.3:116 build/C/man2/sigreturn.2:64 build/C/man3/sigset.3:190 build/C/man3/sigsetops.3:133 build/C/man2/sigsuspend.2:86 build/C/man3/sigvec.3:227 build/C/man3/sigwait.3:82 build/C/man2/sigwaitinfo.2:135 build/C/man3/sysv_signal.3:62 build/C/man2/timer_create.2:195 build/C/man2/timer_getoverrun.2:99 build/C/man2/tkill.2:122 build/C/man2/wait.2:424 build/C/man2/wait4.2:147
138 #, no-wrap
139 msgid "NOTES"
140 msgstr ""
141
142 #. type: Plain text
143 #: build/C/man3/bsd_signal.3:76
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:87
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:94 build/C/man3/sysv_signal.3:87
157 msgid ""
158 "The use of I<sighandler_t> is a GNU extension; this type is defined only if "
159 "the B<_GNU_SOURCE> feature test macro is defined."
160 msgstr ""
161
162 #. type: SH
163 #: build/C/man3/bsd_signal.3:94 build/C/man2/eventfd.2:417 build/C/man2/getitimer.2:239 build/C/man3/gsignal.3:103 build/C/man2/kill.2:171 build/C/man2/killpg.2:134 build/C/man2/pause.2:59 build/C/man2/prctl.2:979 build/C/man3/profil.3:81 build/C/man3/psignal.3:113 build/C/man3/raise.3:77 build/C/man2/restart_syscall.2:123 build/C/man2/rt_sigqueueinfo.2:188 build/C/man2/s390_runtime_instr.2:88 build/C/man2/sgetmask.2:80 build/C/man2/sigaction.2:793 build/C/man2/sigaltstack.2:232 build/C/man7/sigevent.7:132 build/C/man3/siginterrupt.3:96 build/C/man2/signal.2:278 build/C/man7/signal.7:850 build/C/man2/signalfd.2:433 build/C/man3/sigpause.3:98 build/C/man2/sigpending.2:87 build/C/man2/sigprocmask.2:144 build/C/man3/sigqueue.3:149 build/C/man2/sigreturn.2:74 build/C/man3/sigset.3:266 build/C/man3/sigsetops.3:171 build/C/man2/sigsuspend.2:108 build/C/man3/sigvec.3:252 build/C/man3/sigwait.3:89 build/C/man2/sigwaitinfo.2:187 build/C/man3/sysv_signal.3:87 build/C/man2/timer_create.2:399 build/C/man2/timer_delete.2:69 build/C/man2/timer_getoverrun.2:131 build/C/man2/timer_settime.2:212 build/C/man2/timerfd_create.2:541 build/C/man2/tkill.2:131 build/C/man2/wait.2:633 build/C/man2/wait4.2:165
164 #, no-wrap
165 msgid "SEE ALSO"
166 msgstr ""
167
168 #. type: Plain text
169 #: build/C/man3/bsd_signal.3:99
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:99 build/C/man2/eventfd.2:428 build/C/man2/getitimer.2:246 build/C/man3/gsignal.3:107 build/C/man2/kill.2:181 build/C/man2/killpg.2:140 build/C/man2/pause.2:64 build/C/man2/prctl.2:982 build/C/man3/profil.3:86 build/C/man3/psignal.3:118 build/C/man3/raise.3:84 build/C/man2/restart_syscall.2:131 build/C/man2/rt_sigqueueinfo.2:196 build/C/man2/s390_runtime_instr.2:91 build/C/man2/sgetmask.2:83 build/C/man2/sigaction.2:813 build/C/man2/sigaltstack.2:239 build/C/man7/sigevent.7:142 build/C/man3/siginterrupt.3:98 build/C/man2/signal.2:297 build/C/man7/signal.7:884 build/C/man2/signalfd.2:446 build/C/man3/sigpause.3:106 build/C/man2/sigpending.2:95 build/C/man2/sigprocmask.2:155 build/C/man3/sigqueue.3:157 build/C/man2/sigreturn.2:80 build/C/man3/sigset.3:276 build/C/man3/sigsetops.3:176 build/C/man2/sigsuspend.2:118 build/C/man3/sigvec.3:262 build/C/man3/sigwait.3:97 build/C/man2/sigwaitinfo.2:199 build/C/man3/sysv_signal.3:92 build/C/man2/timer_create.2:414 build/C/man2/timer_delete.2:75 build/C/man2/timer_getoverrun.2:141 build/C/man2/timer_settime.2:216 build/C/man2/timerfd_create.2:553 build/C/man2/tkill.2:136 build/C/man2/wait.2:645 build/C/man2/wait4.2:172
175 #, no-wrap
176 msgid "COLOPHON"
177 msgstr ""
178
179 #. type: Plain text
180 #: build/C/man3/bsd_signal.3:106 build/C/man2/eventfd.2:435 build/C/man2/getitimer.2:253 build/C/man3/gsignal.3:114 build/C/man2/kill.2:188 build/C/man2/killpg.2:147 build/C/man2/pause.2:71 build/C/man2/prctl.2:989 build/C/man3/profil.3:93 build/C/man3/psignal.3:125 build/C/man3/raise.3:91 build/C/man2/restart_syscall.2:138 build/C/man2/rt_sigqueueinfo.2:203 build/C/man2/s390_runtime_instr.2:98 build/C/man2/sgetmask.2:90 build/C/man2/sigaction.2:820 build/C/man2/sigaltstack.2:246 build/C/man7/sigevent.7:149 build/C/man3/siginterrupt.3:105 build/C/man2/signal.2:304 build/C/man7/signal.7:891 build/C/man2/signalfd.2:453 build/C/man3/sigpause.3:113 build/C/man2/sigpending.2:102 build/C/man2/sigprocmask.2:162 build/C/man3/sigqueue.3:164 build/C/man2/sigreturn.2:87 build/C/man3/sigset.3:283 build/C/man3/sigsetops.3:183 build/C/man2/sigsuspend.2:125 build/C/man3/sigvec.3:269 build/C/man3/sigwait.3:104 build/C/man2/sigwaitinfo.2:206 build/C/man3/sysv_signal.3:99 build/C/man2/timer_create.2:421 build/C/man2/timer_delete.2:82 build/C/man2/timer_getoverrun.2:148 build/C/man2/timer_settime.2:223 build/C/man2/timerfd_create.2:560 build/C/man2/tkill.2:143 build/C/man2/wait.2:652 build/C/man2/wait4.2:179
181 msgid ""
182 "This page is part of release 3.54 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:22
189 #, no-wrap
190 msgid "EVENTFD"
191 msgstr ""
192
193 #. type: TH
194 #: build/C/man2/eventfd.2:22
195 #, no-wrap
196 msgid "2010-08-30"
197 msgstr ""
198
199 #. type: TH
200 #: build/C/man2/eventfd.2:22 build/C/man2/getitimer.2:12 build/C/man2/kill.2:44 build/C/man2/killpg.2:42 build/C/man2/pause.2:30 build/C/man2/prctl.2:52 build/C/man3/profil.3:28 build/C/man2/restart_syscall.2:33 build/C/man2/rt_sigqueueinfo.2:25 build/C/man2/sgetmask.2:26 build/C/man2/sigaction.2:47 build/C/man2/sigaltstack.2:27 build/C/man2/signal.2:36 build/C/man7/signal.7:46 build/C/man2/signalfd.2:20 build/C/man3/sigpause.3:25 build/C/man2/sigpending.2:29 build/C/man2/sigprocmask.2:29 build/C/man3/sigqueue.3:28 build/C/man2/sigreturn.2:29 build/C/man3/sigset.3:26 build/C/man3/sigsetops.3:31 build/C/man2/sigsuspend.2:29 build/C/man3/sigvec.3:26 build/C/man3/sigwait.3:26 build/C/man2/sigwaitinfo.2:25 build/C/man2/timer_create.2:31 build/C/man2/timer_delete.2:26 build/C/man2/timer_getoverrun.2:26 build/C/man2/timer_settime.2:26 build/C/man2/timerfd_create.2:21 build/C/man2/tkill.2:29 build/C/man2/wait.2:49 build/C/man2/wait4.2:33
201 #, no-wrap
202 msgid "Linux"
203 msgstr ""
204
205 #. type: Plain text
206 #: build/C/man2/eventfd.2:25
207 msgid "eventfd - create a file descriptor for event notification"
208 msgstr ""
209
210 #. type: Plain text
211 #: build/C/man2/eventfd.2:27
212 msgid "B<#include E<lt>sys/eventfd.hE<gt>>"
213 msgstr ""
214
215 #. type: Plain text
216 #: build/C/man2/eventfd.2:29
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:39
222 msgid ""
223 "B<eventfd>()  creates an \"eventfd object\" that can be used as an event "
224 "wait/notify mechanism by user-space applications, and by the kernel to "
225 "notify user-space applications of events.  The object contains an unsigned "
226 "64-bit integer (I<uint64_t>)  counter that is maintained by the kernel.  "
227 "This counter is initialized with the value specified in the argument "
228 "I<initval>."
229 msgstr ""
230
231 #. type: Plain text
232 #: build/C/man2/eventfd.2:44
233 msgid ""
234 "The following values may be bitwise ORed in I<flags> to change the behaviour "
235 "of B<eventfd>():"
236 msgstr ""
237
238 #. type: TP
239 #: build/C/man2/eventfd.2:44
240 #, no-wrap
241 msgid "B<EFD_CLOEXEC> (since Linux 2.6.27)"
242 msgstr ""
243
244 #. type: Plain text
245 #: build/C/man2/eventfd.2:54 build/C/man2/signalfd.2:95 build/C/man2/timerfd_create.2:103
246 msgid ""
247 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
248 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
249 "may be useful."
250 msgstr ""
251
252 #. type: TP
253 #: build/C/man2/eventfd.2:54
254 #, no-wrap
255 msgid "B<EFD_NONBLOCK> (since Linux 2.6.27)"
256 msgstr ""
257
258 #. type: Plain text
259 #: build/C/man2/eventfd.2:62 build/C/man2/signalfd.2:85 build/C/man2/timerfd_create.2:93
260 msgid ""
261 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
262 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same "
263 "result."
264 msgstr ""
265
266 #. type: TP
267 #: build/C/man2/eventfd.2:62
268 #, no-wrap
269 msgid "B<EFD_SEMAPHORE> (since Linux 2.6.30)"
270 msgstr ""
271
272 #. type: Plain text
273 #: build/C/man2/eventfd.2:66
274 msgid ""
275 "Provide semaphore-like semantics for reads from the new file descriptor.  "
276 "See below."
277 msgstr ""
278
279 #. type: Plain text
280 #: build/C/man2/eventfd.2:70 build/C/man2/signalfd.2:99
281 msgid ""
282 "In Linux up to version 2.6.26, the I<flags> argument is unused, and must be "
283 "specified as zero."
284 msgstr ""
285
286 #. type: Plain text
287 #: build/C/man2/eventfd.2:76
288 msgid ""
289 "As its return value, B<eventfd>()  returns a new file descriptor that can be "
290 "used to refer to the eventfd object.  The following operations can be "
291 "performed on the file descriptor:"
292 msgstr ""
293
294 #. type: TP
295 #: build/C/man2/eventfd.2:76 build/C/man2/signalfd.2:102 build/C/man2/timerfd_create.2:211
296 #, no-wrap
297 msgid "B<read>(2)"
298 msgstr ""
299
300 #. type: Plain text
301 #: build/C/man2/eventfd.2:86
302 msgid ""
303 "Each successful B<read>(2)  returns an 8-byte integer.  A B<read>(2)  will "
304 "fail with the error B<EINVAL> if the size of the supplied buffer is less "
305 "than 8 bytes."
306 msgstr ""
307
308 #. type: Plain text
309 #: build/C/man2/eventfd.2:91
310 msgid ""
311 "The value returned by B<read>(2)  is in host byte order, i.e., the native "
312 "byte order for integers on the host machine."
313 msgstr ""
314
315 #. type: Plain text
316 #: build/C/man2/eventfd.2:98
317 msgid ""
318 "The semantics of B<read>(2)  depend on whether the eventfd counter currently "
319 "has a nonzero value and whether the B<EFD_SEMAPHORE> flag was specified when "
320 "creating the eventfd file descriptor:"
321 msgstr ""
322
323 #. type: IP
324 #: build/C/man2/eventfd.2:99 build/C/man2/eventfd.2:106 build/C/man2/eventfd.2:113 build/C/man2/eventfd.2:158 build/C/man2/eventfd.2:168 build/C/man2/eventfd.2:178 build/C/man2/prctl.2:836 build/C/man2/prctl.2:841 build/C/man2/prctl.2:846 build/C/man2/prctl.2:856 build/C/man3/psignal.3:105 build/C/man3/psignal.3:109 build/C/man2/sigaction.2:298 build/C/man2/sigaction.2:313 build/C/man2/sigaction.2:329 build/C/man2/sigaction.2:344 build/C/man2/sigaction.2:391 build/C/man2/sigaction.2:427 build/C/man2/signal.2:68 build/C/man2/signal.2:73 build/C/man2/signal.2:80 build/C/man2/signal.2:224 build/C/man2/signal.2:228 build/C/man2/signal.2:267 build/C/man7/signal.7:149 build/C/man7/signal.7:157 build/C/man7/signal.7:615 build/C/man7/signal.7:617 build/C/man7/signal.7:638 build/C/man7/signal.7:653 build/C/man7/signal.7:657 build/C/man7/signal.7:664 build/C/man7/signal.7:680 build/C/man7/signal.7:686 build/C/man7/signal.7:693 build/C/man7/signal.7:698 build/C/man7/signal.7:717 build/C/man7/signal.7:736 build/C/man7/signal.7:743 build/C/man7/signal.7:752 build/C/man7/signal.7:760 build/C/man7/signal.7:766 build/C/man7/signal.7:771 build/C/man7/signal.7:791 build/C/man7/signal.7:810 build/C/man7/signal.7:813 build/C/man7/signal.7:816 build/C/man7/signal.7:819 build/C/man7/signal.7:824 build/C/man7/signal.7:830 build/C/man7/signal.7:834 build/C/man3/sigwait.3:62 build/C/man3/sigwait.3:67 build/C/man2/timer_create.2:216 build/C/man2/timer_create.2:219 build/C/man2/timer_create.2:222 build/C/man2/timer_create.2:226 build/C/man2/timer_create.2:229 build/C/man2/timer_create.2:235 build/C/man2/timer_create.2:239
325 #, no-wrap
326 msgid "*"
327 msgstr ""
328
329 #. type: Plain text
330 #: build/C/man2/eventfd.2:106
331 msgid ""
332 "If B<EFD_SEMAPHORE> was not specified and the eventfd counter has a nonzero "
333 "value, then a B<read>(2)  returns 8 bytes containing that value, and the "
334 "counter's value is reset to zero."
335 msgstr ""
336
337 #. type: Plain text
338 #: build/C/man2/eventfd.2:113
339 msgid ""
340 "If B<EFD_SEMAPHORE> was specified and the eventfd counter has a nonzero "
341 "value, then a B<read>(2)  returns 8 bytes containing the value 1, and the "
342 "counter's value is decremented by 1."
343 msgstr ""
344
345 #. type: Plain text
346 #: build/C/man2/eventfd.2:123
347 msgid ""
348 "If the eventfd counter is zero at the time of the call to B<read>(2), then "
349 "the call either blocks until the counter becomes nonzero (at which time, the "
350 "B<read>(2)  proceeds as described above)  or fails with the error B<EAGAIN> "
351 "if the file descriptor has been made nonblocking."
352 msgstr ""
353
354 #. type: TP
355 #: build/C/man2/eventfd.2:124
356 #, no-wrap
357 msgid "B<write>(2)"
358 msgstr ""
359
360 #. type: Plain text
361 #: build/C/man2/eventfd.2:141
362 msgid ""
363 "A B<write>(2)  call adds the 8-byte integer value supplied in its buffer to "
364 "the counter.  The maximum value that may be stored in the counter is the "
365 "largest unsigned 64-bit value minus 1 (i.e., 0xfffffffffffffffe).  If the "
366 "addition would cause the counter's value to exceed the maximum, then the "
367 "B<write>(2)  either blocks until a B<read>(2)  is performed on the file "
368 "descriptor, or fails with the error B<EAGAIN> if the file descriptor has "
369 "been made nonblocking."
370 msgstr ""
371
372 #. type: Plain text
373 #: build/C/man2/eventfd.2:148
374 msgid ""
375 "A B<write>(2)  will fail with the error B<EINVAL> if the size of the "
376 "supplied buffer is less than 8 bytes, or if an attempt is made to write the "
377 "value 0xffffffffffffffff."
378 msgstr ""
379
380 #. type: TP
381 #: build/C/man2/eventfd.2:148 build/C/man2/signalfd.2:140 build/C/man2/timerfd_create.2:244
382 #, no-wrap
383 msgid "B<poll>(2), B<select>(2) (and similar)"
384 msgstr ""
385
386 #. type: Plain text
387 #: build/C/man2/eventfd.2:157
388 msgid ""
389 "The returned file descriptor supports B<poll>(2)  (and analogously "
390 "B<epoll>(7))  and B<select>(2), as follows:"
391 msgstr ""
392
393 #. type: Plain text
394 #: build/C/man2/eventfd.2:168
395 msgid ""
396 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
397 "B<poll>(2)  B<POLLIN> flag)  if the counter has a value greater than 0."
398 msgstr ""
399
400 #. type: Plain text
401 #: build/C/man2/eventfd.2:178
402 msgid ""
403 "The file descriptor is writable (the B<select>(2)  I<writefds> argument; the "
404 "B<poll>(2)  B<POLLOUT> flag)  if it is possible to write a value of at least "
405 "\"1\" without blocking."
406 msgstr ""
407
408 #. type: Plain text
409 #: build/C/man2/eventfd.2:198
410 msgid ""
411 "If an overflow of the counter value was detected, then B<select>(2)  "
412 "indicates the file descriptor as being both readable and writable, and "
413 "B<poll>(2)  returns a B<POLLERR> event.  As noted above, B<write>(2)  can "
414 "never overflow the counter.  However an overflow can occur if 2^64 eventfd "
415 "\"signal posts\" were performed by the KAIO subsystem (theoretically "
416 "possible, but practically unlikely).  If an overflow has occurred, then "
417 "B<read>(2)  will return that maximum I<uint64_t> value (i.e., "
418 "0xffffffffffffffff)."
419 msgstr ""
420
421 #. type: Plain text
422 #: build/C/man2/eventfd.2:205
423 msgid ""
424 "The eventfd file descriptor also supports the other file-descriptor "
425 "multiplexing APIs: B<pselect>(2)  and B<ppoll>(2)."
426 msgstr ""
427
428 #. type: TP
429 #: build/C/man2/eventfd.2:205 build/C/man2/signalfd.2:160 build/C/man2/timerfd_create.2:262
430 #, no-wrap
431 msgid "B<close>(2)"
432 msgstr ""
433
434 #. type: Plain text
435 #: build/C/man2/eventfd.2:210
436 msgid ""
437 "When the file descriptor is no longer required it should be closed.  When "
438 "all file descriptors associated with the same eventfd object have been "
439 "closed, the resources for object are freed by the kernel."
440 msgstr ""
441
442 #. type: Plain text
443 #: build/C/man2/eventfd.2:222
444 msgid ""
445 "A copy of the file descriptor created by B<eventfd>()  is inherited by the "
446 "child produced by B<fork>(2).  The duplicate file descriptor is associated "
447 "with the same eventfd object.  File descriptors created by B<eventfd>()  are "
448 "preserved across B<execve>(2), unless the close-on-exec flag has been set."
449 msgstr ""
450
451 #. type: Plain text
452 #: build/C/man2/eventfd.2:229
453 msgid ""
454 "On success, B<eventfd>()  returns a new eventfd file descriptor.  On error, "
455 "-1 is returned and I<errno> is set to indicate the error."
456 msgstr ""
457
458 #. type: TP
459 #: build/C/man2/eventfd.2:230 build/C/man2/getitimer.2:135 build/C/man2/kill.2:106 build/C/man2/killpg.2:95 build/C/man2/prctl.2:798 build/C/man2/prctl.2:803 build/C/man2/prctl.2:815 build/C/man2/prctl.2:820 build/C/man2/prctl.2:829 build/C/man2/prctl.2:869 build/C/man2/rt_sigqueueinfo.2:141 build/C/man2/s390_runtime_instr.2:66 build/C/man2/sigaction.2:670 build/C/man2/sigaltstack.2:142 build/C/man3/siginterrupt.3:84 build/C/man2/signal.2:106 build/C/man2/signalfd.2:271 build/C/man2/signalfd.2:279 build/C/man2/sigprocmask.2:107 build/C/man3/sigqueue.3:98 build/C/man3/sigsetops.3:127 build/C/man3/sigwait.3:75 build/C/man2/sigwaitinfo.2:129 build/C/man2/timer_create.2:179 build/C/man2/timer_delete.2:61 build/C/man2/timer_getoverrun.2:91 build/C/man2/timer_settime.2:191 build/C/man2/timer_settime.2:199 build/C/man2/timerfd_create.2:305 build/C/man2/timerfd_create.2:313 build/C/man2/timerfd_create.2:349 build/C/man2/timerfd_create.2:356 build/C/man2/timerfd_create.2:362 build/C/man2/tkill.2:100 build/C/man2/wait.2:417
460 #, no-wrap
461 msgid "B<EINVAL>"
462 msgstr ""
463
464 #. type: Plain text
465 #: build/C/man2/eventfd.2:234
466 msgid "An unsupported value was specified in I<flags>."
467 msgstr ""
468
469 #. type: TP
470 #: build/C/man2/eventfd.2:234 build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:320
471 #, no-wrap
472 msgid "B<EMFILE>"
473 msgstr ""
474
475 #. type: Plain text
476 #: build/C/man2/eventfd.2:237
477 msgid "The per-process limit on open file descriptors has been reached."
478 msgstr ""
479
480 #. type: TP
481 #: build/C/man2/eventfd.2:237 build/C/man2/signalfd.2:289 build/C/man2/timerfd_create.2:323
482 #, no-wrap
483 msgid "B<ENFILE>"
484 msgstr ""
485
486 #. type: Plain text
487 #: build/C/man2/eventfd.2:241 build/C/man2/signalfd.2:293 build/C/man2/timerfd_create.2:327
488 msgid "The system-wide limit on the total number of open files has been reached."
489 msgstr ""
490
491 #. type: TP
492 #: build/C/man2/eventfd.2:241 build/C/man2/signalfd.2:293 build/C/man2/timerfd_create.2:327
493 #, no-wrap
494 msgid "B<ENODEV>"
495 msgstr ""
496
497 #. type: Plain text
498 #: build/C/man2/eventfd.2:249 build/C/man2/signalfd.2:296 build/C/man2/timerfd_create.2:330
499 msgid "Could not mount (internal) anonymous inode device."
500 msgstr ""
501
502 #. type: TP
503 #: build/C/man2/eventfd.2:249 build/C/man2/s390_runtime_instr.2:73 build/C/man2/sigaltstack.2:147 build/C/man2/signalfd.2:296 build/C/man2/timer_create.2:187 build/C/man2/timerfd_create.2:330
504 #, no-wrap
505 msgid "B<ENOMEM>"
506 msgstr ""
507
508 #. type: Plain text
509 #: build/C/man2/eventfd.2:253
510 msgid "There was insufficient memory to create a new eventfd file descriptor."
511 msgstr ""
512
513 #. type: SH
514 #: build/C/man2/eventfd.2:253 build/C/man2/prctl.2:960 build/C/man3/psignal.3:95 build/C/man2/restart_syscall.2:92 build/C/man2/rt_sigqueueinfo.2:169 build/C/man2/s390_runtime_instr.2:79 build/C/man2/signalfd.2:299 build/C/man3/sigqueue.3:112 build/C/man2/timer_create.2:191 build/C/man2/timer_delete.2:65 build/C/man2/timer_getoverrun.2:95 build/C/man2/timer_settime.2:205 build/C/man2/timerfd_create.2:368 build/C/man2/tkill.2:111
515 #, no-wrap
516 msgid "VERSIONS"
517 msgstr ""
518
519 #.  eventfd() is in glibc 2.7, but reportedly does not build
520 #. type: Plain text
521 #: build/C/man2/eventfd.2:266
522 msgid ""
523 "B<eventfd>()  is available on Linux since kernel 2.6.22.  Working support is "
524 "provided in glibc since version 2.8.  The B<eventfd2>()  system call (see "
525 "NOTES) is available on Linux since kernel 2.6.27.  Since version 2.9, the "
526 "glibc B<eventfd>()  wrapper will employ the B<eventfd2>()  system call, if "
527 "it is supported by the kernel."
528 msgstr ""
529
530 #. type: Plain text
531 #: build/C/man2/eventfd.2:271
532 msgid "B<eventfd>()  and B<eventfd2>()  are Linux-specific."
533 msgstr ""
534
535 #. type: Plain text
536 #: build/C/man2/eventfd.2:279
537 msgid ""
538 "Applications can use an eventfd file descriptor instead of a pipe (see "
539 "B<pipe>(2))  in all cases where a pipe is used simply to signal events.  The "
540 "kernel overhead of an eventfd file descriptor is much lower than that of a "
541 "pipe, and only one file descriptor is required (versus the two required for "
542 "a pipe)."
543 msgstr ""
544
545 #.  or eventually syslets/threadlets
546 #. type: Plain text
547 #: build/C/man2/eventfd.2:285
548 msgid ""
549 "When used in the kernel, an eventfd file descriptor can provide a bridge "
550 "from kernel to user space, allowing, for example, functionalities like KAIO "
551 "(kernel AIO)  to signal to a file descriptor that some operation is "
552 "complete."
553 msgstr ""
554
555 #. type: Plain text
556 #: build/C/man2/eventfd.2:302
557 msgid ""
558 "A key point about an eventfd file descriptor is that it can be monitored "
559 "just like any other file descriptor using B<select>(2), B<poll>(2), or "
560 "B<epoll>(7).  This means that an application can simultaneously monitor the "
561 "readiness of \"traditional\" files and the readiness of other kernel "
562 "mechanisms that support the eventfd interface.  (Without the B<eventfd>()  "
563 "interface, these mechanisms could not be multiplexed via B<select>(2), "
564 "B<poll>(2), or B<epoll>(7).)"
565 msgstr ""
566
567 #. type: SS
568 #: build/C/man2/eventfd.2:302 build/C/man2/signalfd.2:336
569 #, no-wrap
570 msgid "Underlying Linux system calls"
571 msgstr ""
572
573 #. type: Plain text
574 #: build/C/man2/eventfd.2:316
575 msgid ""
576 "There are two underlying Linux system calls: B<eventfd>()  and the more "
577 "recent B<eventfd2>().  The former system call does not implement a I<flags> "
578 "argument.  The latter system call implements the I<flags> values described "
579 "above.  The glibc wrapper function will use B<eventfd2>()  where it is "
580 "available."
581 msgstr ""
582
583 #. type: SS
584 #: build/C/man2/eventfd.2:316
585 #, no-wrap
586 msgid "Additional glibc features"
587 msgstr ""
588
589 #. type: Plain text
590 #: build/C/man2/eventfd.2:320
591 msgid ""
592 "The GNU C library defines an additional type, and two functions that attempt "
593 "to abstract some of the details of reading and writing on an eventfd file "
594 "descriptor:"
595 msgstr ""
596
597 #. type: Plain text
598 #: build/C/man2/eventfd.2:324
599 #, no-wrap
600 msgid "typedef uint64_t eventfd_t;\n"
601 msgstr ""
602
603 #. type: Plain text
604 #: build/C/man2/eventfd.2:327
605 #, no-wrap
606 msgid ""
607 "int eventfd_read(int fd, eventfd_t *value);\n"
608 "int eventfd_write(int fd, eventfd_t value);\n"
609 msgstr ""
610
611 #. type: Plain text
612 #: build/C/man2/eventfd.2:334
613 msgid ""
614 "The functions perform the read and write operations on an eventfd file "
615 "descriptor, returning 0 if the correct number of bytes was transferred, or "
616 "-1 otherwise."
617 msgstr ""
618
619 #. type: SH
620 #: build/C/man2/eventfd.2:334 build/C/man2/sigaction.2:790 build/C/man2/sigaltstack.2:215 build/C/man2/signalfd.2:360 build/C/man3/sigwait.3:86 build/C/man2/timer_create.2:253 build/C/man2/timer_getoverrun.2:128 build/C/man2/timer_settime.2:209 build/C/man2/timerfd_create.2:379 build/C/man2/wait.2:550
621 #, no-wrap
622 msgid "EXAMPLE"
623 msgstr ""
624
625 #. type: Plain text
626 #: build/C/man2/eventfd.2:343
627 msgid ""
628 "The following program creates an eventfd file descriptor and then forks to "
629 "create a child process.  While the parent briefly sleeps, the child writes "
630 "each of the integers supplied in the program's command-line arguments to the "
631 "eventfd file descriptor.  When the parent has finished sleeping, it reads "
632 "from the eventfd file descriptor."
633 msgstr ""
634
635 #. type: Plain text
636 #: build/C/man2/eventfd.2:345
637 msgid "The following shell session shows a sample run of the program:"
638 msgstr ""
639
640 #. type: Plain text
641 #: build/C/man2/eventfd.2:357
642 #, no-wrap
643 msgid ""
644 "$B< ./a.out 1 2 4 7 14>\n"
645 "Child writing 1 to efd\n"
646 "Child writing 2 to efd\n"
647 "Child writing 4 to efd\n"
648 "Child writing 7 to efd\n"
649 "Child writing 14 to efd\n"
650 "Child completed write loop\n"
651 "Parent about to read\n"
652 "Parent read 28 (0x1c) from efd\n"
653 msgstr ""
654
655 #. type: SS
656 #: build/C/man2/eventfd.2:359 build/C/man2/signalfd.2:383 build/C/man2/timer_create.2:284 build/C/man2/timerfd_create.2:407 build/C/man2/wait.2:585
657 #, no-wrap
658 msgid "Program source"
659 msgstr ""
660
661 #. type: Plain text
662 #: build/C/man2/eventfd.2:367
663 #, no-wrap
664 msgid ""
665 "#include E<lt>sys/eventfd.hE<gt>\n"
666 "#include E<lt>unistd.hE<gt>\n"
667 "#include E<lt>stdlib.hE<gt>\n"
668 "#include E<lt>stdio.hE<gt>\n"
669 "#include E<lt>stdint.hE<gt>             /* Definition of uint64_t */\n"
670 msgstr ""
671
672 #. type: Plain text
673 #: build/C/man2/eventfd.2:370 build/C/man2/signalfd.2:394
674 #, no-wrap
675 msgid ""
676 "#define handle_error(msg) \\e\n"
677 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
678 msgstr ""
679
680 #. type: Plain text
681 #: build/C/man2/eventfd.2:377
682 #, no-wrap
683 msgid ""
684 "int\n"
685 "main(int argc, char *argv[])\n"
686 "{\n"
687 "    int efd, j;\n"
688 "    uint64_t u;\n"
689 "    ssize_t s;\n"
690 msgstr ""
691
692 #. type: Plain text
693 #: build/C/man2/eventfd.2:382
694 #, no-wrap
695 msgid ""
696 "    if (argc E<lt> 2) {\n"
697 "        fprintf(stderr, \"Usage: %s E<lt>numE<gt>...\\en\", argv[0]);\n"
698 "        exit(EXIT_FAILURE);\n"
699 "    }\n"
700 msgstr ""
701
702 #. type: Plain text
703 #: build/C/man2/eventfd.2:386
704 #, no-wrap
705 msgid ""
706 "    efd = eventfd(0, 0);\n"
707 "    if (efd == -1)\n"
708 "        handle_error(\"eventfd\");\n"
709 msgstr ""
710
711 #. type: Plain text
712 #: build/C/man2/eventfd.2:398
713 #, no-wrap
714 msgid ""
715 "    switch (fork()) {\n"
716 "    case 0:\n"
717 "        for (j = 1; j E<lt> argc; j++) {\n"
718 "            printf(\"Child writing %s to efd\\en\", argv[j]);\n"
719 "            u = strtoull(argv[j], NULL, 0);\n"
720 "                    /* strtoull() allows various bases */\n"
721 "            s = write(efd, &u, sizeof(uint64_t));\n"
722 "            if (s != sizeof(uint64_t))\n"
723 "                handle_error(\"write\");\n"
724 "        }\n"
725 "        printf(\"Child completed write loop\\en\");\n"
726 msgstr ""
727
728 #. type: Plain text
729 #: build/C/man2/eventfd.2:400
730 #, no-wrap
731 msgid "        exit(EXIT_SUCCESS);\n"
732 msgstr ""
733
734 #. type: Plain text
735 #: build/C/man2/eventfd.2:403
736 #, no-wrap
737 msgid ""
738 "    default:\n"
739 "        sleep(2);\n"
740 msgstr ""
741
742 #. type: Plain text
743 #: build/C/man2/eventfd.2:411
744 #, no-wrap
745 msgid ""
746 "        printf(\"Parent about to read\\en\");\n"
747 "        s = read(efd, &u, sizeof(uint64_t));\n"
748 "        if (s != sizeof(uint64_t))\n"
749 "            handle_error(\"read\");\n"
750 "        printf(\"Parent read %llu (0x%llx) from efd\\en\",\n"
751 "                (unsigned long long) u, (unsigned long long) u);\n"
752 "        exit(EXIT_SUCCESS);\n"
753 msgstr ""
754
755 #. type: Plain text
756 #: build/C/man2/eventfd.2:416
757 #, no-wrap
758 msgid ""
759 "    case -1:\n"
760 "        handle_error(\"fork\");\n"
761 "    }\n"
762 "}\n"
763 msgstr ""
764
765 #. type: Plain text
766 #: build/C/man2/eventfd.2:428
767 msgid ""
768 "B<futex>(2), B<pipe>(2), B<poll>(2), B<read>(2), B<select>(2), "
769 "B<signalfd>(2), B<timerfd_create>(2), B<write>(2), B<epoll>(7), "
770 "B<sem_overview>(7)"
771 msgstr ""
772
773 #. type: TH
774 #: build/C/man2/getitimer.2:12
775 #, no-wrap
776 msgid "GETITIMER"
777 msgstr ""
778
779 #. type: TH
780 #: build/C/man2/getitimer.2:12
781 #, no-wrap
782 msgid "2012-10-01"
783 msgstr ""
784
785 #. type: Plain text
786 #: build/C/man2/getitimer.2:15
787 msgid "getitimer, setitimer - get or set value of an interval timer"
788 msgstr ""
789
790 #. type: Plain text
791 #: build/C/man2/getitimer.2:18
792 #, no-wrap
793 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
794 msgstr ""
795
796 #. type: Plain text
797 #: build/C/man2/getitimer.2:20
798 #, no-wrap
799 msgid "B<int getitimer(int >I<which>B<, struct itimerval *>I<curr_value>B<);>\n"
800 msgstr ""
801
802 #. type: Plain text
803 #: build/C/man2/getitimer.2:23
804 #, no-wrap
805 msgid ""
806 "B<int setitimer(int >I<which>B<, const struct itimerval *>I<new_value>B<,>\n"
807 "B<              struct itimerval *>I<old_value>B<);>\n"
808 msgstr ""
809
810 #. type: Plain text
811 #: build/C/man2/getitimer.2:29
812 msgid ""
813 "The system provides each process with three interval timers, each "
814 "decrementing in a distinct time domain.  When any timer expires, a signal is "
815 "sent to the process, and the timer (potentially) restarts."
816 msgstr ""
817
818 #. type: TP
819 #: build/C/man2/getitimer.2:29
820 #, no-wrap
821 msgid "B<ITIMER_REAL>"
822 msgstr ""
823
824 #. type: Plain text
825 #: build/C/man2/getitimer.2:34
826 msgid "decrements in real time, and delivers B<SIGALRM> upon expiration."
827 msgstr ""
828
829 #. type: TP
830 #: build/C/man2/getitimer.2:34
831 #, no-wrap
832 msgid "B<ITIMER_VIRTUAL>"
833 msgstr ""
834
835 #. type: Plain text
836 #: build/C/man2/getitimer.2:39
837 msgid ""
838 "decrements only when the process is executing, and delivers B<SIGVTALRM> "
839 "upon expiration."
840 msgstr ""
841
842 #. type: TP
843 #: build/C/man2/getitimer.2:39
844 #, no-wrap
845 msgid "B<ITIMER_PROF>"
846 msgstr ""
847
848 #. type: Plain text
849 #: build/C/man2/getitimer.2:49
850 msgid ""
851 "decrements both when the process executes and when the system is executing "
852 "on behalf of the process.  Coupled with B<ITIMER_VIRTUAL>, this timer is "
853 "usually used to profile the time spent by the application in user and kernel "
854 "space.  B<SIGPROF> is delivered upon expiration."
855 msgstr ""
856
857 #. type: Plain text
858 #: build/C/man2/getitimer.2:51
859 msgid "Timer values are defined by the following structures:"
860 msgstr ""
861
862 #. type: Plain text
863 #: build/C/man2/getitimer.2:59
864 #, no-wrap
865 msgid ""
866 "struct itimerval {\n"
867 "    struct timeval it_interval; /* next value */\n"
868 "    struct timeval it_value;    /* current value */\n"
869 "};\n"
870 msgstr ""
871
872 #. type: Plain text
873 #: build/C/man2/getitimer.2:64
874 #, no-wrap
875 msgid ""
876 "struct timeval {\n"
877 "    time_t      tv_sec;         /* seconds */\n"
878 "    suseconds_t tv_usec;        /* microseconds */\n"
879 "};\n"
880 msgstr ""
881
882 #. type: Plain text
883 #: build/C/man2/getitimer.2:86
884 msgid ""
885 "The function B<getitimer>()  fills the structure pointed to by I<curr_value> "
886 "with the current setting for the timer specified by I<which> (one of "
887 "B<ITIMER_REAL>, B<ITIMER_VIRTUAL>, or B<ITIMER_PROF>).  The element "
888 "I<it_value> is set to the amount of time remaining on the timer, or zero if "
889 "the timer is disabled.  Similarly, I<it_interval> is set to the reset value."
890 msgstr ""
891
892 #. type: Plain text
893 #: build/C/man2/getitimer.2:94
894 msgid ""
895 "The function B<setitimer>()  sets the specified timer to the value in "
896 "I<new_value>.  If I<old_value> is non-NULL, the old value of the timer is "
897 "stored there."
898 msgstr ""
899
900 #. type: Plain text
901 #: build/C/man2/getitimer.2:104
902 msgid ""
903 "Timers decrement from I<it_value> to zero, generate a signal, and reset to "
904 "I<it_interval>.  A timer which is set to zero (I<it_value> is zero or the "
905 "timer expires and I<it_interval> is zero) stops."
906 msgstr ""
907
908 #. type: Plain text
909 #: build/C/man2/getitimer.2:110
910 msgid ""
911 "Both I<tv_sec> and I<tv_usec> are significant in determining the duration of "
912 "a timer."
913 msgstr ""
914
915 #. type: Plain text
916 #: build/C/man2/getitimer.2:122
917 msgid ""
918 "Timers will never expire before the requested time, but may expire some "
919 "(short) time afterward, which depends on the system timer resolution and on "
920 "the system load; see B<time>(7).  (But see BUGS below.)  Upon expiration, a "
921 "signal will be generated and the timer reset.  If the timer expires while "
922 "the process is active (always true for B<ITIMER_VIRTUAL>)  the signal will "
923 "be delivered immediately when generated.  Otherwise the delivery will be "
924 "offset by a small time dependent on the system loading."
925 msgstr ""
926
927 #. type: Plain text
928 #: build/C/man2/getitimer.2:127 build/C/man2/killpg.2:94 build/C/man2/tkill.2:99
929 msgid ""
930 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
931 "appropriately."
932 msgstr ""
933
934 #. type: TP
935 #: build/C/man2/getitimer.2:128 build/C/man2/prctl.2:794 build/C/man2/sigaction.2:666 build/C/man2/sigaltstack.2:138 build/C/man2/sigpending.2:60 build/C/man2/sigprocmask.2:100 build/C/man2/sigsuspend.2:77 build/C/man2/timer_settime.2:184 build/C/man2/timerfd_create.2:342
936 #, no-wrap
937 msgid "B<EFAULT>"
938 msgstr ""
939
940 #. type: Plain text
941 #: build/C/man2/getitimer.2:135 build/C/man2/timerfd_create.2:349
942 msgid "I<new_value>, I<old_value>, or I<curr_value> is not valid a pointer."
943 msgstr ""
944
945 #. type: Plain text
946 #: build/C/man2/getitimer.2:148
947 msgid ""
948 "I<which> is not one of B<ITIMER_REAL>, B<ITIMER_VIRTUAL>, or B<ITIMER_PROF>; "
949 "or (since Linux 2.6.22) one of the I<tv_usec> fields in the structure "
950 "pointed to by I<new_value> contains a value outside the range 0 to 999999."
951 msgstr ""
952
953 #. type: Plain text
954 #: build/C/man2/getitimer.2:158
955 msgid ""
956 "POSIX.1-2001, SVr4, 4.4BSD (this call first appeared in 4.2BSD).  "
957 "POSIX.1-2008 marks B<getitimer>()  and B<setitimer>()  obsolete, "
958 "recommending the use of the POSIX timers API (B<timer_gettime>(2), "
959 "B<timer_settime>(2), etc.) instead."
960 msgstr ""
961
962 #. type: Plain text
963 #: build/C/man2/getitimer.2:164
964 msgid ""
965 "A child created via B<fork>(2)  does not inherit its parent's interval "
966 "timers.  Interval timers are preserved across an B<execve>(2)."
967 msgstr ""
968
969 #. type: Plain text
970 #: build/C/man2/getitimer.2:174
971 msgid ""
972 "POSIX.1 leaves the interaction between B<setitimer>()  and the three "
973 "interfaces B<alarm>(2), B<sleep>(3), and B<usleep>(3)  unspecified."
974 msgstr ""
975
976 #. type: Plain text
977 #: build/C/man2/getitimer.2:176
978 msgid "The standards are silent on the meaning of the call:"
979 msgstr ""
980
981 #. type: Plain text
982 #: build/C/man2/getitimer.2:178
983 #, no-wrap
984 msgid "    setitimer(which, NULL, &old_value);\n"
985 msgstr ""
986
987 #. type: Plain text
988 #: build/C/man2/getitimer.2:181
989 msgid ""
990 "Many systems (Solaris, the BSDs, and perhaps others)  treat this as "
991 "equivalent to:"
992 msgstr ""
993
994 #. type: Plain text
995 #: build/C/man2/getitimer.2:183
996 #, no-wrap
997 msgid "    getitimer(which, &old_value);\n"
998 msgstr ""
999
1000 #. type: Plain text
1001 #: build/C/man2/getitimer.2:189
1002 msgid ""
1003 "In Linux, this is treated as being equivalent to a call in which the "
1004 "I<new_value> fields are zero; that is, the timer is disabled.  I<Don't use "
1005 "this Linux misfeature>: it is nonportable and unnecessary."
1006 msgstr ""
1007
1008 #. type: SH
1009 #: build/C/man2/getitimer.2:189 build/C/man2/kill.2:161 build/C/man3/profil.3:72 build/C/man3/psignal.3:101 build/C/man2/sigaction.2:781 build/C/man2/signalfd.2:352 build/C/man2/sigpending.2:81 build/C/man3/sigset.3:232 build/C/man2/timer_getoverrun.2:115 build/C/man2/timerfd_create.2:373 build/C/man2/wait.2:535
1010 #, no-wrap
1011 msgid "BUGS"
1012 msgstr ""
1013
1014 #. type: Plain text
1015 #: build/C/man2/getitimer.2:198
1016 msgid ""
1017 "The generation and delivery of a signal are distinct, and only one instance "
1018 "of each of the signals listed above may be pending for a process.  Under "
1019 "very heavy loading, an B<ITIMER_REAL> timer may expire before the signal "
1020 "from a previous expiration has been delivered.  The second signal in such an "
1021 "event will be lost."
1022 msgstr ""
1023
1024 #. type: Plain text
1025 #: build/C/man2/getitimer.2:213
1026 msgid ""
1027 "On Linux kernels before 2.6.16, timer values are represented in jiffies.  If "
1028 "a request is made set a timer with a value whose jiffies representation "
1029 "exceeds B<MAX_SEC_IN_JIFFIES> (defined in I<include/linux/jiffies.h>), then "
1030 "the timer is silently truncated to this ceiling value.  On Linux/i386 "
1031 "(where, since Linux 2.6.13, the default jiffy is 0.004 seconds), this means "
1032 "that the ceiling value for a timer is approximately 99.42 days.  Since Linux "
1033 "2.6.16, the kernel uses a different internal representation for times, and "
1034 "this ceiling is removed."
1035 msgstr ""
1036
1037 #.  4 Jul 2005: It looks like this bug may remain in 2.4.x.
1038 #.      http://lkml.org/lkml/2005/7/1/165
1039 #. type: Plain text
1040 #: build/C/man2/getitimer.2:220
1041 msgid ""
1042 "On certain systems (including i386), Linux kernels before version 2.6.12 "
1043 "have a bug which will produce premature timer expirations of up to one jiffy "
1044 "under some circumstances.  This bug is fixed in kernel 2.6.12."
1045 msgstr ""
1046
1047 #.  Bugzilla report 25 Apr 2006:
1048 #.  http://bugzilla.kernel.org/show_bug.cgi?id=6443
1049 #.  "setitimer() should reject noncanonical arguments"
1050 #. type: Plain text
1051 #: build/C/man2/getitimer.2:239
1052 msgid ""
1053 "POSIX.1-2001 says that B<setitimer>()  should fail if a I<tv_usec> value is "
1054 "specified that is outside of the range 0 to 999999.  However, in kernels up "
1055 "to and including 2.6.21, Linux does not give an error, but instead silently "
1056 "adjusts the corresponding seconds value for the timer.  From kernel 2.6.22 "
1057 "onward, this nonconformance has been repaired: an improper I<tv_usec> value "
1058 "results in an B<EINVAL> error."
1059 msgstr ""
1060
1061 #. type: Plain text
1062 #: build/C/man2/getitimer.2:246
1063 msgid ""
1064 "B<gettimeofday>(2), B<sigaction>(2), B<signal>(2), B<timer_create>(2), "
1065 "B<timerfd_create>(2), B<time>(7)"
1066 msgstr ""
1067
1068 #. type: TH
1069 #: build/C/man3/gsignal.3:27
1070 #, no-wrap
1071 msgid "GSIGNAL"
1072 msgstr ""
1073
1074 #. type: TH
1075 #: build/C/man3/gsignal.3:27 build/C/man3/profil.3:28
1076 #, no-wrap
1077 msgid "2007-07-26"
1078 msgstr ""
1079
1080 #. type: Plain text
1081 #: build/C/man3/gsignal.3:30
1082 msgid "gsignal, ssignal - software signal facility"
1083 msgstr ""
1084
1085 #. type: Plain text
1086 #: build/C/man3/gsignal.3:33 build/C/man2/kill.2:52 build/C/man3/psignal.3:36 build/C/man3/raise.3:35 build/C/man2/sigaction.2:53 build/C/man3/siginterrupt.3:37 build/C/man3/sigpause.3:31 build/C/man3/sigwait.3:32 build/C/man2/sigwaitinfo.2:31
1087 #, no-wrap
1088 msgid "B<#include E<lt>signal.hE<gt>>\n"
1089 msgstr ""
1090
1091 #. type: Plain text
1092 #: build/C/man3/gsignal.3:35
1093 #, no-wrap
1094 msgid "B<typedef void (*sighandler_t)(int);>\n"
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: build/C/man3/gsignal.3:37
1099 #, no-wrap
1100 msgid "B<int gsignal(int >I<signum>B<);>\n"
1101 msgstr ""
1102
1103 #. type: Plain text
1104 #: build/C/man3/gsignal.3:39
1105 #, no-wrap
1106 msgid "B<sighandler_t ssignal(int >I<signum>B<, sighandler_t >I<action>B<);>\n"
1107 msgstr ""
1108
1109 #. type: Plain text
1110 #: build/C/man3/gsignal.3:44 build/C/man2/kill.2:59 build/C/man2/killpg.2:53 build/C/man3/profil.3:42 build/C/man3/psignal.3:46 build/C/man2/sigaction.2:61 build/C/man2/sigaltstack.2:38 build/C/man3/siginterrupt.3:44 build/C/man2/sigpending.2:40 build/C/man2/sigprocmask.2:41 build/C/man3/sigqueue.3:39 build/C/man3/sigset.3:45 build/C/man3/sigsetops.3:51 build/C/man2/sigsuspend.2:40 build/C/man3/sigvec.3:45 build/C/man3/sigwait.3:39 build/C/man2/sigwaitinfo.2:41 build/C/man2/timer_create.2:48 build/C/man2/timer_delete.2:41 build/C/man2/timer_getoverrun.2:41 build/C/man2/timer_settime.2:45 build/C/man2/wait.2:69 build/C/man2/wait4.2:53
1111 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1112 msgstr ""
1113
1114 #. type: Plain text
1115 #: build/C/man3/gsignal.3:49
1116 msgid "B<gsignal>(), B<ssignal>(): _SVID_SOURCE"
1117 msgstr ""
1118
1119 #. type: Plain text
1120 #: build/C/man3/gsignal.3:57
1121 msgid ""
1122 "Don't use these functions under Linux.  Due to a historical mistake, under "
1123 "Linux these functions are aliases for B<raise>(3)  and B<signal>(2), "
1124 "respectively."
1125 msgstr ""
1126
1127 #. type: Plain text
1128 #: build/C/man3/gsignal.3:95
1129 msgid ""
1130 "Elsewhere, on System V-like systems, these functions implement software "
1131 "signaling, entirely independent of the classical B<signal>(2)  and "
1132 "B<kill>(2)  functions.  The function B<ssignal>()  defines the action to "
1133 "take when the software signal with number I<signum> is raised using the "
1134 "function B<gsignal>(), and returns the previous such action or B<SIG_DFL>.  "
1135 "The function B<gsignal>()  does the following: if no action (or the action "
1136 "B<SIG_DFL>)  was specified for I<signum>, then it does nothing and returns "
1137 "0.  If the action B<SIG_IGN> was specified for I<signum>, then it does "
1138 "nothing and returns 1.  Otherwise, it resets the action to B<SIG_DFL> and "
1139 "calls the action function with argument I<signum>, and returns the value "
1140 "returned by that function.  The range of possible values I<signum> varies "
1141 "(often 1-15 or 1-17)."
1142 msgstr ""
1143
1144 #. type: Plain text
1145 #: build/C/man3/gsignal.3:103
1146 msgid ""
1147 "These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.  "
1148 "They are called obsolete under most of these systems, and are broken under "
1149 "Linux libc and glibc.  Some systems also have B<gsignal_r>()  and "
1150 "B<ssignal_r>()."
1151 msgstr ""
1152
1153 #. type: Plain text
1154 #: build/C/man3/gsignal.3:107
1155 msgid "B<kill>(2), B<signal>(2), B<raise>(3)"
1156 msgstr ""
1157
1158 #. type: TH
1159 #: build/C/man2/kill.2:44
1160 #, no-wrap
1161 msgid "KILL"
1162 msgstr ""
1163
1164 #. type: TH
1165 #: build/C/man2/kill.2:44
1166 #, no-wrap
1167 msgid "2013-09-17"
1168 msgstr ""
1169
1170 #. type: Plain text
1171 #: build/C/man2/kill.2:47
1172 msgid "kill - send signal to a process"
1173 msgstr ""
1174
1175 #. type: Plain text
1176 #: build/C/man2/kill.2:50
1177 #, no-wrap
1178 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
1179 msgstr ""
1180
1181 #. type: Plain text
1182 #: build/C/man2/kill.2:54
1183 #, no-wrap
1184 msgid "B<int kill(pid_t >I<pid>B<, int >I<sig>B<);>\n"
1185 msgstr ""
1186
1187 #. type: Plain text
1188 #: build/C/man2/kill.2:64
1189 msgid "B<kill>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1190 msgstr ""
1191
1192 #. type: Plain text
1193 #: build/C/man2/kill.2:70
1194 msgid ""
1195 "The B<kill>()  system call can be used to send any signal to any process "
1196 "group or process."
1197 msgstr ""
1198
1199 #. type: Plain text
1200 #: build/C/man2/kill.2:73
1201 msgid ""
1202 "If I<pid> is positive, then signal I<sig> is sent to the process with the ID "
1203 "specified by I<pid>."
1204 msgstr ""
1205
1206 #. type: Plain text
1207 #: build/C/man2/kill.2:76
1208 msgid ""
1209 "If I<pid> equals 0, then I<sig> is sent to every process in the process "
1210 "group of the calling process."
1211 msgstr ""
1212
1213 #. type: Plain text
1214 #: build/C/man2/kill.2:80
1215 msgid ""
1216 "If I<pid> equals -1, then I<sig> is sent to every process for which the "
1217 "calling process has permission to send signals, except for process 1 "
1218 "(I<init>), but see below."
1219 msgstr ""
1220
1221 #. type: Plain text
1222 #: build/C/man2/kill.2:83
1223 msgid ""
1224 "If I<pid> is less than -1, then I<sig> is sent to every process in the "
1225 "process group whose ID is I<-pid>."
1226 msgstr ""
1227
1228 #. type: Plain text
1229 #: build/C/man2/kill.2:88
1230 msgid ""
1231 "If I<sig> is 0, then no signal is sent, but error checking is still "
1232 "performed; this can be used to check for the existence of a process ID or "
1233 "process group ID."
1234 msgstr ""
1235
1236 #. type: Plain text
1237 #: build/C/man2/kill.2:100
1238 msgid ""
1239 "For a process to have permission to send a signal it must either be "
1240 "privileged (under Linux: have the B<CAP_KILL> capability), or the real or "
1241 "effective user ID of the sending process must equal the real or saved "
1242 "set-user-ID of the target process.  In the case of B<SIGCONT> it suffices "
1243 "when the sending and receiving processes belong to the same session.  "
1244 "(Historically, the rules were different; see NOTES.)"
1245 msgstr ""
1246
1247 #. type: Plain text
1248 #: build/C/man2/kill.2:105
1249 msgid ""
1250 "On success (at least one signal was sent), zero is returned.  On error, -1 "
1251 "is returned, and I<errno> is set appropriately."
1252 msgstr ""
1253
1254 #. type: Plain text
1255 #: build/C/man2/kill.2:109
1256 msgid "An invalid signal was specified."
1257 msgstr ""
1258
1259 #. type: TP
1260 #: build/C/man2/kill.2:109 build/C/man2/killpg.2:99 build/C/man2/prctl.2:879 build/C/man2/prctl.2:891 build/C/man2/prctl.2:901 build/C/man2/prctl.2:909 build/C/man2/rt_sigqueueinfo.2:148 build/C/man2/sigaltstack.2:151 build/C/man3/sigqueue.3:102 build/C/man2/tkill.2:103
1261 #, no-wrap
1262 msgid "B<EPERM>"
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man2/kill.2:113 build/C/man2/killpg.2:103
1267 msgid ""
1268 "The process does not have permission to send the signal to any of the target "
1269 "processes."
1270 msgstr ""
1271
1272 #. type: TP
1273 #: build/C/man2/kill.2:113 build/C/man2/killpg.2:103 build/C/man2/killpg.2:107 build/C/man2/rt_sigqueueinfo.2:156 build/C/man3/sigqueue.3:108 build/C/man2/tkill.2:108
1274 #, no-wrap
1275 msgid "B<ESRCH>"
1276 msgstr ""
1277
1278 #. type: Plain text
1279 #: build/C/man2/kill.2:121
1280 msgid ""
1281 "The pid or process group does not exist.  Note that an existing process "
1282 "might be a zombie, a process which already committed termination, but has "
1283 "not yet been B<wait>(2)ed for."
1284 msgstr ""
1285
1286 #. type: Plain text
1287 #: build/C/man2/kill.2:123 build/C/man2/pause.2:59 build/C/man2/wait.2:424
1288 msgid "SVr4, 4.3BSD, POSIX.1-2001."
1289 msgstr ""
1290
1291 #. type: Plain text
1292 #: build/C/man2/kill.2:131
1293 msgid ""
1294 "The only signals that can be sent to process ID 1, the I<init> process, are "
1295 "those for which I<init> has explicitly installed signal handlers.  This is "
1296 "done to assure the system is not brought down accidentally."
1297 msgstr ""
1298
1299 #. type: Plain text
1300 #: build/C/man2/kill.2:137
1301 msgid ""
1302 "POSIX.1-2001 requires that I<kill(-1,sig)> send I<sig> to all processes that "
1303 "the calling process may send signals to, except possibly for some "
1304 "implementation-defined system processes.  Linux allows a process to signal "
1305 "itself, but on Linux the call I<kill(-1,sig)> does not signal the calling "
1306 "process."
1307 msgstr ""
1308
1309 #. type: Plain text
1310 #: build/C/man2/kill.2:147
1311 msgid ""
1312 "POSIX.1-2001 requires that if a process sends a signal to itself, and the "
1313 "sending thread does not have the signal blocked, and no other thread has it "
1314 "unblocked or is waiting for it in B<sigwait>(3), at least one unblocked "
1315 "signal must be delivered to the sending thread before the B<kill>()  "
1316 "returns."
1317 msgstr ""
1318
1319 #. type: SS
1320 #: build/C/man2/kill.2:147 build/C/man3/sigpause.3:77 build/C/man2/wait.2:478
1321 #, no-wrap
1322 msgid "Linux notes"
1323 msgstr ""
1324
1325 #.  In the 0.* kernels things chopped and changed quite
1326 #.  a bit - MTK, 24 Jul 02
1327 #. type: Plain text
1328 #: build/C/man2/kill.2:161
1329 msgid ""
1330 "Across different kernel versions, Linux has enforced different rules for the "
1331 "permissions required for an unprivileged process to send a signal to another "
1332 "process.  In kernels 1.0 to 1.2.2, a signal could be sent if the effective "
1333 "user ID of the sender matched effective user ID of the target, or the real "
1334 "user ID of the sender matched the real user ID of the target.  From kernel "
1335 "1.2.3 until 1.3.77, a signal could be sent if the effective user ID of the "
1336 "sender matched either the real or effective user ID of the target.  The "
1337 "current rules, which conform to POSIX.1-2001, were adopted in kernel 1.3.78."
1338 msgstr ""
1339
1340 #. type: Plain text
1341 #: build/C/man2/kill.2:171
1342 msgid ""
1343 "In 2.6 kernels up to and including 2.6.7, there was a bug that meant that "
1344 "when sending signals to a process group, B<kill>()  failed with the error "
1345 "B<EPERM> if the caller did not have permission to send the signal to I<any> "
1346 "(rather than I<all>) of the members of the process group.  Notwithstanding "
1347 "this error return, the signal was still delivered to all of the processes "
1348 "for which the caller had permission to signal."
1349 msgstr ""
1350
1351 #. type: Plain text
1352 #: build/C/man2/kill.2:181
1353 msgid ""
1354 "B<_exit>(2), B<killpg>(2), B<signal>(2), B<tkill>(2), B<exit>(3), "
1355 "B<sigqueue>(3), B<capabilities>(7), B<credentials>(7), B<signal>(7)"
1356 msgstr ""
1357
1358 #. type: TH
1359 #: build/C/man2/killpg.2:42
1360 #, no-wrap
1361 msgid "KILLPG"
1362 msgstr ""
1363
1364 #. type: TH
1365 #: build/C/man2/killpg.2:42 build/C/man3/sigset.3:26
1366 #, no-wrap
1367 msgid "2010-09-20"
1368 msgstr ""
1369
1370 #. type: Plain text
1371 #: build/C/man2/killpg.2:45
1372 msgid "killpg - send signal to a process group"
1373 msgstr ""
1374
1375 #. type: Plain text
1376 #: build/C/man2/killpg.2:49
1377 msgid "B<int killpg(int >I<pgrp>B<, int >I<sig>B<);>"
1378 msgstr ""
1379
1380 #. type: TP
1381 #: build/C/man2/killpg.2:55
1382 #, no-wrap
1383 msgid "B<killpg>():"
1384 msgstr ""
1385
1386 #. type: Plain text
1387 #: build/C/man2/killpg.2:59 build/C/man2/sigaltstack.2:46 build/C/man3/siginterrupt.3:51 build/C/man2/wait4.2:60
1388 msgid ""
1389 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
1390 "_XOPEN_SOURCE_EXTENDED"
1391 msgstr ""
1392
1393 #. type: Plain text
1394 #: build/C/man2/killpg.2:69
1395 msgid ""
1396 "B<killpg>()  sends the signal I<sig> to the process group I<pgrp>.  See "
1397 "B<signal>(7)  for a list of signals."
1398 msgstr ""
1399
1400 #. type: Plain text
1401 #: build/C/man2/killpg.2:78
1402 msgid ""
1403 "If I<pgrp> is 0, B<killpg>()  sends the signal to the calling process's "
1404 "process group.  (POSIX says: If I<pgrp> is less than or equal to 1, the "
1405 "behavior is undefined.)"
1406 msgstr ""
1407
1408 #. type: Plain text
1409 #: build/C/man2/killpg.2:89
1410 msgid ""
1411 "For a process to have permission to send a signal it must either be "
1412 "privileged (under Linux: have the B<CAP_KILL> capability), or the real or "
1413 "effective user ID of the sending process must equal the real or saved "
1414 "set-user-ID of the target process.  In the case of B<SIGCONT> it suffices "
1415 "when the sending and receiving processes belong to the same session."
1416 msgstr ""
1417
1418 #. type: Plain text
1419 #: build/C/man2/killpg.2:99
1420 msgid "I<sig> is not a valid signal number."
1421 msgstr ""
1422
1423 #. type: Plain text
1424 #: build/C/man2/killpg.2:107
1425 msgid "No process can be found in the process group specified by I<pgrp>."
1426 msgstr ""
1427
1428 #. type: Plain text
1429 #: build/C/man2/killpg.2:111
1430 msgid ""
1431 "The process group was given as 0 but the sending process does not have a "
1432 "process group."
1433 msgstr ""
1434
1435 #. type: Plain text
1436 #: build/C/man2/killpg.2:115
1437 msgid ""
1438 "SVr4, 4.4BSD (the B<killpg>()  function call first appeared in 4BSD), "
1439 "POSIX.1-2001."
1440 msgstr ""
1441
1442 #. type: Plain text
1443 #: build/C/man2/killpg.2:129
1444 msgid ""
1445 "There are various differences between the permission checking in BSD-type "
1446 "systems and System V-type systems.  See the POSIX rationale for B<kill>().  "
1447 "A difference not mentioned by POSIX concerns the return value B<EPERM>: BSD "
1448 "documents that no signal is sent and B<EPERM> returned when the permission "
1449 "check failed for at least one target process, while POSIX documents B<EPERM> "
1450 "only when the permission check failed for all target processes."
1451 msgstr ""
1452
1453 #. type: Plain text
1454 #: build/C/man2/killpg.2:134
1455 msgid ""
1456 "On Linux, B<killpg>()  is implemented as a library function that makes the "
1457 "call I<kill(-pgrp,\\ sig)>."
1458 msgstr ""
1459
1460 #. type: Plain text
1461 #: build/C/man2/killpg.2:140
1462 msgid ""
1463 "B<getpgrp>(2), B<kill>(2), B<signal>(2), B<capabilities>(7), "
1464 "B<credentials>(7)"
1465 msgstr ""
1466
1467 #. type: TH
1468 #: build/C/man2/pause.2:30
1469 #, no-wrap
1470 msgid "PAUSE"
1471 msgstr ""
1472
1473 #. type: TH
1474 #: build/C/man2/pause.2:30
1475 #, no-wrap
1476 msgid "2008-10-06"
1477 msgstr ""
1478
1479 #. type: Plain text
1480 #: build/C/man2/pause.2:33
1481 msgid "pause - wait for signal"
1482 msgstr ""
1483
1484 #. type: Plain text
1485 #: build/C/man2/pause.2:35
1486 msgid "B<#include E<lt>unistd.hE<gt>>"
1487 msgstr ""
1488
1489 #. type: Plain text
1490 #: build/C/man2/pause.2:37
1491 msgid "B<int pause(void);>"
1492 msgstr ""
1493
1494 #. type: Plain text
1495 #: build/C/man2/pause.2:42
1496 msgid ""
1497 "B<pause>()  causes the calling process (or thread) to sleep until a signal "
1498 "is delivered that either terminates the process or causes the invocation of "
1499 "a signal-catching function."
1500 msgstr ""
1501
1502 #.  .BR ERESTARTNOHAND .
1503 #. type: Plain text
1504 #: build/C/man2/pause.2:53
1505 msgid ""
1506 "B<pause>()  returns only when a signal was caught and the signal-catching "
1507 "function returned.  In this case B<pause>()  returns -1, and I<errno> is set "
1508 "to B<EINTR>."
1509 msgstr ""
1510
1511 #. type: TP
1512 #: build/C/man2/pause.2:54 build/C/man2/sigsuspend.2:81 build/C/man2/sigwaitinfo.2:123 build/C/man2/wait.2:410
1513 #, no-wrap
1514 msgid "B<EINTR>"
1515 msgstr ""
1516
1517 #. type: Plain text
1518 #: build/C/man2/pause.2:57
1519 msgid "a signal was caught and the signal-catching function returned."
1520 msgstr ""
1521
1522 #. type: Plain text
1523 #: build/C/man2/pause.2:64
1524 msgid "B<kill>(2), B<select>(2), B<signal>(2), B<sigsuspend>(2)"
1525 msgstr ""
1526
1527 #. type: TH
1528 #: build/C/man2/prctl.2:52
1529 #, no-wrap
1530 msgid "PRCTL"
1531 msgstr ""
1532
1533 #. type: TH
1534 #: build/C/man2/prctl.2:52
1535 #, no-wrap
1536 msgid "2013-05-21"
1537 msgstr ""
1538
1539 #. type: Plain text
1540 #: build/C/man2/prctl.2:55
1541 msgid "prctl - operations on a process"
1542 msgstr ""
1543
1544 #. type: Plain text
1545 #: build/C/man2/prctl.2:58
1546 #, no-wrap
1547 msgid "B<#include E<lt>sys/prctl.hE<gt>>\n"
1548 msgstr ""
1549
1550 #. type: Plain text
1551 #: build/C/man2/prctl.2:61
1552 #, no-wrap
1553 msgid ""
1554 "B<int prctl(int >I<option>B<, unsigned long >I<arg2>B<, unsigned long "
1555 ">I<arg3>B<,>\n"
1556 "B<          unsigned long >I<arg4>B<, unsigned long >I<arg5>B<);>\n"
1557 msgstr ""
1558
1559 #. type: Plain text
1560 #: build/C/man2/prctl.2:68
1561 msgid ""
1562 "B<prctl>()  is called with a first argument describing what to do (with "
1563 "values defined in I<E<lt>linux/prctl.hE<gt>>), and further arguments with a "
1564 "significance depending on the first one.  The first argument can be:"
1565 msgstr ""
1566
1567 #. type: TP
1568 #: build/C/man2/prctl.2:68
1569 #, no-wrap
1570 msgid "B<PR_CAPBSET_READ> (since Linux 2.6.25)"
1571 msgstr ""
1572
1573 #. type: Plain text
1574 #: build/C/man2/prctl.2:80
1575 msgid ""
1576 "Return (as the function result) 1 if the capability specified in I<arg2> is "
1577 "in the calling thread's capability bounding set, or 0 if it is not.  (The "
1578 "capability constants are defined in I<E<lt>linux/capability.hE<gt>>.)  The "
1579 "capability bounding set dictates whether the process can receive the "
1580 "capability through a file's permitted capability set on a subsequent call to "
1581 "B<execve>(2)."
1582 msgstr ""
1583
1584 #. type: Plain text
1585 #: build/C/man2/prctl.2:85
1586 msgid ""
1587 "If the capability specified in I<arg2> is not valid, then the call fails "
1588 "with the error B<EINVAL>."
1589 msgstr ""
1590
1591 #. type: TP
1592 #: build/C/man2/prctl.2:85
1593 #, no-wrap
1594 msgid "B<PR_CAPBSET_DROP> (since Linux 2.6.25)"
1595 msgstr ""
1596
1597 #. type: Plain text
1598 #: build/C/man2/prctl.2:94
1599 msgid ""
1600 "If the calling thread has the B<CAP_SETPCAP> capability, then drop the "
1601 "capability specified by I<arg2> from the calling thread's capability "
1602 "bounding set.  Any children of the calling thread will inherit the newly "
1603 "reduced bounding set."
1604 msgstr ""
1605
1606 #. type: Plain text
1607 #: build/C/man2/prctl.2:106
1608 msgid ""
1609 "The call fails with the error: B<EPERM> if the calling thread does not have "
1610 "the B<CAP_SETPCAP>; B<EINVAL> if I<arg2> does not represent a valid "
1611 "capability; or B<EINVAL> if file capabilities are not enabled in the kernel, "
1612 "in which case bounding sets are not supported."
1613 msgstr ""
1614
1615 #. type: TP
1616 #: build/C/man2/prctl.2:106
1617 #, no-wrap
1618 msgid "B<PR_SET_CHILD_SUBREAPER> (since Linux 3.4)"
1619 msgstr ""
1620
1621 #.  commit ebec18a6d3aa1e7d84aab16225e87fd25170ec2b
1622 #. type: Plain text
1623 #: build/C/man2/prctl.2:131
1624 msgid ""
1625 "If I<arg2> is nonzero, set the \"child subreaper\" attribute of the calling "
1626 "process; if I<arg2> is zero, unset the attribute.  When a process is marked "
1627 "as a child subreaper, all of the children that it creates, and their "
1628 "descendants, will be marked as having a subreaper.  In effect, a subreaper "
1629 "fulfills the role of B<init>(1)  for its descendant processes.  Upon "
1630 "termination of a process that is orphaned (i.e., its immediate parent has "
1631 "already terminated)  and marked as having a subreaper, the nearest still "
1632 "living ancestor subreaper will receive a B<SIGCHLD> signal and be able to "
1633 "B<wait>(2)  on the process to discover its termination status."
1634 msgstr ""
1635
1636 #. type: TP
1637 #: build/C/man2/prctl.2:131
1638 #, no-wrap
1639 msgid "B<PR_GET_CHILD_SUBREAPER> (since Linux 3.4)"
1640 msgstr ""
1641
1642 #. type: Plain text
1643 #: build/C/man2/prctl.2:136
1644 msgid ""
1645 "Return the \"child subreaper\" setting of the caller, in the location "
1646 "pointed to by I<(int\\ *) arg2>."
1647 msgstr ""
1648
1649 #. type: TP
1650 #: build/C/man2/prctl.2:136
1651 #, no-wrap
1652 msgid "B<PR_SET_DUMPABLE> (since Linux 2.3.20)"
1653 msgstr ""
1654
1655 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
1656 #.  Subject:    Fix prctl privilege escalation (CVE-2006-2451)
1657 #.  From:       Marcel Holtmann <marcel () holtmann ! org>
1658 #.  Date:       2006-07-12 11:12:00
1659 #. type: Plain text
1660 #: build/C/man2/prctl.2:162
1661 msgid ""
1662 "Set the state of the flag determining whether core dumps are produced for "
1663 "the calling process upon delivery of a signal whose default behavior is to "
1664 "produce a core dump.  (Normally, this flag is set for a process by default, "
1665 "but it is cleared when a set-user-ID or set-group-ID program is executed and "
1666 "also by various system calls that manipulate process UIDs and GIDs).  In "
1667 "kernels up to and including 2.6.12, I<arg2> must be either 0 (process is not "
1668 "dumpable) or 1 (process is dumpable).  Between kernels 2.6.13 and 2.6.17, "
1669 "the value 2 was also permitted, which caused any binary which normally would "
1670 "not be dumped to be dumped readable by root only; for security reasons, this "
1671 "feature has been removed.  (See also the description of "
1672 "I</proc/sys/fs/suid_dumpable> in B<proc>(5).)  Processes that are not "
1673 "dumpable can not be attached via B<ptrace>(2)  B<PTRACE_ATTACH>."
1674 msgstr ""
1675
1676 #. type: TP
1677 #: build/C/man2/prctl.2:162
1678 #, no-wrap
1679 msgid "B<PR_GET_DUMPABLE> (since Linux 2.3.20)"
1680 msgstr ""
1681
1682 #.  Since Linux 2.6.13, the dumpable flag can have the value 2,
1683 #.  but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable
1684 #.  flags has a nonzero value.  This was fixed in 2.6.14.
1685 #. type: Plain text
1686 #: build/C/man2/prctl.2:169
1687 msgid ""
1688 "Return (as the function result) the current state of the calling process's "
1689 "dumpable flag."
1690 msgstr ""
1691
1692 #. type: TP
1693 #: build/C/man2/prctl.2:169
1694 #, no-wrap
1695 msgid "B<PR_SET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1696 msgstr ""
1697
1698 #.  Respectively 0, 1, 2
1699 #. type: Plain text
1700 #: build/C/man2/prctl.2:179
1701 msgid ""
1702 "Set the endian-ness of the calling process to the value given in I<arg2>, "
1703 "which should be one of the following: B<PR_ENDIAN_BIG>, B<PR_ENDIAN_LITTLE>, "
1704 "or B<PR_ENDIAN_PPC_LITTLE> (PowerPC pseudo little endian)."
1705 msgstr ""
1706
1707 #. type: TP
1708 #: build/C/man2/prctl.2:179
1709 #, no-wrap
1710 msgid "B<PR_GET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1711 msgstr ""
1712
1713 #. type: Plain text
1714 #: build/C/man2/prctl.2:184
1715 msgid ""
1716 "Return the endian-ness of the calling process, in the location pointed to by "
1717 "I<(int\\ *) arg2>."
1718 msgstr ""
1719
1720 #. type: TP
1721 #: build/C/man2/prctl.2:184
1722 #, no-wrap
1723 msgid "B<PR_SET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1724 msgstr ""
1725
1726 #. type: Plain text
1727 #: build/C/man2/prctl.2:191
1728 msgid ""
1729 "Set floating-point emulation control bits to I<arg2>.  Pass "
1730 "B<PR_FPEMU_NOPRINT> to silently emulate fp operations accesses, or "
1731 "B<PR_FPEMU_SIGFPE> to not emulate fp operations and send B<SIGFPE> instead."
1732 msgstr ""
1733
1734 #. type: TP
1735 #: build/C/man2/prctl.2:191
1736 #, no-wrap
1737 msgid "B<PR_GET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1738 msgstr ""
1739
1740 #. type: Plain text
1741 #: build/C/man2/prctl.2:196
1742 msgid ""
1743 "Return floating-point emulation control bits, in the location pointed to by "
1744 "I<(int\\ *) arg2>."
1745 msgstr ""
1746
1747 #. type: TP
1748 #: build/C/man2/prctl.2:196
1749 #, no-wrap
1750 msgid "B<PR_SET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1751 msgstr ""
1752
1753 #. type: Plain text
1754 #: build/C/man2/prctl.2:209
1755 msgid ""
1756 "Set floating-point exception mode to I<arg2>.  Pass B<PR_FP_EXC_SW_ENABLE> "
1757 "to use FPEXC for FP exception enables, B<PR_FP_EXC_DIV> for floating-point "
1758 "divide by zero, B<PR_FP_EXC_OVF> for floating-point overflow, "
1759 "B<PR_FP_EXC_UND> for floating-point underflow, B<PR_FP_EXC_RES> for "
1760 "floating-point inexact result, B<PR_FP_EXC_INV> for floating-point invalid "
1761 "operation, B<PR_FP_EXC_DISABLED> for FP exceptions disabled, "
1762 "B<PR_FP_EXC_NONRECOV> for async nonrecoverable exception mode, "
1763 "B<PR_FP_EXC_ASYNC> for async recoverable exception mode, "
1764 "B<PR_FP_EXC_PRECISE> for precise exception mode."
1765 msgstr ""
1766
1767 #. type: TP
1768 #: build/C/man2/prctl.2:209
1769 #, no-wrap
1770 msgid "B<PR_GET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1771 msgstr ""
1772
1773 #. type: Plain text
1774 #: build/C/man2/prctl.2:214
1775 msgid ""
1776 "Return floating-point exception mode, in the location pointed to by I<(int\\ "
1777 "*) arg2>."
1778 msgstr ""
1779
1780 #. type: TP
1781 #: build/C/man2/prctl.2:214
1782 #, no-wrap
1783 msgid "B<PR_SET_KEEPCAPS> (since Linux 2.2.18)"
1784 msgstr ""
1785
1786 #. type: Plain text
1787 #: build/C/man2/prctl.2:232
1788 msgid ""
1789 "Set the state of the thread's \"keep capabilities\" flag, which determines "
1790 "whether the threads's permitted capability set is cleared when a change is "
1791 "made to the threads's user IDs such that the threads's real UID, effective "
1792 "UID, and saved set-user-ID all become nonzero when at least one of them "
1793 "previously had the value 0.  By default, the permitted capability set is "
1794 "cleared when such a change is made; setting the \"keep capabilities\" flag "
1795 "prevents it from being cleared.  I<arg2> must be either 0 (permitted "
1796 "capabilities are cleared)  or 1 (permitted capabilities are kept).  (A "
1797 "thread's I<effective> capability set is always cleared when such a "
1798 "credential change is made, regardless of the setting of the \"keep "
1799 "capabilities\" flag.)  The \"keep capabilities\" value will be reset to 0 on "
1800 "subsequent calls to B<execve>(2)."
1801 msgstr ""
1802
1803 #. type: TP
1804 #: build/C/man2/prctl.2:232
1805 #, no-wrap
1806 msgid "B<PR_GET_KEEPCAPS> (since Linux 2.2.18)"
1807 msgstr ""
1808
1809 #. type: Plain text
1810 #: build/C/man2/prctl.2:236
1811 msgid ""
1812 "Return (as the function result) the current state of the calling threads's "
1813 "\"keep capabilities\" flag."
1814 msgstr ""
1815
1816 #. type: TP
1817 #: build/C/man2/prctl.2:236
1818 #, no-wrap
1819 msgid "B<PR_SET_NAME> (since Linux 2.6.9)"
1820 msgstr ""
1821
1822 #.  TASK_COMM_LEN in include/linux/sched.h
1823 #. type: Plain text
1824 #: build/C/man2/prctl.2:253
1825 msgid ""
1826 "Set the name of the calling thread, using the value in the location pointed "
1827 "to by I<(char\\ *) arg2>.  The name can be up to 16 bytes long, and should "
1828 "be null-terminated if it contains fewer bytes.  This is the same attribute "
1829 "that can be set via B<pthread_setname_np>(3)  and retrieved using "
1830 "B<pthread_getname_np>(3).  The attribute is likewise accessible via "
1831 "I</proc/self/task/[tid]/comm>, where I<tid> is the name of the calling "
1832 "thread."
1833 msgstr ""
1834
1835 #. type: TP
1836 #: build/C/man2/prctl.2:253
1837 #, no-wrap
1838 msgid "B<PR_GET_NAME> (since Linux 2.6.11)"
1839 msgstr ""
1840
1841 #. type: Plain text
1842 #: build/C/man2/prctl.2:260
1843 msgid ""
1844 "Return the name of the calling thread, in the buffer pointed to by I<(char\\ "
1845 "*) arg2>.  The buffer should allow space for up to 16 bytes; the returned "
1846 "string will be null-terminated if it is shorter than that."
1847 msgstr ""
1848
1849 #. type: TP
1850 #: build/C/man2/prctl.2:260
1851 #, no-wrap
1852 msgid "B<PR_SET_NO_NEW_PRIVS> (since Linux 3.5)"
1853 msgstr ""
1854
1855 #. type: Plain text
1856 #: build/C/man2/prctl.2:283
1857 msgid ""
1858 "Set the calling process's I<no_new_privs> bit to the value in I<arg2>.  With "
1859 "I<no_new_privs> set to 1, B<execve>(2)  promises not to grant privileges to "
1860 "do anything that could not have been done without the B<execve>(2)  call "
1861 "(for example, rendering the set-user-ID and set-group-ID permission bits, "
1862 "and file capabilities non-functional).  Once set, this bit cannot be unset.  "
1863 "The setting of this bit is inherited by children created by B<fork>(2)  and "
1864 "B<clone>(2), and preserved across B<execve>(2)."
1865 msgstr ""
1866
1867 #. type: Plain text
1868 #: build/C/man2/prctl.2:286
1869 msgid ""
1870 "For more information, see the kernel source file "
1871 "I<Documentation/prctl/no_new_privs.txt>."
1872 msgstr ""
1873
1874 #. type: TP
1875 #: build/C/man2/prctl.2:286
1876 #, no-wrap
1877 msgid "B<PR_GET_NO_NEW_PRIVS> (since Linux 3.5)"
1878 msgstr ""
1879
1880 #. type: Plain text
1881 #: build/C/man2/prctl.2:297
1882 msgid ""
1883 "Return the value of the I<no_new_privs> bit for the current process.  A "
1884 "value of 0 indicates the regular B<execve>(2)  behavior.  A value of 1 "
1885 "indicates B<execve>(2)  will operate in the privilege-restricting mode "
1886 "described above."
1887 msgstr ""
1888
1889 #. type: TP
1890 #: build/C/man2/prctl.2:297
1891 #, no-wrap
1892 msgid "B<PR_SET_PDEATHSIG> (since Linux 2.1.57)"
1893 msgstr ""
1894
1895 #. type: Plain text
1896 #: build/C/man2/prctl.2:308
1897 msgid ""
1898 "Set the parent process death signal of the calling process to I<arg2> "
1899 "(either a signal value in the range 1..maxsig, or 0 to clear).  This is the "
1900 "signal that the calling process will get when its parent dies.  This value "
1901 "is cleared for the child of a B<fork>(2)  and (since Linux 2.4.36 / 2.6.23)  "
1902 "when executing a set-user-ID or set-group-ID binary."
1903 msgstr ""
1904
1905 #. type: TP
1906 #: build/C/man2/prctl.2:308
1907 #, no-wrap
1908 msgid "B<PR_GET_PDEATHSIG> (since Linux 2.3.15)"
1909 msgstr ""
1910
1911 #. type: Plain text
1912 #: build/C/man2/prctl.2:313
1913 msgid ""
1914 "Return the current value of the parent process death signal, in the location "
1915 "pointed to by I<(int\\ *) arg2>."
1916 msgstr ""
1917
1918 #. type: TP
1919 #: build/C/man2/prctl.2:313
1920 #, no-wrap
1921 msgid "B<PR_SET_PTRACER> (since Linux 3.4)"
1922 msgstr ""
1923
1924 #.  commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
1925 #.  commit bf06189e4d14641c0148bea16e9dd24943862215
1926 #. type: Plain text
1927 #: build/C/man2/prctl.2:338
1928 msgid ""
1929 "This is meaningful only when the Yama LSM is enabled and in mode 1 "
1930 "(\"restricted ptrace\", visible via I</proc/sys/kernel/yama/ptrace_scope>).  "
1931 "When a \"ptracer process ID\" is passed in I<arg2>, the caller is declaring "
1932 "that the ptracer process can B<ptrace>(2)  the calling process as if it were "
1933 "a direct process ancestor.  Each B<PR_SET_PTRACER> operation replaces the "
1934 "previous \"ptracer process ID\".  Employing B<PR_SET_PTRACER> with I<arg2> "
1935 "set to 0 clears the caller's \"ptracer process ID\".  If I<arg2> is "
1936 "B<PR_SET_PTRACER_ANY,> the ptrace restrictions introduced by Yama are "
1937 "effectively disabled for the calling process."
1938 msgstr ""
1939
1940 #. type: Plain text
1941 #: build/C/man2/prctl.2:341
1942 msgid ""
1943 "For further information, see the kernel source file "
1944 "I<Documentation/security/Yama.txt>."
1945 msgstr ""
1946
1947 #. type: TP
1948 #: build/C/man2/prctl.2:341
1949 #, no-wrap
1950 msgid "B<PR_SET_SECCOMP> (since Linux 2.6.23)"
1951 msgstr ""
1952
1953 #.  See http://thread.gmane.org/gmane.linux.kernel/542632
1954 #.  [PATCH 0 of 2] seccomp updates
1955 #.  andrea@cpushare.com
1956 #. type: Plain text
1957 #: build/C/man2/prctl.2:352
1958 msgid ""
1959 "Set the secure computing (seccomp) mode for the calling thread, to limit the "
1960 "available system calls.  The seccomp mode is selected via I<arg2>.  (The "
1961 "seccomp constants are defined in I<E<lt>linux/seccomp.hE<gt>>.)"
1962 msgstr ""
1963
1964 #. type: Plain text
1965 #: build/C/man2/prctl.2:373
1966 msgid ""
1967 "With I<arg2> set to B<SECCOMP_MODE_STRICT> the only system calls that the "
1968 "thread is permitted to make are B<read>(2), B<write>(2), B<_exit>(2), and "
1969 "B<sigreturn>(2).  Other system calls result in the delivery of a B<SIGKILL> "
1970 "signal.  Strict secure computing mode is useful for number-crunching "
1971 "applications that may need to execute untrusted byte code, perhaps obtained "
1972 "by reading from a pipe or socket.  This operation is available only if the "
1973 "kernel is configured with B<CONFIG_SECCOMP> enabled."
1974 msgstr ""
1975
1976 #. type: Plain text
1977 #: build/C/man2/prctl.2:388
1978 msgid ""
1979 "With I<arg2> set to B<SECCOMP_MODE_FILTER> (since Linux 3.5)  the system "
1980 "calls allowed are defined by a pointer to a Berkeley Packet Filter passed in "
1981 "I<arg3>.  This argument is a pointer to I<struct sock_fprog>; it can be "
1982 "designed to filter arbitrary system calls and system call arguments.  This "
1983 "mode is available only if the kernel is configured with "
1984 "B<CONFIG_SECCOMP_FILTER> enabled."
1985 msgstr ""
1986
1987 #. type: Plain text
1988 #: build/C/man2/prctl.2:403
1989 msgid ""
1990 "If B<SECCOMP_MODE_FILTER> filters permit B<fork>(2), then the seccomp mode "
1991 "is inherited by children created by B<fork>(2); if B<execve>(2)  is "
1992 "permitted, then the seccomp mode is preserved across B<execve>(2).  If the "
1993 "filters permit B<prctl>()  calls, then additional filters can be added; they "
1994 "are run in order until the first non-allow result is seen."
1995 msgstr ""
1996
1997 #. type: Plain text
1998 #: build/C/man2/prctl.2:406
1999 msgid ""
2000 "For further information, see the kernel source file "
2001 "I<Documentation/prctl/seccomp_filter.txt>."
2002 msgstr ""
2003
2004 #. type: TP
2005 #: build/C/man2/prctl.2:406
2006 #, no-wrap
2007 msgid "B<PR_GET_SECCOMP> (since Linux 2.6.23)"
2008 msgstr ""
2009
2010 #. type: Plain text
2011 #: build/C/man2/prctl.2:421
2012 msgid ""
2013 "Return the secure computing mode of the calling thread.  If the caller is "
2014 "not in secure computing mode, this operation returns 0; if the caller is in "
2015 "strict secure computing mode, then the B<prctl>()  call will cause a "
2016 "B<SIGKILL> signal to be sent to the process.  If the caller is in filter "
2017 "mode, and this system call is allowed by the seccomp filters, it returns 2.  "
2018 "This operation is available only if the kernel is configured with "
2019 "B<CONFIG_SECCOMP> enabled."
2020 msgstr ""
2021
2022 #. type: TP
2023 #: build/C/man2/prctl.2:421
2024 #, no-wrap
2025 msgid "B<PR_SET_SECUREBITS> (since Linux 2.6.26)"
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man2/prctl.2:427
2030 msgid ""
2031 "Set the \"securebits\" flags of the calling thread to the value supplied in "
2032 "I<arg2>.  See B<capabilities>(7)."
2033 msgstr ""
2034
2035 #. type: TP
2036 #: build/C/man2/prctl.2:427
2037 #, no-wrap
2038 msgid "B<PR_GET_SECUREBITS> (since Linux 2.6.26)"
2039 msgstr ""
2040
2041 #. type: Plain text
2042 #: build/C/man2/prctl.2:433
2043 msgid ""
2044 "Return (as the function result)  the \"securebits\" flags of the calling "
2045 "thread.  See B<capabilities>(7)."
2046 msgstr ""
2047
2048 #. type: TP
2049 #: build/C/man2/prctl.2:433
2050 #, no-wrap
2051 msgid "B<PR_GET_TID_ADDRESS> (since Linux 3.5)"
2052 msgstr ""
2053
2054 #.  commit 300f786b2683f8bb1ec0afb6e1851183a479c86d
2055 #. type: Plain text
2056 #: build/C/man2/prctl.2:448
2057 msgid ""
2058 "Retrieve the I<clear_child_tid> address set by B<set_tid_address>(2)  and "
2059 "the B<clone>(2)  B<CLONE_CHILD_CLEARTID> flag, in the location pointed to by "
2060 "I<(int\\ **)\\ arg2>.  This feature is available only if the kernel is built "
2061 "with the B<CONFIG_CHECKPOINT_RESTORE> option enabled."
2062 msgstr ""
2063
2064 #. type: TP
2065 #: build/C/man2/prctl.2:448
2066 #, no-wrap
2067 msgid "B<PR_SET_TIMERSLACK> (since Linux 2.6.28)"
2068 msgstr ""
2069
2070 #.  See https://lwn.net/Articles/369549/
2071 #.  commit 6976675d94042fbd446231d1bd8b7de71a980ada
2072 #.  It seems that it's not possible to set the timer slack to zero;
2073 #.  The minimum value is 1? Seems a little strange.
2074 #. type: Plain text
2075 #: build/C/man2/prctl.2:467
2076 msgid ""
2077 "Set the current timer slack for the calling thread to the nanosecond value "
2078 "supplied in I<arg2>.  If I<arg2> is less than or equal to zero, reset the "
2079 "current timer slack to the thread's default timer slack value.  The timer "
2080 "slack is used by the kernel to group timer expirations for the calling "
2081 "thread that are close to one another; as a consequence, timer expirations "
2082 "for the thread may be up to the specified number of nanoseconds late (but "
2083 "will never expire early).  Grouping timer expirations can help reduce system "
2084 "power consumption by minimizing CPU wake-ups."
2085 msgstr ""
2086
2087 #.  List obtained by grepping for futex usage in glibc source
2088 #. type: Plain text
2089 #: build/C/man2/prctl.2:487
2090 msgid ""
2091 "The timer expirations affected by timer slack are those set by B<select>(2), "
2092 "B<pselect>(2), B<poll>(2), B<ppoll>(2), B<epoll_wait>(2), B<epoll_pwait>(2), "
2093 "B<clock_nanosleep>(2), B<nanosleep>(2), and B<futex>(2)  (and thus the "
2094 "library functions implemented via futexes, including "
2095 "B<pthread_cond_timedwait>(3), B<pthread_mutex_timedlock>(3), "
2096 "B<pthread_rwlock_timedrdlock>(3), B<pthread_rwlock_timedwrlock>(3), and "
2097 "B<sem_timedwait>(3))."
2098 msgstr ""
2099
2100 #. type: Plain text
2101 #: build/C/man2/prctl.2:491
2102 msgid ""
2103 "Timer slack is not applied to threads that are scheduled under a realtime "
2104 "scheduling policy (see B<sched_setscheduler>(2))."
2105 msgstr ""
2106
2107 #. type: Plain text
2108 #: build/C/man2/prctl.2:508
2109 msgid ""
2110 "Each thread has two associated timer slack values: a \"default\" value, and "
2111 "a \"current\" value.  The current value is the one that governs grouping of "
2112 "timer expirations.  When a new thread is created, the two timer slack values "
2113 "are made the same as the current value of the creating thread.  Thereafter, "
2114 "a thread can adjust its current timer slack value via B<PR_SET_TIMERSLACK> "
2115 "(the default value can't be changed).  The timer slack values of I<init> "
2116 "(PID 1), the ancestor of all processes, are 50,000 nanoseconds (50 "
2117 "microseconds).  The timer slack values are preserved across B<execve>(2)."
2118 msgstr ""
2119
2120 #. type: TP
2121 #: build/C/man2/prctl.2:508
2122 #, no-wrap
2123 msgid "B<PR_GET_TIMERSLACK> (since Linux 2.6.28)"
2124 msgstr ""
2125
2126 #. type: Plain text
2127 #: build/C/man2/prctl.2:511
2128 msgid "Return the current timer slack value of the calling thread."
2129 msgstr ""
2130
2131 #. type: TP
2132 #: build/C/man2/prctl.2:511
2133 #, no-wrap
2134 msgid "B<PR_SET_TIMING> (since Linux 2.6.0-test4)"
2135 msgstr ""
2136
2137 #.  0
2138 #.  1
2139 #.  PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8,
2140 #.  and looking at the patch history, it appears
2141 #.  that it never did anything.
2142 #. type: Plain text
2143 #: build/C/man2/prctl.2:528
2144 msgid ""
2145 "Set whether to use (normal, traditional) statistical process timing or "
2146 "accurate timestamp-based process timing, by passing B<PR_TIMING_STATISTICAL> "
2147 "or B<PR_TIMING_TIMESTAMP> to I<arg2>.  B<PR_TIMING_TIMESTAMP> is not "
2148 "currently implemented (attempting to set this mode will yield the error "
2149 "B<EINVAL>)."
2150 msgstr ""
2151
2152 #. type: TP
2153 #: build/C/man2/prctl.2:528
2154 #, no-wrap
2155 msgid "B<PR_GET_TIMING> (since Linux 2.6.0-test4)"
2156 msgstr ""
2157
2158 #. type: Plain text
2159 #: build/C/man2/prctl.2:532
2160 msgid ""
2161 "Return (as the function result) which process timing method is currently in "
2162 "use."
2163 msgstr ""
2164
2165 #. type: TP
2166 #: build/C/man2/prctl.2:532
2167 #, no-wrap
2168 msgid "B<PR_TASK_PERF_EVENTS_DISABLE> (since Linux 2.6.31)"
2169 msgstr ""
2170
2171 #. type: Plain text
2172 #: build/C/man2/prctl.2:541
2173 msgid ""
2174 "Disable all performance counters attached to the calling process, regardless "
2175 "of whether the counters were created by this process or another process.  "
2176 "Performance counters created by the calling process for other processes are "
2177 "unaffected.  For more information on performance counters, see the Linux "
2178 "kernel source file I<tools/perf/design.txt>."
2179 msgstr ""
2180
2181 #.  commit 1d1c7ddbfab358445a542715551301b7fc363e28
2182 #. type: Plain text
2183 #: build/C/man2/prctl.2:547
2184 msgid ""
2185 "Originally called B<PR_TASK_PERF_COUNTERS_DISABLE>; renamed (with same "
2186 "numerical value)  in Linux 2.6.32."
2187 msgstr ""
2188
2189 #. type: TP
2190 #: build/C/man2/prctl.2:547
2191 #, no-wrap
2192 msgid "B<PR_TASK_PERF_EVENTS_ENABLE> (since Linux 2.6.31)"
2193 msgstr ""
2194
2195 #. type: Plain text
2196 #: build/C/man2/prctl.2:552
2197 msgid ""
2198 "The converse of B<PR_TASK_PERF_EVENTS_DISABLE>; enable performance counters "
2199 "attached to the calling process."
2200 msgstr ""
2201
2202 #.  commit 1d1c7ddbfab358445a542715551301b7fc363e28
2203 #.  commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6
2204 #. type: Plain text
2205 #: build/C/man2/prctl.2:559
2206 msgid "Originally called B<PR_TASK_PERF_COUNTERS_ENABLE>; renamed in Linux 2.6.32."
2207 msgstr ""
2208
2209 #. type: TP
2210 #: build/C/man2/prctl.2:559
2211 #, no-wrap
2212 msgid "B<PR_SET_TSC> (since Linux 2.6.26, x86 only)"
2213 msgstr ""
2214
2215 #. type: Plain text
2216 #: build/C/man2/prctl.2:572
2217 msgid ""
2218 "Set the state of the flag determining whether the timestamp counter can be "
2219 "read by the process.  Pass B<PR_TSC_ENABLE> to I<arg2> to allow it to be "
2220 "read, or B<PR_TSC_SIGSEGV> to generate a B<SIGSEGV> when the process tries "
2221 "to read the timestamp counter."
2222 msgstr ""
2223
2224 #. type: TP
2225 #: build/C/man2/prctl.2:572
2226 #, no-wrap
2227 msgid "B<PR_GET_TSC> (since Linux 2.6.26, x86 only)"
2228 msgstr ""
2229
2230 #. type: Plain text
2231 #: build/C/man2/prctl.2:578
2232 msgid ""
2233 "Return the state of the flag determining whether the timestamp counter can "
2234 "be read, in the location pointed to by I<(int\\ *) arg2>."
2235 msgstr ""
2236
2237 #. type: TP
2238 #: build/C/man2/prctl.2:578
2239 #, no-wrap
2240 msgid "B<PR_SET_UNALIGN>"
2241 msgstr ""
2242
2243 #. type: Plain text
2244 #: build/C/man2/prctl.2:588
2245 msgid ""
2246 "(Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; PowerPC, "
2247 "since Linux 2.6.18; Alpha, since Linux 2.6.22)  Set unaligned access control "
2248 "bits to I<arg2>.  Pass B<PR_UNALIGN_NOPRINT> to silently fix up unaligned "
2249 "user accesses, or B<PR_UNALIGN_SIGBUS> to generate B<SIGBUS> on unaligned "
2250 "user access."
2251 msgstr ""
2252
2253 #. type: TP
2254 #: build/C/man2/prctl.2:588
2255 #, no-wrap
2256 msgid "B<PR_GET_UNALIGN>"
2257 msgstr ""
2258
2259 #. type: Plain text
2260 #: build/C/man2/prctl.2:595
2261 msgid ""
2262 "(see B<PR_SET_UNALIGN> for information on versions and architectures)  "
2263 "Return unaligned access control bits, in the location pointed to by I<(int\\ "
2264 "*) arg2>."
2265 msgstr ""
2266
2267 #. type: TP
2268 #: build/C/man2/prctl.2:595
2269 #, no-wrap
2270 msgid "B<PR_MCE_KILL> (since Linux 2.6.32)"
2271 msgstr ""
2272
2273 #. type: Plain text
2274 #: build/C/man2/prctl.2:635
2275 msgid ""
2276 "Set the machine check memory corruption kill policy for the current thread.  "
2277 "If I<arg2> is B<PR_MCE_KILL_CLEAR>, clear the thread memory corruption kill "
2278 "policy and use the system-wide default.  (The system-wide default is defined "
2279 "by I</proc/sys/vm/memory_failure_early_kill>; see B<proc>(5).)  If I<arg2> "
2280 "is B<PR_MCE_KILL_SET>, use a thread-specific memory corruption kill policy.  "
2281 "In this case, I<arg3> defines whether the policy is I<early kill> "
2282 "(B<PR_MCE_KILL_EARLY>), I<late kill> (B<PR_MCE_KILL_LATE>), or the "
2283 "system-wide default (B<PR_MCE_KILL_DEFAULT>).  Early kill means that the "
2284 "thread receives a B<SIGBUS> signal as soon as hardware memory corruption is "
2285 "detected inside its address space.  In late kill mode, the process is killed "
2286 "only when it accesses a corrupted page.  See B<sigaction>(2)  for more "
2287 "information on the B<SIGBUS> signal.  The policy is inherited by children.  "
2288 "The remaining unused B<prctl>()  arguments must be zero for future "
2289 "compatibility."
2290 msgstr ""
2291
2292 #. type: TP
2293 #: build/C/man2/prctl.2:635
2294 #, no-wrap
2295 msgid "B<PR_MCE_KILL_GET> (since Linux 2.6.32)"
2296 msgstr ""
2297
2298 #. type: Plain text
2299 #: build/C/man2/prctl.2:641
2300 msgid ""
2301 "Return the current per-process machine check kill policy.  All unused "
2302 "B<prctl>()  arguments must be zero."
2303 msgstr ""
2304
2305 #. type: TP
2306 #: build/C/man2/prctl.2:641
2307 #, no-wrap
2308 msgid "B<PR_SET_MM> (since Linux 3.3)"
2309 msgstr ""
2310
2311 #. type: Plain text
2312 #: build/C/man2/prctl.2:661
2313 msgid ""
2314 "Modify certain kernel memory map descriptor fields of the calling process.  "
2315 "Usually these fields are set by the kernel and dynamic loader (see "
2316 "B<ld.so>(8)  for more information) and a regular application should not use "
2317 "this feature.  However, there are cases, such as self-modifying programs, "
2318 "where a program might find it useful to change its own memory map.  This "
2319 "feature is available only if the kernel is built with the "
2320 "B<CONFIG_CHECKPOINT_RESTORE> option enabled.  The calling process must have "
2321 "the B<CAP_SYS_RESOURCE> capability.  The value in I<arg2> is one of the "
2322 "options below, while I<arg3> provides a new value for the option."
2323 msgstr ""
2324
2325 #. type: TP
2326 #: build/C/man2/prctl.2:662
2327 #, no-wrap
2328 msgid "B<PR_SET_MM_START_CODE>"
2329 msgstr ""
2330
2331 #. type: Plain text
2332 #: build/C/man2/prctl.2:671
2333 msgid ""
2334 "Set the address above which the program text can run.  The corresponding "
2335 "memory area must be readable and executable, but not writable or sharable "
2336 "(see B<mprotect>(2)  and B<mmap>(2)  for more information)."
2337 msgstr ""
2338
2339 #. type: TP
2340 #: build/C/man2/prctl.2:671
2341 #, no-wrap
2342 msgid "B<PR_SET_MM_END_CODE>"
2343 msgstr ""
2344
2345 #. type: Plain text
2346 #: build/C/man2/prctl.2:676
2347 msgid ""
2348 "Set the address below which the program text can run.  The corresponding "
2349 "memory area must be readable and executable, but not writable or sharable."
2350 msgstr ""
2351
2352 #. type: TP
2353 #: build/C/man2/prctl.2:676
2354 #, no-wrap
2355 msgid "B<PR_SET_MM_START_DATA>"
2356 msgstr ""
2357
2358 #. type: Plain text
2359 #: build/C/man2/prctl.2:682
2360 msgid ""
2361 "Set the address above which initialized and uninitialized (bss) data are "
2362 "placed.  The corresponding memory area must be readable and writable, but "
2363 "not executable or sharable."
2364 msgstr ""
2365
2366 #. type: TP
2367 #: build/C/man2/prctl.2:682
2368 #, no-wrap
2369 msgid "B<PR_SET_MM_END_DATA>"
2370 msgstr ""
2371
2372 #. type: Plain text
2373 #: build/C/man2/prctl.2:688
2374 msgid ""
2375 "Set the address below which initialized and uninitialized (bss) data are "
2376 "placed.  The corresponding memory area must be readable and writable, but "
2377 "not executable or sharable."
2378 msgstr ""
2379
2380 #. type: TP
2381 #: build/C/man2/prctl.2:688
2382 #, no-wrap
2383 msgid "B<PR_SET_MM_START_STACK>"
2384 msgstr ""
2385
2386 #. type: Plain text
2387 #: build/C/man2/prctl.2:692
2388 msgid ""
2389 "Set the start address of the stack.  The corresponding memory area must be "
2390 "readable and writable."
2391 msgstr ""
2392
2393 #. type: TP
2394 #: build/C/man2/prctl.2:692
2395 #, no-wrap
2396 msgid "B<PR_SET_MM_START_BRK>"
2397 msgstr ""
2398
2399 #. type: Plain text
2400 #: build/C/man2/prctl.2:704
2401 msgid ""
2402 "Set the address above which the program heap can be expanded with B<brk>(2)  "
2403 "call.  The address must be greater than the ending address of the current "
2404 "program data segment.  In addition, the combined size of the resulting heap "
2405 "and the size of the data segment can't exceed the B<RLIMIT_DATA> resource "
2406 "limit (see B<setrlimit>(2))."
2407 msgstr ""
2408
2409 #. type: TP
2410 #: build/C/man2/prctl.2:704
2411 #, no-wrap
2412 msgid "B<PR_SET_MM_BRK>"
2413 msgstr ""
2414
2415 #.  FIXME The following (until ========) is not yet in mainline kernel,
2416 #.  so commented out for the moment.
2417 #.  .TP
2418 #.  .BR PR_SET_MM_ARG_START
2419 #.  Set the address above which the program command line is placed.
2420 #.  .TP
2421 #.  .BR PR_SET_MM_ARG_END
2422 #.  Set the address below which the program command line is placed.
2423 #.  .TP
2424 #.  .BR PR_SET_MM_ENV_START
2425 #.  Set the address above which the program environment is placed.
2426 #.  .TP
2427 #.  .BR PR_SET_MM_ENV_END
2428 #.  Set the address below which the program environment is placed.
2429 #.  .IP
2430 #.  The address passed with
2431 #.  .BR PR_SET_MM_ARG_START ,
2432 #.  .BR PR_SET_MM_ARG_END ,
2433 #.  .BR PR_SET_MM_ENV_START ,
2434 #.  and
2435 #.  .BR PR_SET_MM_ENV_END
2436 #.  should belong to a process stack area.
2437 #.  Thus, the corresponding memory area must be readable, writable, and
2438 #.  (depending on the kernel configuration) have the
2439 #.  .BR MAP_GROWSDOWN
2440 #.  attribute set (see
2441 #.  .BR mmap (2)).
2442 #.  .TP
2443 #.  .BR PR_SET_MM_AUXV
2444 #.  Set a new auxiliary vector.
2445 #.  The
2446 #.  .I arg3
2447 #.  argument should provide the address of the vector.
2448 #.  The
2449 #.  .I arg4
2450 #.  is the size of the vector.
2451 #.  .TP
2452 #.  .BR PR_SET_MM_EXE_FILE
2453 #.  Supersede the
2454 #.  .IR /proc/pid/exe
2455 #.  symbolic link with a new one pointing to a new executable file
2456 #.  identified by the file descriptor provided in
2457 #.  .I arg3
2458 #.  argument.
2459 #.  The file descriptor should be obtained with a regular
2460 #.  .BR open (2)
2461 #.  call.
2462 #.  .IP
2463 #.  To change the symbolic link, one needs to unmap all existing
2464 #.  executable memory areas, including those created by the kernel itself
2465 #.  (for example the kernel usually creates at least one executable
2466 #.  memory area for the ELF
2467 #.  .IR .text
2468 #.  section).
2469 #.  .IP
2470 #.  The second limitation is that such transitions can be done only once
2471 #.  in a process life time.
2472 #.  Any further attempts will be rejected.
2473 #.  This should help system administrators to monitor unusual
2474 #.  symbolic-link transitions over all process running in a system.
2475 #.  ========== END FIXME
2476 #. type: Plain text
2477 #: build/C/man2/prctl.2:773
2478 msgid ""
2479 "Set the current B<brk>(2)  value.  The requirements for the address are the "
2480 "same as for the B<PR_SET_MM_START_BRK> option."
2481 msgstr ""
2482
2483 #. type: Plain text
2484 #: build/C/man2/prctl.2:793
2485 msgid ""
2486 "On success, B<PR_GET_DUMPABLE>, B<PR_GET_KEEPCAPS>, B<PR_GET_NO_NEW_PRIVS>, "
2487 "B<PR_CAPBSET_READ>, B<PR_GET_TIMING>, B<PR_GET_SECUREBITS>, "
2488 "B<PR_MCE_KILL_GET>, and (if it returns)  B<PR_GET_SECCOMP> return the "
2489 "nonnegative values described above.  All other I<option> values return 0 on "
2490 "success.  On error, -1 is returned, and I<errno> is set appropriately."
2491 msgstr ""
2492
2493 #. type: Plain text
2494 #: build/C/man2/prctl.2:798
2495 msgid "I<arg2> is an invalid address."
2496 msgstr ""
2497
2498 #. type: Plain text
2499 #: build/C/man2/prctl.2:803
2500 msgid "The value of I<option> is not recognized."
2501 msgstr ""
2502
2503 #. type: Plain text
2504 #: build/C/man2/prctl.2:815
2505 msgid ""
2506 "I<option> is B<PR_MCE_KILL> or B<PR_MCE_KILL_GET> or B<PR_SET_MM>, and "
2507 "unused B<prctl>()  arguments were not specified as zero."
2508 msgstr ""
2509
2510 #. type: Plain text
2511 #: build/C/man2/prctl.2:820
2512 msgid "I<arg2> is not valid value for this I<option>."
2513 msgstr ""
2514
2515 #. type: Plain text
2516 #: build/C/man2/prctl.2:829
2517 msgid ""
2518 "I<option> is B<PR_SET_SECCOMP> or B<PR_GET_SECCOMP>, and the kernel was not "
2519 "configured with B<CONFIG_SECCOMP>."
2520 msgstr ""
2521
2522 #. type: Plain text
2523 #: build/C/man2/prctl.2:835
2524 msgid "I<option> is B<PR_SET_MM>, and one of the following is true"
2525 msgstr ""
2526
2527 #. type: Plain text
2528 #: build/C/man2/prctl.2:841
2529 msgid "I<arg4> or I<arg5> is nonzero;"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man2/prctl.2:846
2534 msgid ""
2535 "I<arg3> is greater than B<TASK_SIZE> (the limit on the size of the user "
2536 "address space for this architecture);"
2537 msgstr ""
2538
2539 #. type: Plain text
2540 #: build/C/man2/prctl.2:856
2541 msgid ""
2542 "I<arg2> is B<PR_SET_MM_START_CODE>, B<PR_SET_MM_END_CODE>, "
2543 "B<PR_SET_MM_START_DATA>, B<PR_SET_MM_END_DATA>, or B<PR_SET_MM_START_STACK,> "
2544 "and the permissions of the corresponding memory area are not as required;"
2545 msgstr ""
2546
2547 #. type: Plain text
2548 #: build/C/man2/prctl.2:868
2549 msgid ""
2550 "I<arg2> is B<PR_SET_MM_START_BRK> or B<PR_SET_MM_BRK>, and I<arg3> is less "
2551 "than or equal to the end of the data segment or specifies a value that would "
2552 "cause the B<RLIMIT_DATA> resource limit to be exceeded."
2553 msgstr ""
2554
2555 #. type: Plain text
2556 #: build/C/man2/prctl.2:879
2557 msgid ""
2558 "I<option> is B<PR_SET_PTRACER> and I<arg2> is not 0, B<PR_SET_PTRACER_ANY>, "
2559 "or the PID of an existing process."
2560 msgstr ""
2561
2562 #. type: Plain text
2563 #: build/C/man2/prctl.2:891
2564 msgid ""
2565 "I<option> is B<PR_SET_SECUREBITS>, and the caller does not have the "
2566 "B<CAP_SETPCAP> capability, or tried to unset a \"locked\" flag, or tried to "
2567 "set a flag whose corresponding locked flag was set (see B<capabilities>(7))."
2568 msgstr ""
2569
2570 #. type: Plain text
2571 #: build/C/man2/prctl.2:901
2572 msgid ""
2573 "I<option> is B<PR_SET_KEEPCAPS>, and the callers's "
2574 "B<SECURE_KEEP_CAPS_LOCKED> flag is set (see B<capabilities>(7))."
2575 msgstr ""
2576
2577 #. type: Plain text
2578 #: build/C/man2/prctl.2:909
2579 msgid ""
2580 "I<option> is B<PR_CAPBSET_DROP>, and the caller does not have the "
2581 "B<CAP_SETPCAP> capability."
2582 msgstr ""
2583
2584 #.  FIXME The following (until ========) is not yet in mainline kernel,
2585 #.  so commented out for the moment.
2586 #.  .TP
2587 #.  .B EACCES
2588 #.  .I option
2589 #.  is
2590 #.  .BR PR_SET_MM ,
2591 #.  and
2592 #.  .I arg3
2593 #.  is
2594 #.  .BR PR_SET_MM_EXE_FILE ,
2595 #.  the file is not executable.
2596 #.  .TP
2597 #.  .B EBUSY
2598 #.  .I option
2599 #.  is
2600 #.  .BR PR_SET_MM ,
2601 #.  .I arg3
2602 #.  is
2603 #.  .BR PR_SET_MM_EXE_FILE ,
2604 #.  and this the second attempt to change the
2605 #.  .I /proc/pid/exe
2606 #.  symbolic link, which is prohibited.
2607 #.  .TP
2608 #.  .B EBADF
2609 #.  .I option
2610 #.  is
2611 #.  .BR PR_SET_MM ,
2612 #.  .I arg3
2613 #.  is
2614 #.  .BR PR_SET_MM_EXE_FILE ,
2615 #.  and the file descriptor passed in
2616 #.  .I arg4
2617 #.  is not valid.
2618 #.  ========== END FIXME
2619 #.  The following can't actually happen, because prctl() in
2620 #.  seccomp mode will cause SIGKILL.
2621 #.  .TP
2622 #.  .B EPERM
2623 #.  .I option
2624 #.  is
2625 #.  .BR PR_SET_SECCOMP ,
2626 #.  and secure computing mode is already 1.
2627 #. type: Plain text
2628 #: build/C/man2/prctl.2:960
2629 msgid ""
2630 "I<option> is B<PR_SET_MM>, and the caller does not have the "
2631 "B<CAP_SYS_RESOURCE> capability."
2632 msgstr ""
2633
2634 #.  The library interface was added in glibc 2.0.6
2635 #. type: Plain text
2636 #: build/C/man2/prctl.2:965
2637 msgid "The B<prctl>()  system call was introduced in Linux 2.1.57."
2638 msgstr ""
2639
2640 #. type: Plain text
2641 #: build/C/man2/prctl.2:972
2642 msgid ""
2643 "This call is Linux-specific.  IRIX has a B<prctl>()  system call (also "
2644 "introduced in Linux 2.1.44 as irix_prctl on the MIPS architecture), with "
2645 "prototype"
2646 msgstr ""
2647
2648 #. type: Plain text
2649 #: build/C/man2/prctl.2:974
2650 msgid "B<ptrdiff_t prctl(int >I<option>B<, int >I<arg2>B<, int >I<arg3>B<);>"
2651 msgstr ""
2652
2653 #. type: Plain text
2654 #: build/C/man2/prctl.2:979
2655 msgid ""
2656 "and options to get the maximum number of processes per user, get the maximum "
2657 "number of processors the calling process can use, find out whether a "
2658 "specified process is currently blocked, get or set the maximum stack size, "
2659 "and so on."
2660 msgstr ""
2661
2662 #. type: Plain text
2663 #: build/C/man2/prctl.2:982
2664 msgid "B<signal>(2), B<core>(5)"
2665 msgstr ""
2666
2667 #. type: TH
2668 #: build/C/man3/profil.3:28
2669 #, no-wrap
2670 msgid "PROFIL"
2671 msgstr ""
2672
2673 #. type: Plain text
2674 #: build/C/man3/profil.3:31
2675 msgid "profil - execution time profile"
2676 msgstr ""
2677
2678 #. type: Plain text
2679 #: build/C/man3/profil.3:34
2680 #, no-wrap
2681 msgid "B<#include E<lt>unistd.hE<gt>>\n"
2682 msgstr ""
2683
2684 #. type: Plain text
2685 #: build/C/man3/profil.3:37
2686 #, no-wrap
2687 msgid ""
2688 "B<int profil(unsigned short *>I<buf>B<, size_t >I<bufsiz>B<,>\n"
2689 "B<           size_t >I<offset>B<, unsigned int >I<scale>B<);>\n"
2690 msgstr ""
2691
2692 #. type: Plain text
2693 #: build/C/man3/profil.3:46
2694 msgid "B<profil>(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\\ E<lt>\\ 500)"
2695 msgstr ""
2696
2697 #. type: Plain text
2698 #: build/C/man3/profil.3:68
2699 msgid ""
2700 "This routine provides a means to find out in what areas your program spends "
2701 "most of its time.  The argument I<buf> points to I<bufsiz> bytes of core.  "
2702 "Every virtual 10 milliseconds, the user's program counter (PC)  is examined: "
2703 "I<offset> is subtracted and the result is multiplied by I<scale> and divided "
2704 "by 65536.  If the resulting value is less than I<bufsiz>, then the "
2705 "corresponding entry in I<buf> is incremented.  If I<buf> is NULL, profiling "
2706 "is disabled."
2707 msgstr ""
2708
2709 #. type: Plain text
2710 #: build/C/man3/profil.3:70
2711 msgid "Zero is always returned."
2712 msgstr ""
2713
2714 #. type: Plain text
2715 #: build/C/man3/profil.3:72
2716 msgid "Similar to a call in SVr4 (but not POSIX.1-2001)."
2717 msgstr ""
2718
2719 #. type: Plain text
2720 #: build/C/man3/profil.3:78
2721 msgid ""
2722 "B<profil>()  cannot be used on a program that also uses B<ITIMER_PROF> "
2723 "interval timers (see B<setitimer>(2))."
2724 msgstr ""
2725
2726 #. type: Plain text
2727 #: build/C/man3/profil.3:81
2728 msgid ""
2729 "True kernel profiling provides more accurate results.  Libc 4.4 contained a "
2730 "kernel patch providing a system call profil."
2731 msgstr ""
2732
2733 #. type: Plain text
2734 #: build/C/man3/profil.3:86
2735 msgid "B<gprof>(1), B<setitimer>(2), B<sigaction>(2), B<signal>(2)"
2736 msgstr ""
2737
2738 #. type: TH
2739 #: build/C/man3/psignal.3:30
2740 #, no-wrap
2741 msgid "PSIGNAL"
2742 msgstr ""
2743
2744 #. type: TH
2745 #: build/C/man3/psignal.3:30
2746 #, no-wrap
2747 msgid "2010-10-06"
2748 msgstr ""
2749
2750 #. type: TH
2751 #: build/C/man3/psignal.3:30 build/C/man3/raise.3:29 build/C/man7/sigevent.7:26
2752 #, no-wrap
2753 msgid "GNU"
2754 msgstr ""
2755
2756 #. type: Plain text
2757 #: build/C/man3/psignal.3:33
2758 msgid "psignal, psiginfo - print signal message"
2759 msgstr ""
2760
2761 #. type: Plain text
2762 #: build/C/man3/psignal.3:39
2763 #, no-wrap
2764 msgid ""
2765 "B<void psignal(int >I<sig>B<, const char *>I<s>B<);>\n"
2766 "B<void psiginfo(const siginfo_t *>I<pinfo>B<, const char *>I<s>B<);>\n"
2767 msgstr ""
2768
2769 #. type: Plain text
2770 #: build/C/man3/psignal.3:41
2771 #, no-wrap
2772 msgid "B<extern const char *const >I<sys_siglist>B<[];>\n"
2773 msgstr ""
2774
2775 #. type: Plain text
2776 #: build/C/man3/psignal.3:50
2777 msgid "B<psignal>(): _SVID_SOURCE || _BSD_SOURCE"
2778 msgstr ""
2779
2780 #. type: Plain text
2781 #: build/C/man3/psignal.3:53
2782 msgid ""
2783 "B<psiginfo>(): _XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ "
2784 "200809L"
2785 msgstr ""
2786
2787 #. type: Plain text
2788 #: build/C/man3/psignal.3:56
2789 msgid "I<sys_siglist>: _BSD_SOURCE"
2790 msgstr ""
2791
2792 #. type: Plain text
2793 #: build/C/man3/psignal.3:65
2794 msgid ""
2795 "The B<psignal>()  function displays a message on I<stderr> consisting of the "
2796 "string I<s>, a colon, a space, a string describing the signal number I<sig>, "
2797 "and a trailing newline.  If the string I<s> is NULL or empty, the colon and "
2798 "space are omitted.  If I<sig> is invalid, the message displayed will "
2799 "indicate an unknown signal."
2800 msgstr ""
2801
2802 #. type: Plain text
2803 #: build/C/man3/psignal.3:86
2804 msgid ""
2805 "The B<psiginfo>()  function is like B<psignal>(), except that it displays "
2806 "information about the signal described by I<pinfo>, which should point to a "
2807 "valid I<siginfo_t> structure.  As well as the signal description, "
2808 "B<psiginfo>()  displays information about the origin of the signal, and "
2809 "other information relevant to the signal (e.g., the relevant memory address "
2810 "for hardware-generated signals, the child process ID for B<SIGCHLD>, and the "
2811 "user ID and process ID of the sender, for signals set using B<kill>(2)  or "
2812 "B<sigqueue>(3))."
2813 msgstr ""
2814
2815 #. type: Plain text
2816 #: build/C/man3/psignal.3:89
2817 msgid ""
2818 "The array I<sys_siglist> holds the signal description strings indexed by "
2819 "signal number."
2820 msgstr ""
2821
2822 #. type: Plain text
2823 #: build/C/man3/psignal.3:95
2824 msgid "The B<psignal>()  and B<psiginfo>()  functions return no value."
2825 msgstr ""
2826
2827 #. type: Plain text
2828 #: build/C/man3/psignal.3:99
2829 msgid "The B<psiginfo>()  function was added to glibc in version 2.10."
2830 msgstr ""
2831
2832 #. type: Plain text
2833 #: build/C/man3/psignal.3:101
2834 msgid "POSIX.1-2008, 4.3BSD."
2835 msgstr ""
2836
2837 #. type: Plain text
2838 #: build/C/man3/psignal.3:105
2839 msgid "In glibc versions up to 2.12, B<psiginfo>()  had the following bugs:"
2840 msgstr ""
2841
2842 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12107
2843 #.  Reportedly now fixed; check glibc 2.13
2844 #. type: Plain text
2845 #: build/C/man3/psignal.3:109
2846 msgid "In some circumstances, a trailing newline is not printed."
2847 msgstr ""
2848
2849 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12108
2850 #.  Reportedly now fixed; check glibc 2.13
2851 #. type: Plain text
2852 #: build/C/man3/psignal.3:113
2853 msgid "Additional details are not displayed for real-time signals."
2854 msgstr ""
2855
2856 #. type: Plain text
2857 #: build/C/man3/psignal.3:118
2858 msgid "B<sigaction>(2), B<perror>(3), B<strsignal>(3), B<signal>(7)"
2859 msgstr ""
2860
2861 #. type: TH
2862 #: build/C/man3/raise.3:29
2863 #, no-wrap
2864 msgid "RAISE"
2865 msgstr ""
2866
2867 #. type: TH
2868 #: build/C/man3/raise.3:29
2869 #, no-wrap
2870 msgid "2012-04-20"
2871 msgstr ""
2872
2873 #. type: Plain text
2874 #: build/C/man3/raise.3:32
2875 msgid "raise - send a signal to the caller"
2876 msgstr ""
2877
2878 #. type: Plain text
2879 #: build/C/man3/raise.3:37
2880 #, no-wrap
2881 msgid "B<int raise(int >I<sig>B<);>\n"
2882 msgstr ""
2883
2884 #. type: Plain text
2885 #: build/C/man3/raise.3:43
2886 msgid ""
2887 "The B<raise>()  function sends a signal to the calling process or thread.  "
2888 "In a single-threaded program it is equivalent to"
2889 msgstr ""
2890
2891 #. type: Plain text
2892 #: build/C/man3/raise.3:47
2893 #, no-wrap
2894 msgid "kill(getpid(), sig);\n"
2895 msgstr ""
2896
2897 #. type: Plain text
2898 #: build/C/man3/raise.3:51
2899 msgid "In a multithreaded program it is equivalent to"
2900 msgstr ""
2901
2902 #. type: Plain text
2903 #: build/C/man3/raise.3:55
2904 #, no-wrap
2905 msgid "pthread_kill(pthread_self(), sig);\n"
2906 msgstr ""
2907
2908 #. type: Plain text
2909 #: build/C/man3/raise.3:61
2910 msgid ""
2911 "If the signal causes a handler to be called, B<raise>()  will return only "
2912 "after the signal handler has returned."
2913 msgstr ""
2914
2915 #. type: Plain text
2916 #: build/C/man3/raise.3:64
2917 msgid "B<raise>()  returns 0 on success, and nonzero for failure."
2918 msgstr ""
2919
2920 #. type: Plain text
2921 #: build/C/man3/raise.3:66 build/C/man2/signal.2:112
2922 msgid "C89, C99, POSIX.1-2001."
2923 msgstr ""
2924
2925 #.  2.3.2 used the obsolete tkill(), if available.
2926 #. type: Plain text
2927 #: build/C/man3/raise.3:77
2928 msgid ""
2929 "Since version 2.3.3, glibc implements B<raise>()  by calling B<tgkill>(2), "
2930 "if the kernel supports that system call.  Older glibc versions implemented "
2931 "B<raise>()  using B<kill>(2)."
2932 msgstr ""
2933
2934 #. type: Plain text
2935 #: build/C/man3/raise.3:84
2936 msgid ""
2937 "B<getpid>(2), B<kill>(2), B<sigaction>(2), B<signal>(2), B<pthread_kill>(3), "
2938 "B<signal>(7)"
2939 msgstr ""
2940
2941 #. type: TH
2942 #: build/C/man2/restart_syscall.2:33
2943 #, no-wrap
2944 msgid "RESTART_SYSCALL"
2945 msgstr ""
2946
2947 #. type: TH
2948 #: build/C/man2/restart_syscall.2:33 build/C/man2/sigaction.2:47 build/C/man7/signal.7:46 build/C/man2/sigreturn.2:29
2949 #, no-wrap
2950 msgid "2013-07-30"
2951 msgstr ""
2952
2953 #. type: Plain text
2954 #: build/C/man2/restart_syscall.2:36
2955 msgid "restart_syscall - restart a system call after interruption by a stop signal"
2956 msgstr ""
2957
2958 #. type: Plain text
2959 #: build/C/man2/restart_syscall.2:38
2960 msgid "B<int restart_syscall(void);>"
2961 msgstr ""
2962
2963 #. type: Plain text
2964 #: build/C/man2/restart_syscall.2:41
2965 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
2966 msgstr ""
2967
2968 #. type: Plain text
2969 #: build/C/man2/restart_syscall.2:53
2970 msgid ""
2971 "The B<restart_syscall>()  system call is used to restart certain system "
2972 "calls after a process that was stopped by a signal (e.g., B<SIGSTOP> or "
2973 "B<SIGTSTP>)  is later resumed after receiving a B<SIGCONT> signal.  This "
2974 "system call is designed only for internal use by the kernel."
2975 msgstr ""
2976
2977 #.  These system calls correspond to the special internal errno value
2978 #.  ERESTART_RESTARTBLOCK. Each of the system calls has a "restart"
2979 #.  helper function that is invoked by restart_syscall().
2980 #. type: Plain text
2981 #: build/C/man2/restart_syscall.2:84
2982 msgid ""
2983 "B<restart_syscall>()  is used for restarting only those system calls that, "
2984 "when restarted, should adjust their time-related parameters\\(emnamely "
2985 "B<poll>(2)  (since Linux 2.6.24), B<nanosleep>(2)  (since Linux 2.6), "
2986 "B<clock_nanosleep>(2)  (since Linux 2.6), and B<futex>(2), when employed "
2987 "with the B<FUTEX_WAIT> (since Linux 2.6.22)  and B<FUTEX_WAIT_BITSET> (since "
2988 "Linux 2.6.31)  operations.  B<restart_syscall>()  restarts the interrupted "
2989 "system call with a time argument that is suitably adjusted to account for "
2990 "the time that has already elapsed (including the time where the process was "
2991 "stopped by a signal).  Without the B<restart_syscall>()  mechanism, "
2992 "restarting these system calls would not correctly deduce the already elapsed "
2993 "time when the process continued execution."
2994 msgstr ""
2995
2996 #. type: Plain text
2997 #: build/C/man2/restart_syscall.2:88
2998 msgid ""
2999 "The return value of B<restart_syscall>()  is the return value of whatever "
3000 "system call is being restarted."
3001 msgstr ""
3002
3003 #. type: Plain text
3004 #: build/C/man2/restart_syscall.2:92
3005 msgid ""
3006 "I<errno> is set as per the errors for whatever system call is being "
3007 "restarted by B<restart_syscall>()."
3008 msgstr ""
3009
3010 #. type: Plain text
3011 #: build/C/man2/restart_syscall.2:96
3012 msgid "The B<restart_syscall>()  system call is present since Linux 2.6."
3013 msgstr ""
3014
3015 #. type: Plain text
3016 #: build/C/man2/restart_syscall.2:98
3017 msgid "This system call is Linux specific."
3018 msgstr ""
3019
3020 #. type: Plain text
3021 #: build/C/man2/restart_syscall.2:102
3022 msgid ""
3023 "There is no glibc wrapper for this system call, because it is intended for "
3024 "use only by the kernel and should never be called by applications."
3025 msgstr ""
3026
3027 #
3028 #.  FIXME
3029 #.  There is one oddness in the implementation though, with respect to
3030 #.  nanosleep() (and probably also clock_nanosleep()). The scenario
3031 #.  is as follows:
3032 #.     1. Start a nanosleep() for (say) 30 seconds,
3033 #.     2. Stop the process with (say) SIGTSTP (^Z).
3034 #.     3. Resume the process with SIGCONT,
3035 #.     4. Upon return, the 'rem' argument of nanosleep() will contain the
3036 #.        remaining unslept time **at the time when SIGTSTP was delivered**.
3037 #.  The behavior at point 4 is odd, but doesn't violate the standards, which
3038 #.  specify the treatment of 'rem' only when the system call returns with
3039 #.  the error EINTR (i.e., the call was interrupted by a signal handler).
3040 #. type: Plain text
3041 #: build/C/man2/restart_syscall.2:123
3042 msgid ""
3043 "From user space, the operation of B<restart_syscall>(2)  is largely "
3044 "invisible: to the process that made the system call that is restarted, it "
3045 "appears as though that system call executed and returned in the usual "
3046 "fashion."
3047 msgstr ""
3048
3049 #.  FIXME select(2) should probably get the restart_syscall() treatment:
3050 #.      If a select() call is suspended by stop-sig+SIGCONT, the time
3051 #.      spent suspended is *not* deducted when the select() is restarted.
3052 #.  FIXME: check whether recvmmsg() handles stop-sig+SIGCONT properly.
3053 #. type: Plain text
3054 #: build/C/man2/restart_syscall.2:131
3055 msgid "B<sigreturn>(2), B<sigaction>(2), B<signal>(7)"
3056 msgstr ""
3057
3058 #. type: TH
3059 #: build/C/man2/rt_sigqueueinfo.2:25
3060 #, no-wrap
3061 msgid "RT_SIGQUEUEINFO"
3062 msgstr ""
3063
3064 #. type: TH
3065 #: build/C/man2/rt_sigqueueinfo.2:25 build/C/man2/sgetmask.2:26 build/C/man2/tkill.2:29
3066 #, no-wrap
3067 msgid "2012-07-13"
3068 msgstr ""
3069
3070 #. type: Plain text
3071 #: build/C/man2/rt_sigqueueinfo.2:28
3072 msgid "rt_sigqueueinfo, rt_tgsigqueueinfo - queue a signal and data"
3073 msgstr ""
3074
3075 #. type: Plain text
3076 #: build/C/man2/rt_sigqueueinfo.2:31
3077 #, no-wrap
3078 msgid ""
3079 "B<int rt_sigqueueinfo(pid_t >I<tgid>B<, int >I<sig>B<, siginfo_t "
3080 "*>I<uinfo>B<);>\n"
3081 msgstr ""
3082
3083 #. type: Plain text
3084 #: build/C/man2/rt_sigqueueinfo.2:34
3085 #, no-wrap
3086 msgid ""
3087 "B<int rt_tgsigqueueinfo(pid_t >I<tgid>B<, pid_t >I<tid>B<, int >I<sig>B<,>\n"
3088 "B<                      siginfo_t *>I<uinfo>B<);>\n"
3089 msgstr ""
3090
3091 #. type: Plain text
3092 #: build/C/man2/rt_sigqueueinfo.2:38 build/C/man2/sgetmask.2:36 build/C/man2/tkill.2:41
3093 msgid "I<Note>: There are no glibc wrappers for these system calls; see NOTES."
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man2/rt_sigqueueinfo.2:50
3098 msgid ""
3099 "The B<rt_sigqueueinfo>()  and B<rt_tgsigqueueinfo>()  system calls are the "
3100 "low-level interfaces used to send a signal plus data to a process or "
3101 "thread.  The receiver of the signal can obtain the accompanying data by "
3102 "establishing a signal handler with the B<sigaction>(2)  B<SA_SIGINFO> flag."
3103 msgstr ""
3104
3105 #. type: Plain text
3106 #: build/C/man2/rt_sigqueueinfo.2:56
3107 msgid ""
3108 "These system calls are not intended for direct application use; they are "
3109 "provided to allow the implementation of B<sigqueue>(3)  and "
3110 "B<pthread_sigqueue>(3)."
3111 msgstr ""
3112
3113 #. type: Plain text
3114 #: build/C/man2/rt_sigqueueinfo.2:68
3115 msgid ""
3116 "The B<rt_sigqueueinfo>()  system call sends the signal I<sig> to the thread "
3117 "group with the ID I<tgid>.  (The term \"thread group\" is synonymous with "
3118 "\"process\", and I<tid> corresponds to the traditional UNIX process ID.)  "
3119 "The signal will be delivered to an arbitrary member of the thread group "
3120 "(i.e., one of the threads that is not currently blocking the signal)."
3121 msgstr ""
3122
3123 #. type: Plain text
3124 #: build/C/man2/rt_sigqueueinfo.2:79
3125 msgid ""
3126 "The I<uinfo> argument specifies the data to accompany the signal.  This "
3127 "argument is a pointer to a structure of type I<siginfo_t>, described in "
3128 "B<sigaction>(2)  (and defined by including I<E<lt>sigaction.hE<gt>>).  The "
3129 "caller should set the following fields in this structure:"
3130 msgstr ""
3131
3132 #. type: TP
3133 #: build/C/man2/rt_sigqueueinfo.2:79 build/C/man7/sigevent.7:88 build/C/man2/wait.2:316
3134 #, no-wrap
3135 msgid "I<si_code>"
3136 msgstr ""
3137
3138 #.  tkill(2) or
3139 #. type: Plain text
3140 #: build/C/man2/rt_sigqueueinfo.2:95
3141 msgid ""
3142 "This must be one of the B<SI_*> codes in the Linux kernel source file "
3143 "I<include/asm-generic/siginfo.h>, with the restriction that the code must be "
3144 "negative (i.e., cannot be B<SI_USER>, which is used by the kernel to "
3145 "indicate a signal sent by B<kill>(2))  and cannot (since Linux 2.6.39) be "
3146 "B<SI_TKILL> (which is used by the kernel to indicate a signal sent using "
3147 "B<tgkill>(2))."
3148 msgstr ""
3149
3150 #. type: TP
3151 #: build/C/man2/rt_sigqueueinfo.2:95 build/C/man2/wait.2:295
3152 #, no-wrap
3153 msgid "I<si_pid>"
3154 msgstr ""
3155
3156 #. type: Plain text
3157 #: build/C/man2/rt_sigqueueinfo.2:99
3158 msgid "This should be set to a process ID, typically the process ID of the sender."
3159 msgstr ""
3160
3161 #. type: TP
3162 #: build/C/man2/rt_sigqueueinfo.2:99 build/C/man2/wait.2:298
3163 #, no-wrap
3164 msgid "I<si_uid>"
3165 msgstr ""
3166
3167 #. type: Plain text
3168 #: build/C/man2/rt_sigqueueinfo.2:103
3169 msgid "This should be set to a user ID, typically the real user ID of the sender."
3170 msgstr ""
3171
3172 #. type: TP
3173 #: build/C/man2/rt_sigqueueinfo.2:103 build/C/man7/sigevent.7:96
3174 #, no-wrap
3175 msgid "I<si_value>"
3176 msgstr ""
3177
3178 #. type: Plain text
3179 #: build/C/man2/rt_sigqueueinfo.2:110
3180 msgid ""
3181 "This field contains the user data to accompany the signal.  For more "
3182 "information, see the description of the last (I<union sigval>)  argument of "
3183 "B<sigqueue>(3)."
3184 msgstr ""
3185
3186 #. type: Plain text
3187 #: build/C/man2/rt_sigqueueinfo.2:117
3188 msgid ""
3189 "Internally, the kernel sets the I<si_signo> field to the value specified in "
3190 "I<sig>, so that the receiver of the signal can also obtain the signal number "
3191 "via that field."
3192 msgstr ""
3193
3194 #. type: Plain text
3195 #: build/C/man2/rt_sigqueueinfo.2:129
3196 msgid ""
3197 "The B<rt_tgsigqueueinfo>()  system call is like B<rt_sigqueueinfo>(), but "
3198 "sends the signal and data to the single thread specified by the combination "
3199 "of I<tgid>, a thread group ID, and I<tid>, a thread in that thread group."
3200 msgstr ""
3201
3202 #. type: Plain text
3203 #: build/C/man2/rt_sigqueueinfo.2:134
3204 msgid ""
3205 "On success, these system calls return 0.  On error, they return -1 and "
3206 "I<errno> is set to indicate the error."
3207 msgstr ""
3208
3209 #. type: TP
3210 #: build/C/man2/rt_sigqueueinfo.2:135 build/C/man3/sigqueue.3:92 build/C/man2/sigwaitinfo.2:115 build/C/man2/timer_create.2:176
3211 #, no-wrap
3212 msgid "B<EAGAIN>"
3213 msgstr ""
3214
3215 #. type: Plain text
3216 #: build/C/man2/rt_sigqueueinfo.2:141 build/C/man3/sigqueue.3:98
3217 msgid ""
3218 "The limit of signals which may be queued has been reached.  (See "
3219 "B<signal>(7)  for further information.)"
3220 msgstr ""
3221
3222 #. type: Plain text
3223 #: build/C/man2/rt_sigqueueinfo.2:148
3224 msgid "I<sig>, I<tgid>, or I<tid> was invalid."
3225 msgstr ""
3226
3227 #. type: Plain text
3228 #: build/C/man2/rt_sigqueueinfo.2:156
3229 msgid ""
3230 "The caller does not have permission to send the signal to the target.  For "
3231 "the required permissions, see B<kill>(2).  Or: I<uinfo-E<gt>si_code> is "
3232 "invalid."
3233 msgstr ""
3234
3235 #. type: Plain text
3236 #: build/C/man2/rt_sigqueueinfo.2:162
3237 msgid "B<rt_sigqueueinfo>(): No thread group matching I<tgid> was found."
3238 msgstr ""
3239
3240 #. type: Plain text
3241 #: build/C/man2/rt_sigqueueinfo.2:169
3242 msgid "B<rt_tgsigqueinfo>(): No thread matching I<tgid> and I<tid> was found."
3243 msgstr ""
3244
3245 #. type: Plain text
3246 #: build/C/man2/rt_sigqueueinfo.2:176
3247 msgid ""
3248 "The B<rt_sigqueueinfo>()  system call was added to Linux in version 2.2.  "
3249 "The B<rt_tgsigqueueinfo>()  system call was added to Linux in version "
3250 "2.6.31."
3251 msgstr ""
3252
3253 #. type: Plain text
3254 #: build/C/man2/rt_sigqueueinfo.2:178 build/C/man2/sgetmask.2:68 build/C/man2/timerfd_create.2:373
3255 msgid "These system calls are Linux-specific."
3256 msgstr ""
3257
3258 #. type: Plain text
3259 #: build/C/man2/rt_sigqueueinfo.2:183
3260 msgid ""
3261 "Since these system calls are not intended for application use, there are no "
3262 "glibc wrapper functions; use B<syscall>(2)  in the unlikely case that you "
3263 "want to call them directly."
3264 msgstr ""
3265
3266 #. type: Plain text
3267 #: build/C/man2/rt_sigqueueinfo.2:188
3268 msgid ""
3269 "As with B<kill>(2), the null signal (0) can be used to check if the "
3270 "specified process or thread exists."
3271 msgstr ""
3272
3273 #. type: Plain text
3274 #: build/C/man2/rt_sigqueueinfo.2:196
3275 msgid ""
3276 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<tgkill>(2), "
3277 "B<pthread_sigqueue>(3), B<sigqueue>(3), B<signal>(7)"
3278 msgstr ""
3279
3280 #. type: TH
3281 #: build/C/man2/s390_runtime_instr.2:25
3282 #, no-wrap
3283 msgid "S390_RUNTIME_INSTR"
3284 msgstr ""
3285
3286 #. type: TH
3287 #: build/C/man2/s390_runtime_instr.2:25
3288 #, no-wrap
3289 msgid "2012-12-17"
3290 msgstr ""
3291
3292 #. type: Plain text
3293 #: build/C/man2/s390_runtime_instr.2:28
3294 msgid "s390_runtime_instr - enable/disable s390 CPU run-time instrumentation"
3295 msgstr ""
3296
3297 #. type: Plain text
3298 #: build/C/man2/s390_runtime_instr.2:31
3299 #, no-wrap
3300 msgid "B<#include E<lt>asm/runtime_instr.hE<gt>>\n"
3301 msgstr ""
3302
3303 #. type: Plain text
3304 #: build/C/man2/s390_runtime_instr.2:33
3305 #, no-wrap
3306 msgid "B<int s390_runtime_instr(int >I<command>B<, int >I<signum>B<);>\n"
3307 msgstr ""
3308
3309 #. type: Plain text
3310 #: build/C/man2/s390_runtime_instr.2:39
3311 msgid ""
3312 "The B<s390_runtime_instr>()  system call starts or stops CPU run-time "
3313 "instrumentation for the calling thread."
3314 msgstr ""
3315
3316 #. type: Plain text
3317 #: build/C/man2/s390_runtime_instr.2:47
3318 msgid ""
3319 "The I<command> argument controls whether run-time instrumentation is started "
3320 "(B<S390_RUNTIME_INSTR_START>, 1) or stopped (B<S390_RUNTIME_INSTR_STOP>, 2) "
3321 "for the calling thread."
3322 msgstr ""
3323
3324 #. type: Plain text
3325 #: build/C/man2/s390_runtime_instr.2:54
3326 msgid ""
3327 "The I<signum> argument specifies the number of a real-time signal.  The "
3328 "real-time signal is sent to the thread if the run-time instrumentation "
3329 "buffer is full or if the run-time-instrumentation-halted interrupt occurred."
3330 msgstr ""
3331
3332 #. type: Plain text
3333 #: build/C/man2/s390_runtime_instr.2:65
3334 msgid ""
3335 "On success, B<s390_runtime_instr>()  returns 0 and enables the thread for "
3336 "run-time instrumentation by assigning the thread a default run-time "
3337 "instrumentation control block.  The caller can then read and modify the "
3338 "control block and start the run-time instrumentation.  On error, -1 is "
3339 "returned and I<errno> is set to one of the error codes listed below."
3340 msgstr ""
3341
3342 #. type: Plain text
3343 #: build/C/man2/s390_runtime_instr.2:73
3344 msgid ""
3345 "The value specified in I<command> is not a valid command or the value "
3346 "specified in I<signum> is not a real-time signal number."
3347 msgstr ""
3348
3349 #. type: Plain text
3350 #: build/C/man2/s390_runtime_instr.2:76
3351 msgid "Allocating memory for the run-time instrumentation control block failed."
3352 msgstr ""
3353
3354 #. type: TP
3355 #: build/C/man2/s390_runtime_instr.2:76
3356 #, no-wrap
3357 msgid "B<EOPNOTSUPP>"
3358 msgstr ""
3359
3360 #. type: Plain text
3361 #: build/C/man2/s390_runtime_instr.2:79
3362 msgid "The run-time instrumentation facility is not available."
3363 msgstr ""
3364
3365 #. type: Plain text
3366 #: build/C/man2/s390_runtime_instr.2:81
3367 msgid "This system call is available since Linux 3.7."
3368 msgstr ""
3369
3370 #. type: Plain text
3371 #: build/C/man2/s390_runtime_instr.2:84
3372 msgid ""
3373 "This Linux-specific system call is available only on the s390 architecture.  "
3374 "The run-time instrumentation facility is available beginning with System z "
3375 "EC12."
3376 msgstr ""
3377
3378 #. type: Plain text
3379 #: build/C/man2/s390_runtime_instr.2:88
3380 msgid ""
3381 "Glibc does not provide a wrapper for this system call, use B<syscall>(2)  to "
3382 "call it."
3383 msgstr ""
3384
3385 #. type: Plain text
3386 #: build/C/man2/s390_runtime_instr.2:91
3387 msgid "B<syscall>(2), B<signal>(7)"
3388 msgstr ""
3389
3390 #. type: TH
3391 #: build/C/man2/sgetmask.2:26
3392 #, no-wrap
3393 msgid "SGETMASK"
3394 msgstr ""
3395
3396 #. type: Plain text
3397 #: build/C/man2/sgetmask.2:29
3398 msgid "sgetmask, ssetmask - manipulation of signal mask (obsolete)"
3399 msgstr ""
3400
3401 #. type: Plain text
3402 #: build/C/man2/sgetmask.2:31
3403 msgid "B<long sgetmask(void);>"
3404 msgstr ""
3405
3406 #. type: Plain text
3407 #: build/C/man2/sgetmask.2:33
3408 msgid "B<long ssetmask(long >I<newmask>B<);>"
3409 msgstr ""
3410
3411 #. type: Plain text
3412 #: build/C/man2/sgetmask.2:42
3413 msgid ""
3414 "These system calls are obsolete.  I<Do not use them>; use B<sigprocmask>(2)  "
3415 "instead."
3416 msgstr ""
3417
3418 #. type: Plain text
3419 #: build/C/man2/sgetmask.2:45
3420 msgid "B<sgetmask>()  returns the signal mask of the calling process."
3421 msgstr ""
3422
3423 #. type: Plain text
3424 #: build/C/man2/sgetmask.2:50
3425 msgid ""
3426 "B<ssetmask>()  sets the signal mask of the calling process to the value "
3427 "given in I<newmask>.  The previous signal mask is returned."
3428 msgstr ""
3429
3430 #. type: Plain text
3431 #: build/C/man2/sgetmask.2:59
3432 msgid ""
3433 "The signal masks dealt with by these two system calls are plain bit masks "
3434 "(unlike the I<sigset_t> used by B<sigprocmask>(2)); use B<sigmask>(3)  to "
3435 "create and inspect these masks."
3436 msgstr ""
3437
3438 #. type: Plain text
3439 #: build/C/man2/sgetmask.2:64
3440 msgid ""
3441 "B<sgetmask>()  always successfully returns the signal mask.  B<ssetmask>()  "
3442 "always succeeds, and returns the previous signal mask."
3443 msgstr ""
3444
3445 #. type: Plain text
3446 #: build/C/man2/sgetmask.2:66
3447 msgid "These system calls always succeed."
3448 msgstr ""
3449
3450 #. type: Plain text
3451 #: build/C/man2/sgetmask.2:72
3452 msgid ""
3453 "Glibc does not provide wrappers for these obsolete system calls; in the "
3454 "unlikely event that you want to call them, use B<syscall>(2)."
3455 msgstr ""
3456
3457 #. type: Plain text
3458 #: build/C/man2/sgetmask.2:75
3459 msgid ""
3460 "These system calls are unaware of signal numbers greater than 31 (i.e., "
3461 "real-time signals)."
3462 msgstr ""
3463
3464 #. type: Plain text
3465 #: build/C/man2/sgetmask.2:80
3466 msgid "It is not possible to block B<SIGSTOP> or B<SIGKILL>."
3467 msgstr ""
3468
3469 #. type: Plain text
3470 #: build/C/man2/sgetmask.2:83
3471 msgid "B<sigprocmask>(2), B<signal>(7)"
3472 msgstr ""
3473
3474 #. type: TH
3475 #: build/C/man2/sigaction.2:47
3476 #, no-wrap
3477 msgid "SIGACTION"
3478 msgstr ""
3479
3480 #. type: Plain text
3481 #: build/C/man2/sigaction.2:50
3482 msgid "sigaction - examine and change a signal action"
3483 msgstr ""
3484
3485 #. type: Plain text
3486 #: build/C/man2/sigaction.2:56
3487 #, no-wrap
3488 msgid ""
3489 "B<int sigaction(int >I<signum>B<, const struct sigaction *>I<act>B<,>\n"
3490 "B<              struct sigaction *>I<oldact>B<);>\n"
3491 msgstr ""
3492
3493 #. type: Plain text
3494 #: build/C/man2/sigaction.2:66
3495 msgid ""
3496 "B<sigaction>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
3497 "_POSIX_SOURCE"
3498 msgstr ""
3499
3500 #. type: Plain text
3501 #: build/C/man2/sigaction.2:69
3502 msgid "I<siginfo_t>: _POSIX_C_SOURCE E<gt>= 199309L"
3503 msgstr ""
3504
3505 #. type: Plain text
3506 #: build/C/man2/sigaction.2:78
3507 msgid ""
3508 "The B<sigaction>()  system call is used to change the action taken by a "
3509 "process on receipt of a specific signal.  (See B<signal>(7)  for an overview "
3510 "of signals.)"
3511 msgstr ""
3512
3513 #. type: Plain text
3514 #: build/C/man2/sigaction.2:84
3515 msgid ""
3516 "I<signum> specifies the signal and can be any valid signal except B<SIGKILL> "
3517 "and B<SIGSTOP>."
3518 msgstr ""
3519
3520 #. type: Plain text
3521 #: build/C/man2/sigaction.2:95
3522 msgid ""
3523 "If I<act> is non-NULL, the new action for signal I<signum> is installed from "
3524 "I<act>.  If I<oldact> is non-NULL, the previous action is saved in "
3525 "I<oldact>."
3526 msgstr ""
3527
3528 #. type: Plain text
3529 #: build/C/man2/sigaction.2:99
3530 msgid "The I<sigaction> structure is defined as something like:"
3531 msgstr ""
3532
3533 #. type: Plain text
3534 #: build/C/man2/sigaction.2:109
3535 #, no-wrap
3536 msgid ""
3537 "struct sigaction {\n"
3538 "    void     (*sa_handler)(int);\n"
3539 "    void     (*sa_sigaction)(int, siginfo_t *, void *);\n"
3540 "    sigset_t   sa_mask;\n"
3541 "    int        sa_flags;\n"
3542 "    void     (*sa_restorer)(void);\n"
3543 "};\n"
3544 msgstr ""
3545
3546 #. type: Plain text
3547 #: build/C/man2/sigaction.2:116
3548 msgid ""
3549 "On some architectures a union is involved: do not assign to both "
3550 "I<sa_handler> and I<sa_sigaction>."
3551 msgstr ""
3552
3553 #. type: Plain text
3554 #: build/C/man2/sigaction.2:123
3555 msgid ""
3556 "The I<sa_restorer> element is obsolete and should not be used.  POSIX does "
3557 "not specify a I<sa_restorer> element."
3558 msgstr ""
3559
3560 #. type: Plain text
3561 #: build/C/man2/sigaction.2:133
3562 msgid ""
3563 "I<sa_handler> specifies the action to be associated with I<signum> and may "
3564 "be B<SIG_DFL> for the default action, B<SIG_IGN> to ignore this signal, or a "
3565 "pointer to a signal handling function.  This function receives the signal "
3566 "number as its only argument."
3567 msgstr ""
3568
3569 #. type: Plain text
3570 #: build/C/man2/sigaction.2:155
3571 msgid ""
3572 "If B<SA_SIGINFO> is specified in I<sa_flags>, then I<sa_sigaction> (instead "
3573 "of I<sa_handler>)  specifies the signal-handling function for I<signum>.  "
3574 "This function receives the signal number as its first argument, a pointer to "
3575 "a I<siginfo_t> as its second argument and a pointer to a I<ucontext_t> (cast "
3576 "to I<void\\ *>) as its third argument.  (Commonly, the handler function "
3577 "doesn't make any use of the third argument.  See B<getcontext>(3)  for "
3578 "further information about I<ucontext_t>.)"
3579 msgstr ""
3580
3581 #. type: Plain text
3582 #: build/C/man2/sigaction.2:165
3583 msgid ""
3584 "I<sa_mask> specifies a mask of signals which should be blocked (i.e., added "
3585 "to the signal mask of the thread in which the signal handler is invoked)  "
3586 "during execution of the signal handler.  In addition, the signal which "
3587 "triggered the handler will be blocked, unless the B<SA_NODEFER> flag is "
3588 "used."
3589 msgstr ""
3590
3591 #. type: Plain text
3592 #: build/C/man2/sigaction.2:169
3593 msgid ""
3594 "I<sa_flags> specifies a set of flags which modify the behavior of the "
3595 "signal.  It is formed by the bitwise OR of zero or more of the following:"
3596 msgstr ""
3597
3598 #. type: TP
3599 #: build/C/man2/sigaction.2:170
3600 #, no-wrap
3601 msgid "B<SA_NOCLDSTOP>"
3602 msgstr ""
3603
3604 #. type: Plain text
3605 #: build/C/man2/sigaction.2:187
3606 msgid ""
3607 "If I<signum> is B<SIGCHLD>, do not receive notification when child processes "
3608 "stop (i.e., when they receive one of B<SIGSTOP>, B<SIGTSTP>, B<SIGTTIN> or "
3609 "B<SIGTTOU>)  or resume (i.e., they receive B<SIGCONT>)  (see B<wait>(2)).  "
3610 "This flag is meaningful only when establishing a handler for B<SIGCHLD>."
3611 msgstr ""
3612
3613 #. type: TP
3614 #: build/C/man2/sigaction.2:187
3615 #, no-wrap
3616 msgid "B<SA_NOCLDWAIT> (since Linux 2.6)"
3617 msgstr ""
3618
3619 #.  To be precise: Linux 2.5.60 -- MTK
3620 #. type: Plain text
3621 #: build/C/man2/sigaction.2:201
3622 msgid ""
3623 "If I<signum> is B<SIGCHLD>, do not transform children into zombies when they "
3624 "terminate.  See also B<waitpid>(2).  This flag is meaningful only when "
3625 "establishing a handler for B<SIGCHLD>, or when setting that signal's "
3626 "disposition to B<SIG_DFL>."
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man2/sigaction.2:213
3631 msgid ""
3632 "If the B<SA_NOCLDWAIT> flag is set when establishing a handler for "
3633 "B<SIGCHLD>, POSIX.1 leaves it unspecified whether a B<SIGCHLD> signal is "
3634 "generated when a child process terminates.  On Linux, a B<SIGCHLD> signal is "
3635 "generated in this case; on some other implementations, it is not."
3636 msgstr ""
3637
3638 #. type: TP
3639 #: build/C/man2/sigaction.2:213
3640 #, no-wrap
3641 msgid "B<SA_NODEFER>"
3642 msgstr ""
3643
3644 #. type: Plain text
3645 #: build/C/man2/sigaction.2:220
3646 msgid ""
3647 "Do not prevent the signal from being received from within its own signal "
3648 "handler.  This flag is meaningful only when establishing a signal handler.  "
3649 "B<SA_NOMASK> is an obsolete, nonstandard synonym for this flag."
3650 msgstr ""
3651
3652 #. type: TP
3653 #: build/C/man2/sigaction.2:220
3654 #, no-wrap
3655 msgid "B<SA_ONSTACK>"
3656 msgstr ""
3657
3658 #. type: Plain text
3659 #: build/C/man2/sigaction.2:226
3660 msgid ""
3661 "Call the signal handler on an alternate signal stack provided by "
3662 "B<sigaltstack>(2).  If an alternate stack is not available, the default "
3663 "stack will be used.  This flag is meaningful only when establishing a signal "
3664 "handler."
3665 msgstr ""
3666
3667 #. type: TP
3668 #: build/C/man2/sigaction.2:226
3669 #, no-wrap
3670 msgid "B<SA_RESETHAND>"
3671 msgstr ""
3672
3673 #. type: Plain text
3674 #: build/C/man2/sigaction.2:232
3675 msgid ""
3676 "Restore the signal action to the default upon entry to the signal handler.  "
3677 "This flag is meaningful only when establishing a signal handler.  "
3678 "B<SA_ONESHOT> is an obsolete, nonstandard synonym for this flag."
3679 msgstr ""
3680
3681 #. type: TP
3682 #: build/C/man2/sigaction.2:232
3683 #, no-wrap
3684 msgid "B<SA_RESTART>"
3685 msgstr ""
3686
3687 #. type: Plain text
3688 #: build/C/man2/sigaction.2:240
3689 msgid ""
3690 "Provide behavior compatible with BSD signal semantics by making certain "
3691 "system calls restartable across signals.  This flag is meaningful only when "
3692 "establishing a signal handler.  See B<signal>(7)  for a discussion of system "
3693 "call restarting."
3694 msgstr ""
3695
3696 #. type: TP
3697 #: build/C/man2/sigaction.2:240
3698 #, no-wrap
3699 msgid "B<SA_SIGINFO> (since Linux 2.2)"
3700 msgstr ""
3701
3702 #.  (The
3703 #.  .I sa_sigaction
3704 #.  field was added in Linux 2.1.86.)
3705 #. type: Plain text
3706 #: build/C/man2/sigaction.2:251
3707 msgid ""
3708 "The signal handler takes three arguments, not one.  In this case, "
3709 "I<sa_sigaction> should be set instead of I<sa_handler>.  This flag is "
3710 "meaningful only when establishing a signal handler."
3711 msgstr ""
3712
3713 #. type: Plain text
3714 #: build/C/man2/sigaction.2:258
3715 msgid ""
3716 "The I<siginfo_t> argument to I<sa_sigaction> is a struct with the following "
3717 "elements:"
3718 msgstr ""
3719
3720 #.  FIXME
3721 #.  si_trapno seems to be only used on SPARC and Alpha;
3722 #.  this page could use a little more detail on its purpose there.
3723 #.  In the kernel: si_tid
3724 #. type: Plain text
3725 #: build/C/man2/sigaction.2:289
3726 #, no-wrap
3727 msgid ""
3728 "siginfo_t {\n"
3729 "    int      si_signo;    /* Signal number */\n"
3730 "    int      si_errno;    /* An errno value */\n"
3731 "    int      si_code;     /* Signal code */\n"
3732 "    int      si_trapno;   /* Trap number that caused\n"
3733 "                             hardware-generated signal\n"
3734 "                             (unused on most architectures) */\n"
3735 "    pid_t    si_pid;      /* Sending process ID */\n"
3736 "    uid_t    si_uid;      /* Real user ID of sending process */\n"
3737 "    int      si_status;   /* Exit value or signal */\n"
3738 "    clock_t  si_utime;    /* User time consumed */\n"
3739 "    clock_t  si_stime;    /* System time consumed */\n"
3740 "    sigval_t si_value;    /* Signal value */\n"
3741 "    int      si_int;      /* POSIX.1b signal */\n"
3742 "    void    *si_ptr;      /* POSIX.1b signal */\n"
3743 "    int      si_overrun;  /* Timer overrun count; POSIX.1b timers */\n"
3744 "    int      si_timerid;  /* Timer ID; POSIX.1b timers */\n"
3745 "    void    *si_addr;     /* Memory location which caused fault */\n"
3746 "    long     si_band;     /* Band event (was I<int> in\n"
3747 "                             glibc 2.3.2 and earlier) */\n"
3748 "    int      si_fd;       /* File descriptor */\n"
3749 "    short    si_addr_lsb; /* Least significant bit of address\n"
3750 "                             (since Linux 2.6.32) */\n"
3751 "}\n"
3752 msgstr ""
3753
3754 #. type: Plain text
3755 #: build/C/man2/sigaction.2:298
3756 msgid ""
3757 "I<si_signo>, I<si_errno> and I<si_code> are defined for all signals.  "
3758 "(I<si_errno> is generally unused on Linux.)  The rest of the struct may be a "
3759 "union, so that one should read only the fields that are meaningful for the "
3760 "given signal:"
3761 msgstr ""
3762
3763 #. type: Plain text
3764 #: build/C/man2/sigaction.2:313
3765 msgid ""
3766 "Signals sent with B<kill>(2)  and B<sigqueue>(3)  fill in I<si_pid> and "
3767 "I<si_uid>.  In addition, signals sent with B<sigqueue>(3)  fill in I<si_int> "
3768 "and I<si_ptr> with the values specified by the sender of the signal; see "
3769 "B<sigqueue>(3)  for more details."
3770 msgstr ""
3771
3772 #. type: Plain text
3773 #: build/C/man2/sigaction.2:329
3774 msgid ""
3775 "Signals sent by POSIX.1b timers (since Linux 2.6) fill in I<si_overrun> and "
3776 "I<si_timerid>.  The I<si_timerid> field is an internal ID used by the kernel "
3777 "to identify the timer; it is not the same as the timer ID returned by "
3778 "B<timer_create>(2).  The I<si_overrun> field is the timer overrun count; "
3779 "this is the same information as is obtained by a call to "
3780 "B<timer_getoverrun>(2).  These fields are nonstandard Linux extensions."
3781 msgstr ""
3782
3783 #. type: Plain text
3784 #: build/C/man2/sigaction.2:344
3785 msgid ""
3786 "Signals sent for message queue notification (see the description of "
3787 "B<SIGEV_SIGNAL> in B<mq_notify>(3))  fill in I<si_int>/I<si_ptr>, with the "
3788 "I<sigev_value> supplied to B<mq_notify>(3); I<si_pid>, with the process ID "
3789 "of the message sender; and I<si_uid>, with the real user ID of the message "
3790 "sender."
3791 msgstr ""
3792
3793 #.  FIXME .
3794 #.  When si_utime and si_stime where originally implemented, the
3795 #.  measurement unit was HZ, which was the same as clock ticks
3796 #.  (sysconf(_SC_CLK_TCK)).  In 2.6, HZ became configurable, and
3797 #.  was *still* used as the unit to return the info these fields,
3798 #.  with the result that the field values depended on the the
3799 #.  configured HZ.  Of course, the should have been measured in
3800 #.  USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to
3801 #.  convert to seconds.  I have a queued patch to fix this:
3802 #.  http://thread.gmane.org/gmane.linux.kernel/698061/ .
3803 #.  This patch made it into 2.6.27.
3804 #.  But note that these fields still don't return the times of
3805 #.  waited-for children (as is done by getrusage() and times()
3806 #.  and wait4()).  Solaris 8 does include child times.
3807 #. type: Plain text
3808 #: build/C/man2/sigaction.2:391
3809 msgid ""
3810 "B<SIGCHLD> fills in I<si_pid>, I<si_uid>, I<si_status>, I<si_utime> and "
3811 "I<si_stime>, providing information about the child.  The I<si_pid> field is "
3812 "the process ID of the child; I<si_uid> is the child's real user ID.  The "
3813 "I<si_status> field contains the exit status of the child (if I<si_code> is "
3814 "B<CLD_EXITED>), or the signal number that caused the process to change "
3815 "state.  The I<si_utime> and I<si_stime> contain the user and system CPU time "
3816 "used by the child process; these fields do not include the times used by "
3817 "waited-for children (unlike B<getrusage>(2)  and B<time>(2)).  In kernels up "
3818 "to 2.6, and since 2.6.27, these fields report CPU time in units of "
3819 "I<sysconf(_SC_CLK_TCK)>.  In 2.6 kernels before 2.6.27, a bug meant that "
3820 "these fields reported time in units of the (configurable) system jiffy (see "
3821 "B<time>(7))."
3822 msgstr ""
3823
3824 #.  FIXME SIGTRAP also sets the following for ptrace_notify() ?
3825 #.      info.si_code = exit_code;
3826 #.      info.si_pid = task_pid_vnr(current);
3827 #.      info.si_uid = current_uid();  /* Real UID */
3828 #. type: Plain text
3829 #: build/C/man2/sigaction.2:427
3830 msgid ""
3831 "B<SIGILL>, B<SIGFPE>, B<SIGSEGV>, B<SIGBUS>, and B<SIGTRAP> fill in "
3832 "I<si_addr> with the address of the fault.  On some architectures, these "
3833 "signals also fill in the I<si_trapno> field.  Some suberrors of B<SIGBUS>, "
3834 "in particular B<BUS_MCEERR_AO> and B<BUS_MCEERR_AR>, also fill in "
3835 "I<si_addr_lsb>.  This field indicates the least significant bit of the "
3836 "reported address and therefore the extent of the corruption.  For example, "
3837 "if a full page was corrupted, I<si_addr_lsb> contains "
3838 "I<log2(sysconf(_SC_PAGESIZE))>.  B<BUS_MCERR_*> and I<si_addr_lsb> are "
3839 "Linux-specific extensions."
3840 msgstr ""
3841
3842 #. type: Plain text
3843 #: build/C/man2/sigaction.2:441
3844 msgid ""
3845 "B<SIGIO>/B<SIGPOLL> (the two names are synonyms on Linux)  fills in "
3846 "I<si_band> and I<si_fd>.  The I<si_band> event is a bit mask containing the "
3847 "same values as are filled in the I<revents> field by B<poll>(2).  The "
3848 "I<si_fd> field indicates the file descriptor for which the I/O event "
3849 "occurred."
3850 msgstr ""
3851
3852 #. type: Plain text
3853 #: build/C/man2/sigaction.2:448
3854 msgid ""
3855 "I<si_code> is a value (not a bit mask)  indicating why this signal was "
3856 "sent.  The following list shows the values which can be placed in I<si_code> "
3857 "for any signal, along with reason that the signal was generated."
3858 msgstr ""
3859
3860 #. type: TP
3861 #: build/C/man2/sigaction.2:449
3862 #, no-wrap
3863 msgid "B<SI_USER>"
3864 msgstr ""
3865
3866 #. type: TP
3867 #: build/C/man2/sigaction.2:452 build/C/man7/signal.7:111
3868 #, no-wrap
3869 msgid "B<kill>(2)"
3870 msgstr ""
3871
3872 #. type: TP
3873 #: build/C/man2/sigaction.2:452
3874 #, no-wrap
3875 msgid "B<SI_KERNEL>"
3876 msgstr ""
3877
3878 #. type: Plain text
3879 #: build/C/man2/sigaction.2:455
3880 msgid "Sent by the kernel."
3881 msgstr ""
3882
3883 #. type: TP
3884 #: build/C/man2/sigaction.2:455
3885 #, no-wrap
3886 msgid "B<SI_QUEUE>"
3887 msgstr ""
3888
3889 #. type: TP
3890 #: build/C/man2/sigaction.2:458 build/C/man7/signal.7:128
3891 #, no-wrap
3892 msgid "B<sigqueue>(3)"
3893 msgstr ""
3894
3895 #. type: TP
3896 #: build/C/man2/sigaction.2:458
3897 #, no-wrap
3898 msgid "B<SI_TIMER>"
3899 msgstr ""
3900
3901 #. type: Plain text
3902 #: build/C/man2/sigaction.2:461
3903 msgid "POSIX timer expired"
3904 msgstr ""
3905
3906 #. type: TP
3907 #: build/C/man2/sigaction.2:461
3908 #, no-wrap
3909 msgid "B<SI_MESGQ>"
3910 msgstr ""
3911
3912 #. type: Plain text
3913 #: build/C/man2/sigaction.2:465
3914 msgid "POSIX message queue state changed (since Linux 2.6.6); see B<mq_notify>(3)"
3915 msgstr ""
3916
3917 #. type: TP
3918 #: build/C/man2/sigaction.2:465
3919 #, no-wrap
3920 msgid "B<SI_ASYNCIO>"
3921 msgstr ""
3922
3923 #. type: Plain text
3924 #: build/C/man2/sigaction.2:468
3925 msgid "AIO completed"
3926 msgstr ""
3927
3928 #. type: TP
3929 #: build/C/man2/sigaction.2:468
3930 #, no-wrap
3931 msgid "B<SI_SIGIO>"
3932 msgstr ""
3933
3934 #. type: Plain text
3935 #: build/C/man2/sigaction.2:477
3936 msgid ""
3937 "Queued B<SIGIO> (only in kernels up to Linux 2.2; from Linux 2.4 onward "
3938 "B<SIGIO>/B<SIGPOLL> fills in I<si_code> as described below)."
3939 msgstr ""
3940
3941 #. type: TP
3942 #: build/C/man2/sigaction.2:477
3943 #, no-wrap
3944 msgid "B<SI_TKILL>"
3945 msgstr ""
3946
3947 #.  SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented
3948 #.  It appears to have been an idea that was tried during 2.5.6
3949 #.  through to 2.5.24 and then was backed out.
3950 #. type: Plain text
3951 #: build/C/man2/sigaction.2:486
3952 msgid "B<tkill>(2)  or B<tgkill>(2)  (since Linux 2.4.19)"
3953 msgstr ""
3954
3955 #. type: Plain text
3956 #: build/C/man2/sigaction.2:493
3957 msgid "The following values can be placed in I<si_code> for a B<SIGILL> signal:"
3958 msgstr ""
3959
3960 #. type: TP
3961 #: build/C/man2/sigaction.2:494
3962 #, no-wrap
3963 msgid "B<ILL_ILLOPC>"
3964 msgstr ""
3965
3966 #. type: Plain text
3967 #: build/C/man2/sigaction.2:497
3968 msgid "illegal opcode"
3969 msgstr ""
3970
3971 #. type: TP
3972 #: build/C/man2/sigaction.2:497
3973 #, no-wrap
3974 msgid "B<ILL_ILLOPN>"
3975 msgstr ""
3976
3977 #. type: Plain text
3978 #: build/C/man2/sigaction.2:500
3979 msgid "illegal operand"
3980 msgstr ""
3981
3982 #. type: TP
3983 #: build/C/man2/sigaction.2:500
3984 #, no-wrap
3985 msgid "B<ILL_ILLADR>"
3986 msgstr ""
3987
3988 #. type: Plain text
3989 #: build/C/man2/sigaction.2:503
3990 msgid "illegal addressing mode"
3991 msgstr ""
3992
3993 #. type: TP
3994 #: build/C/man2/sigaction.2:503
3995 #, no-wrap
3996 msgid "B<ILL_ILLTRP>"
3997 msgstr ""
3998
3999 #. type: Plain text
4000 #: build/C/man2/sigaction.2:506
4001 msgid "illegal trap"
4002 msgstr ""
4003
4004 #. type: TP
4005 #: build/C/man2/sigaction.2:506
4006 #, no-wrap
4007 msgid "B<ILL_PRVOPC>"
4008 msgstr ""
4009
4010 #. type: Plain text
4011 #: build/C/man2/sigaction.2:509
4012 msgid "privileged opcode"
4013 msgstr ""
4014
4015 #. type: TP
4016 #: build/C/man2/sigaction.2:509
4017 #, no-wrap
4018 msgid "B<ILL_PRVREG>"
4019 msgstr ""
4020
4021 #. type: Plain text
4022 #: build/C/man2/sigaction.2:512
4023 msgid "privileged register"
4024 msgstr ""
4025
4026 #. type: TP
4027 #: build/C/man2/sigaction.2:512
4028 #, no-wrap
4029 msgid "B<ILL_COPROC>"
4030 msgstr ""
4031
4032 #. type: Plain text
4033 #: build/C/man2/sigaction.2:515
4034 msgid "coprocessor error"
4035 msgstr ""
4036
4037 #. type: TP
4038 #: build/C/man2/sigaction.2:515
4039 #, no-wrap
4040 msgid "B<ILL_BADSTK>"
4041 msgstr ""
4042
4043 #. type: Plain text
4044 #: build/C/man2/sigaction.2:518
4045 msgid "internal stack error"
4046 msgstr ""
4047
4048 #. type: Plain text
4049 #: build/C/man2/sigaction.2:525
4050 msgid "The following values can be placed in I<si_code> for a B<SIGFPE> signal:"
4051 msgstr ""
4052
4053 #. type: TP
4054 #: build/C/man2/sigaction.2:526
4055 #, no-wrap
4056 msgid "B<FPE_INTDIV>"
4057 msgstr ""
4058
4059 #. type: Plain text
4060 #: build/C/man2/sigaction.2:529
4061 msgid "integer divide by zero"
4062 msgstr ""
4063
4064 #. type: TP
4065 #: build/C/man2/sigaction.2:529
4066 #, no-wrap
4067 msgid "B<FPE_INTOVF>"
4068 msgstr ""
4069
4070 #. type: Plain text
4071 #: build/C/man2/sigaction.2:532
4072 msgid "integer overflow"
4073 msgstr ""
4074
4075 #. type: TP
4076 #: build/C/man2/sigaction.2:532
4077 #, no-wrap
4078 msgid "B<FPE_FLTDIV>"
4079 msgstr ""
4080
4081 #. type: Plain text
4082 #: build/C/man2/sigaction.2:535
4083 msgid "floating-point divide by zero"
4084 msgstr ""
4085
4086 #. type: TP
4087 #: build/C/man2/sigaction.2:535
4088 #, no-wrap
4089 msgid "B<FPE_FLTOVF>"
4090 msgstr ""
4091
4092 #. type: Plain text
4093 #: build/C/man2/sigaction.2:538
4094 msgid "floating-point overflow"
4095 msgstr ""
4096
4097 #. type: TP
4098 #: build/C/man2/sigaction.2:538
4099 #, no-wrap
4100 msgid "B<FPE_FLTUND>"
4101 msgstr ""
4102
4103 #. type: Plain text
4104 #: build/C/man2/sigaction.2:541
4105 msgid "floating-point underflow"
4106 msgstr ""
4107
4108 #. type: TP
4109 #: build/C/man2/sigaction.2:541
4110 #, no-wrap
4111 msgid "B<FPE_FLTRES>"
4112 msgstr ""
4113
4114 #. type: Plain text
4115 #: build/C/man2/sigaction.2:544
4116 msgid "floating-point inexact result"
4117 msgstr ""
4118
4119 #. type: TP
4120 #: build/C/man2/sigaction.2:544
4121 #, no-wrap
4122 msgid "B<FPE_FLTINV>"
4123 msgstr ""
4124
4125 #. type: Plain text
4126 #: build/C/man2/sigaction.2:547
4127 msgid "floating-point invalid operation"
4128 msgstr ""
4129
4130 #. type: TP
4131 #: build/C/man2/sigaction.2:547
4132 #, no-wrap
4133 msgid "B<FPE_FLTSUB>"
4134 msgstr ""
4135
4136 #. type: Plain text
4137 #: build/C/man2/sigaction.2:550
4138 msgid "subscript out of range"
4139 msgstr ""
4140
4141 #. type: Plain text
4142 #: build/C/man2/sigaction.2:557
4143 msgid "The following values can be placed in I<si_code> for a B<SIGSEGV> signal:"
4144 msgstr ""
4145
4146 #. type: TP
4147 #: build/C/man2/sigaction.2:558
4148 #, no-wrap
4149 msgid "B<SEGV_MAPERR>"
4150 msgstr ""
4151
4152 #. type: Plain text
4153 #: build/C/man2/sigaction.2:561
4154 msgid "address not mapped to object"
4155 msgstr ""
4156
4157 #. type: TP
4158 #: build/C/man2/sigaction.2:561
4159 #, no-wrap
4160 msgid "B<SEGV_ACCERR>"
4161 msgstr ""
4162
4163 #. type: Plain text
4164 #: build/C/man2/sigaction.2:564
4165 msgid "invalid permissions for mapped object"
4166 msgstr ""
4167
4168 #. type: Plain text
4169 #: build/C/man2/sigaction.2:571
4170 msgid "The following values can be placed in I<si_code> for a B<SIGBUS> signal:"
4171 msgstr ""
4172
4173 #. type: TP
4174 #: build/C/man2/sigaction.2:572
4175 #, no-wrap
4176 msgid "B<BUS_ADRALN>"
4177 msgstr ""
4178
4179 #. type: Plain text
4180 #: build/C/man2/sigaction.2:575
4181 msgid "invalid address alignment"
4182 msgstr ""
4183
4184 #. type: TP
4185 #: build/C/man2/sigaction.2:575
4186 #, no-wrap
4187 msgid "B<BUS_ADRERR>"
4188 msgstr ""
4189
4190 #. type: Plain text
4191 #: build/C/man2/sigaction.2:578
4192 msgid "nonexistent physical address"
4193 msgstr ""
4194
4195 #. type: TP
4196 #: build/C/man2/sigaction.2:578
4197 #, no-wrap
4198 msgid "B<BUS_OBJERR>"
4199 msgstr ""
4200
4201 #. type: Plain text
4202 #: build/C/man2/sigaction.2:581
4203 msgid "object-specific hardware error"
4204 msgstr ""
4205
4206 #. type: TP
4207 #: build/C/man2/sigaction.2:581
4208 #, no-wrap
4209 msgid "B<BUS_MCEERR_AR> (since Linux 2.6.32)"
4210 msgstr ""
4211
4212 #. type: Plain text
4213 #: build/C/man2/sigaction.2:584
4214 msgid "Hardware memory error consumed on a machine check; action required."
4215 msgstr ""
4216
4217 #. type: TP
4218 #: build/C/man2/sigaction.2:584
4219 #, no-wrap
4220 msgid "B<BUS_MCEERR_AO> (since Linux 2.6.32)"
4221 msgstr ""
4222
4223 #. type: Plain text
4224 #: build/C/man2/sigaction.2:587
4225 msgid "Hardware memory error detected in process but not consumed; action optional."
4226 msgstr ""
4227
4228 #. type: Plain text
4229 #: build/C/man2/sigaction.2:594
4230 msgid "The following values can be placed in I<si_code> for a B<SIGTRAP> signal:"
4231 msgstr ""
4232
4233 #. type: TP
4234 #: build/C/man2/sigaction.2:595
4235 #, no-wrap
4236 msgid "B<TRAP_BRKPT>"
4237 msgstr ""
4238
4239 #. type: Plain text
4240 #: build/C/man2/sigaction.2:598
4241 msgid "process breakpoint"
4242 msgstr ""
4243
4244 #. type: TP
4245 #: build/C/man2/sigaction.2:598
4246 #, no-wrap
4247 msgid "B<TRAP_TRACE>"
4248 msgstr ""
4249
4250 #. type: Plain text
4251 #: build/C/man2/sigaction.2:601
4252 msgid "process trace trap"
4253 msgstr ""
4254
4255 #. type: TP
4256 #: build/C/man2/sigaction.2:601
4257 #, no-wrap
4258 msgid "B<TRAP_BRANCH> (since Linux 2.4)"
4259 msgstr ""
4260
4261 #. type: Plain text
4262 #: build/C/man2/sigaction.2:604
4263 msgid "process taken branch trap"
4264 msgstr ""
4265
4266 #. type: TP
4267 #: build/C/man2/sigaction.2:604
4268 #, no-wrap
4269 msgid "B<TRAP_HWBKPT> (since Linux 2.4)"
4270 msgstr ""
4271
4272 #. type: Plain text
4273 #: build/C/man2/sigaction.2:607
4274 msgid "hardware breakpoint/watchpoint"
4275 msgstr ""
4276
4277 #. type: Plain text
4278 #: build/C/man2/sigaction.2:614
4279 msgid "The following values can be placed in I<si_code> for a B<SIGCHLD> signal:"
4280 msgstr ""
4281
4282 #. type: TP
4283 #: build/C/man2/sigaction.2:615
4284 #, no-wrap
4285 msgid "B<CLD_EXITED>"
4286 msgstr ""
4287
4288 #. type: Plain text
4289 #: build/C/man2/sigaction.2:618
4290 msgid "child has exited"
4291 msgstr ""
4292
4293 #. type: TP
4294 #: build/C/man2/sigaction.2:618
4295 #, no-wrap
4296 msgid "B<CLD_KILLED>"
4297 msgstr ""
4298
4299 #. type: Plain text
4300 #: build/C/man2/sigaction.2:621
4301 msgid "child was killed"
4302 msgstr ""
4303
4304 #. type: TP
4305 #: build/C/man2/sigaction.2:621
4306 #, no-wrap
4307 msgid "B<CLD_DUMPED>"
4308 msgstr ""
4309
4310 #. type: Plain text
4311 #: build/C/man2/sigaction.2:624
4312 msgid "child terminated abnormally"
4313 msgstr ""
4314
4315 #. type: TP
4316 #: build/C/man2/sigaction.2:624
4317 #, no-wrap
4318 msgid "B<CLD_TRAPPED>"
4319 msgstr ""
4320
4321 #. type: Plain text
4322 #: build/C/man2/sigaction.2:627
4323 msgid "traced child has trapped"
4324 msgstr ""
4325
4326 #. type: TP
4327 #: build/C/man2/sigaction.2:627
4328 #, no-wrap
4329 msgid "B<CLD_STOPPED>"
4330 msgstr ""
4331
4332 #. type: Plain text
4333 #: build/C/man2/sigaction.2:630
4334 msgid "child has stopped"
4335 msgstr ""
4336
4337 #. type: TP
4338 #: build/C/man2/sigaction.2:630
4339 #, no-wrap
4340 msgid "B<CLD_CONTINUED>"
4341 msgstr ""
4342
4343 #. type: Plain text
4344 #: build/C/man2/sigaction.2:633
4345 msgid "stopped child has continued (since Linux 2.6.9)"
4346 msgstr ""
4347
4348 #. type: Plain text
4349 #: build/C/man2/sigaction.2:640
4350 msgid ""
4351 "The following values can be placed in I<si_code> for a B<SIGIO>/B<SIGPOLL> "
4352 "signal:"
4353 msgstr ""
4354
4355 #. type: TP
4356 #: build/C/man2/sigaction.2:641
4357 #, no-wrap
4358 msgid "B<POLL_IN>"
4359 msgstr ""
4360
4361 #. type: Plain text
4362 #: build/C/man2/sigaction.2:644
4363 msgid "data input available"
4364 msgstr ""
4365
4366 #. type: TP
4367 #: build/C/man2/sigaction.2:644
4368 #, no-wrap
4369 msgid "B<POLL_OUT>"
4370 msgstr ""
4371
4372 #. type: Plain text
4373 #: build/C/man2/sigaction.2:647
4374 msgid "output buffers available"
4375 msgstr ""
4376
4377 #. type: TP
4378 #: build/C/man2/sigaction.2:647
4379 #, no-wrap
4380 msgid "B<POLL_MSG>"
4381 msgstr ""
4382
4383 #. type: Plain text
4384 #: build/C/man2/sigaction.2:650
4385 msgid "input message available"
4386 msgstr ""
4387
4388 #. type: TP
4389 #: build/C/man2/sigaction.2:650
4390 #, no-wrap
4391 msgid "B<POLL_ERR>"
4392 msgstr ""
4393
4394 #. type: Plain text
4395 #: build/C/man2/sigaction.2:653
4396 msgid "I/O error"
4397 msgstr ""
4398
4399 #. type: TP
4400 #: build/C/man2/sigaction.2:653
4401 #, no-wrap
4402 msgid "B<POLL_PRI>"
4403 msgstr ""
4404
4405 #. type: Plain text
4406 #: build/C/man2/sigaction.2:656
4407 msgid "high priority input available"
4408 msgstr ""
4409
4410 #. type: TP
4411 #: build/C/man2/sigaction.2:656
4412 #, no-wrap
4413 msgid "B<POLL_HUP>"
4414 msgstr ""
4415
4416 #. type: Plain text
4417 #: build/C/man2/sigaction.2:659
4418 msgid "device disconnected"
4419 msgstr ""
4420
4421 #. type: Plain text
4422 #: build/C/man2/sigaction.2:665
4423 msgid ""
4424 "B<sigaction>()  returns 0 on success; on error, -1 is returned, and I<errno> "
4425 "is set to indicate the error."
4426 msgstr ""
4427
4428 #. type: Plain text
4429 #: build/C/man2/sigaction.2:670
4430 msgid ""
4431 "I<act> or I<oldact> points to memory which is not a valid part of the "
4432 "process address space."
4433 msgstr ""
4434
4435 #. type: Plain text
4436 #: build/C/man2/sigaction.2:677
4437 msgid ""
4438 "An invalid signal was specified.  This will also be generated if an attempt "
4439 "is made to change the action for B<SIGKILL> or B<SIGSTOP>, which cannot be "
4440 "caught or ignored."
4441 msgstr ""
4442
4443 #.  SVr4 does not document the EINTR condition.
4444 #. type: Plain text
4445 #: build/C/man2/sigaction.2:680
4446 msgid "POSIX.1-2001, SVr4."
4447 msgstr ""
4448
4449 #. type: Plain text
4450 #: build/C/man2/sigaction.2:688 build/C/man7/signal.7:105
4451 msgid ""
4452 "A child created via B<fork>(2)  inherits a copy of its parent's signal "
4453 "dispositions.  During an B<execve>(2), the dispositions of handled signals "
4454 "are reset to the default; the dispositions of ignored signals are left "
4455 "unchanged."
4456 msgstr ""
4457
4458 #. type: Plain text
4459 #: build/C/man2/sigaction.2:706 build/C/man2/signal.2:134
4460 msgid ""
4461 "According to POSIX, the behavior of a process is undefined after it ignores "
4462 "a B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> signal that was not generated by "
4463 "B<kill>(2)  or B<raise>(3).  Integer division by zero has undefined result.  "
4464 "On some architectures it will generate a B<SIGFPE> signal.  (Also dividing "
4465 "the most negative integer by -1 may generate B<SIGFPE>.)  Ignoring this "
4466 "signal might lead to an endless loop."
4467 msgstr ""
4468
4469 #. type: Plain text
4470 #: build/C/man2/sigaction.2:723
4471 msgid ""
4472 "POSIX.1-1990 disallowed setting the action for B<SIGCHLD> to B<SIG_IGN>.  "
4473 "POSIX.1-2001 allows this possibility, so that ignoring B<SIGCHLD> can be "
4474 "used to prevent the creation of zombies (see B<wait>(2)).  Nevertheless, the "
4475 "historical BSD and System V behaviors for ignoring B<SIGCHLD> differ, so "
4476 "that the only completely portable method of ensuring that terminated "
4477 "children do not become zombies is to catch the B<SIGCHLD> signal and perform "
4478 "a B<wait>(2)  or similar."
4479 msgstr ""
4480
4481 #. type: Plain text
4482 #: build/C/man2/sigaction.2:736
4483 msgid ""
4484 "POSIX.1-1990 specified only B<SA_NOCLDSTOP>.  POSIX.1-2001 added "
4485 "B<SA_NOCLDWAIT>, B<SA_RESETHAND>, B<SA_NODEFER>, and B<SA_SIGINFO>.  Use of "
4486 "these latter values in I<sa_flags> may be less portable in applications "
4487 "intended for older UNIX implementations."
4488 msgstr ""
4489
4490 #. type: Plain text
4491 #: build/C/man2/sigaction.2:740
4492 msgid "The B<SA_RESETHAND> flag is compatible with the SVr4 flag of the same name."
4493 msgstr ""
4494
4495 #. type: Plain text
4496 #: build/C/man2/sigaction.2:750
4497 msgid ""
4498 "The B<SA_NODEFER> flag is compatible with the SVr4 flag of the same name "
4499 "under kernels 1.3.9 and newer.  On older kernels the Linux implementation "
4500 "allowed the receipt of any signal, not just the one we are installing "
4501 "(effectively overriding any I<sa_mask> settings)."
4502 msgstr ""
4503
4504 #. type: Plain text
4505 #: build/C/man2/sigaction.2:756
4506 msgid ""
4507 "B<sigaction>()  can be called with a NULL second argument to query the "
4508 "current signal handler.  It can also be used to check whether a given signal "
4509 "is valid for the current machine by calling it with NULL second and third "
4510 "arguments."
4511 msgstr ""
4512
4513 #. type: Plain text
4514 #: build/C/man2/sigaction.2:762
4515 msgid ""
4516 "It is not possible to block B<SIGKILL> or B<SIGSTOP> (by specifying them in "
4517 "I<sa_mask>).  Attempts to do so are silently ignored."
4518 msgstr ""
4519
4520 #. type: Plain text
4521 #: build/C/man2/sigaction.2:766 build/C/man2/sigpending.2:70 build/C/man2/sigprocmask.2:144 build/C/man2/sigsuspend.2:108
4522 msgid "See B<sigsetops>(3)  for details on manipulating signal sets."
4523 msgstr ""
4524
4525 #. type: Plain text
4526 #: build/C/man2/sigaction.2:771
4527 msgid ""
4528 "See B<signal>(7)  for a list of the async-signal-safe functions that can be "
4529 "safely called inside from inside a signal handler."
4530 msgstr ""
4531
4532 #. type: SS
4533 #: build/C/man2/sigaction.2:771
4534 #, no-wrap
4535 msgid "Undocumented"
4536 msgstr ""
4537
4538 #. type: Plain text
4539 #: build/C/man2/sigaction.2:781
4540 msgid ""
4541 "Before the introduction of B<SA_SIGINFO> it was also possible to get some "
4542 "additional information, namely by using a I<sa_handler> with second argument "
4543 "of type I<struct sigcontext>.  See the relevant Linux kernel sources for "
4544 "details.  This use is obsolete now."
4545 msgstr ""
4546
4547 #. type: Plain text
4548 #: build/C/man2/sigaction.2:790
4549 msgid ""
4550 "In kernels up to and including 2.6.13, specifying B<SA_NODEFER> in "
4551 "I<sa_flags> prevents not only the delivered signal from being masked during "
4552 "execution of the handler, but also the signals specified in I<sa_mask>.  "
4553 "This bug was fixed in kernel 2.6.14."
4554 msgstr ""
4555
4556 #. type: Plain text
4557 #: build/C/man2/sigaction.2:793
4558 msgid "See B<mprotect>(2)."
4559 msgstr ""
4560
4561 #. type: Plain text
4562 #: build/C/man2/sigaction.2:813
4563 msgid ""
4564 "B<kill>(1), B<kill>(2), B<killpg>(2), B<pause>(2), B<restart_syscall>(2), "
4565 "B<sigaltstack>(2), B<signal>(2), B<signalfd>(2), B<sigpending>(2), "
4566 "B<sigprocmask>(2), B<sigsuspend>(2), B<wait>(2), B<raise>(3), "
4567 "B<siginterrupt>(3), B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), "
4568 "B<core>(5), B<signal>(7)"
4569 msgstr ""
4570
4571 #. type: TH
4572 #: build/C/man2/sigaltstack.2:27
4573 #, no-wrap
4574 msgid "SIGALTSTACK"
4575 msgstr ""
4576
4577 #. type: TH
4578 #: build/C/man2/sigaltstack.2:27
4579 #, no-wrap
4580 msgid "2010-09-26"
4581 msgstr ""
4582
4583 #. type: Plain text
4584 #: build/C/man2/sigaltstack.2:30
4585 msgid "sigaltstack - set and/or get signal stack context"
4586 msgstr ""
4587
4588 #. type: Plain text
4589 #: build/C/man2/sigaltstack.2:34
4590 msgid "B<int sigaltstack(const stack_t *>I<ss>B<, stack_t *>I<oss>B<);>"
4591 msgstr ""
4592
4593 #. type: Plain text
4594 #: build/C/man2/sigaltstack.2:41
4595 msgid "B<sigaltstack>():"
4596 msgstr ""
4597
4598 #. type: Plain text
4599 #: build/C/man2/sigaltstack.2:48 build/C/man3/siginterrupt.3:53 build/C/man2/wait.2:80
4600 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
4601 msgstr ""
4602
4603 #. type: Plain text
4604 #: build/C/man2/sigaltstack.2:60
4605 msgid ""
4606 "B<sigaltstack>()  allows a process to define a new alternate signal stack "
4607 "and/or retrieve the state of an existing alternate signal stack.  An "
4608 "alternate signal stack is used during the execution of a signal handler if "
4609 "the establishment of that handler (see B<sigaction>(2))  requested it."
4610 msgstr ""
4611
4612 #. type: Plain text
4613 #: build/C/man2/sigaltstack.2:63
4614 msgid ""
4615 "The normal sequence of events for using an alternate signal stack is the "
4616 "following:"
4617 msgstr ""
4618
4619 #. type: IP
4620 #: build/C/man2/sigaltstack.2:63 build/C/man7/signal.7:387
4621 #, no-wrap
4622 msgid "1."
4623 msgstr ""
4624
4625 #. type: Plain text
4626 #: build/C/man2/sigaltstack.2:67
4627 msgid "Allocate an area of memory to be used for the alternate signal stack."
4628 msgstr ""
4629
4630 #. type: IP
4631 #: build/C/man2/sigaltstack.2:67 build/C/man7/signal.7:391
4632 #, no-wrap
4633 msgid "2."
4634 msgstr ""
4635
4636 #. type: Plain text
4637 #: build/C/man2/sigaltstack.2:73
4638 msgid ""
4639 "Use B<sigaltstack>()  to inform the system of the existence and location of "
4640 "the alternate signal stack."
4641 msgstr ""
4642
4643 #. type: IP
4644 #: build/C/man2/sigaltstack.2:73 build/C/man7/signal.7:411
4645 #, no-wrap
4646 msgid "3."
4647 msgstr ""
4648
4649 #. type: Plain text
4650 #: build/C/man2/sigaltstack.2:80
4651 msgid ""
4652 "When establishing a signal handler using B<sigaction>(2), inform the system "
4653 "that the signal handler should be executed on the alternate signal stack by "
4654 "specifying the B<SA_ONSTACK> flag."
4655 msgstr ""
4656
4657 #. type: Plain text
4658 #: build/C/man2/sigaltstack.2:88
4659 msgid ""
4660 "The I<ss> argument is used to specify a new alternate signal stack, while "
4661 "the I<oss> argument is used to retrieve information about the currently "
4662 "established signal stack.  If we are interested in performing just one of "
4663 "these tasks then the other argument can be specified as NULL.  Each of these "
4664 "arguments is a structure of the following type:"
4665 msgstr ""
4666
4667 #. type: Plain text
4668 #: build/C/man2/sigaltstack.2:96
4669 #, no-wrap
4670 msgid ""
4671 "typedef struct {\n"
4672 "    void  *ss_sp;     /* Base address of stack */\n"
4673 "    int    ss_flags;  /* Flags */\n"
4674 "    size_t ss_size;   /* Number of bytes in stack */\n"
4675 "} stack_t;\n"
4676 msgstr ""
4677
4678 #. type: Plain text
4679 #: build/C/man2/sigaltstack.2:107
4680 msgid ""
4681 "To establish a new alternate signal stack, I<ss.ss_flags> is set to zero, "
4682 "and I<ss.ss_sp> and I<ss.ss_size> specify the starting address and size of "
4683 "the stack.  The constant B<SIGSTKSZ> is defined to be large enough to cover "
4684 "the usual size requirements for an alternate signal stack, and the constant "
4685 "B<MINSIGSTKSZ> defines the minimum size required to execute a signal "
4686 "handler."
4687 msgstr ""
4688
4689 #. type: Plain text
4690 #: build/C/man2/sigaltstack.2:111
4691 msgid ""
4692 "When a signal handler is invoked on the alternate stack, the kernel "
4693 "automatically aligns the address given in I<ss.ss_sp> to a suitable address "
4694 "boundary for the underlying hardware architecture."
4695 msgstr ""
4696
4697 #. type: Plain text
4698 #: build/C/man2/sigaltstack.2:116
4699 msgid ""
4700 "To disable an existing stack, specify I<ss.ss_flags> as B<SS_DISABLE>.  In "
4701 "this case, the remaining fields in I<ss> are ignored."
4702 msgstr ""
4703
4704 #. type: Plain text
4705 #: build/C/man2/sigaltstack.2:124
4706 msgid ""
4707 "If I<oss> is not NULL, then it is used to return information about the "
4708 "alternate signal stack which was in effect prior to the call to "
4709 "B<sigaltstack>().  The I<oss.ss_sp> and I<oss.ss_size> fields return the "
4710 "starting address and size of that stack.  The I<oss.ss_flags> may return "
4711 "either of the following values:"
4712 msgstr ""
4713
4714 #. type: TP
4715 #: build/C/man2/sigaltstack.2:124
4716 #, no-wrap
4717 msgid "B<SS_ONSTACK>"
4718 msgstr ""
4719
4720 #. type: Plain text
4721 #: build/C/man2/sigaltstack.2:130
4722 msgid ""
4723 "The process is currently executing on the alternate signal stack.  (Note "
4724 "that it is not possible to change the alternate signal stack if the process "
4725 "is currently executing on it.)"
4726 msgstr ""
4727
4728 #. type: TP
4729 #: build/C/man2/sigaltstack.2:130
4730 #, no-wrap
4731 msgid "B<SS_DISABLE>"
4732 msgstr ""
4733
4734 #. type: Plain text
4735 #: build/C/man2/sigaltstack.2:133
4736 msgid "The alternate signal stack is currently disabled."
4737 msgstr ""
4738
4739 #. type: Plain text
4740 #: build/C/man2/sigaltstack.2:137
4741 msgid ""
4742 "B<sigaltstack>()  returns 0 on success, or -1 on failure with I<errno> set "
4743 "to indicate the error."
4744 msgstr ""
4745
4746 #. type: Plain text
4747 #: build/C/man2/sigaltstack.2:142
4748 msgid ""
4749 "Either I<ss> or I<oss> is not NULL and points to an area outside of the "
4750 "process's address space."
4751 msgstr ""
4752
4753 #. type: Plain text
4754 #: build/C/man2/sigaltstack.2:147
4755 msgid ""
4756 "I<ss> is not NULL and the I<ss_flags> field contains a nonzero value other "
4757 "than B<SS_DISABLE>."
4758 msgstr ""
4759
4760 #. type: Plain text
4761 #: build/C/man2/sigaltstack.2:151
4762 msgid ""
4763 "The specified size of the new alternate signal stack (I<ss.ss_size>) was "
4764 "less than B<MINSTKSZ>."
4765 msgstr ""
4766
4767 #. type: Plain text
4768 #: build/C/man2/sigaltstack.2:156
4769 msgid ""
4770 "An attempt was made to change the alternate signal stack while it was active "
4771 "(i.e., the process was already executing on the current alternate signal "
4772 "stack)."
4773 msgstr ""
4774
4775 #. type: Plain text
4776 #: build/C/man2/sigaltstack.2:158
4777 msgid "SUSv2, SVr4, POSIX.1-2001."
4778 msgstr ""
4779
4780 #. type: Plain text
4781 #: build/C/man2/sigaltstack.2:166
4782 msgid ""
4783 "The most common usage of an alternate signal stack is to handle the "
4784 "B<SIGSEGV> signal that is generated if the space available for the normal "
4785 "process stack is exhausted: in this case, a signal handler for B<SIGSEGV> "
4786 "cannot be invoked on the process stack; if we wish to handle it, we must use "
4787 "an alternate signal stack."
4788 msgstr ""
4789
4790 #. type: Plain text
4791 #: build/C/man2/sigaltstack.2:176
4792 msgid ""
4793 "Establishing an alternate signal stack is useful if a process expects that "
4794 "it may exhaust its standard stack.  This may occur, for example, because the "
4795 "stack grows so large that it encounters the upwardly growing heap, or it "
4796 "reaches a limit established by a call to B<setrlimit(RLIMIT_STACK, &rlim)>.  "
4797 "If the standard stack is exhausted, the kernel sends the process a "
4798 "B<SIGSEGV> signal.  In these circumstances the only way to catch this signal "
4799 "is on an alternate signal stack."
4800 msgstr ""
4801
4802 #. type: Plain text
4803 #: build/C/man2/sigaltstack.2:182
4804 msgid ""
4805 "On most hardware architectures supported by Linux, stacks grow downward.  "
4806 "B<sigaltstack>()  automatically takes account of the direction of stack "
4807 "growth."
4808 msgstr ""
4809
4810 #. type: Plain text
4811 #: build/C/man2/sigaltstack.2:191
4812 msgid ""
4813 "Functions called from a signal handler executing on an alternate signal "
4814 "stack will also use the alternate signal stack.  (This also applies to any "
4815 "handlers invoked for other signals while the process is executing on the "
4816 "alternate signal stack.)  Unlike the standard stack, the system does not "
4817 "automatically extend the alternate signal stack.  Exceeding the allocated "
4818 "size of the alternate signal stack will lead to unpredictable results."
4819 msgstr ""
4820
4821 #. type: Plain text
4822 #: build/C/man2/sigaltstack.2:199
4823 msgid ""
4824 "A successful call to B<execve>(2)  removes any existing alternate signal "
4825 "stack.  A child process created via B<fork>(2)  inherits a copy of its "
4826 "parent's alternate signal stack settings."
4827 msgstr ""
4828
4829 #. type: Plain text
4830 #: build/C/man2/sigaltstack.2:208
4831 msgid ""
4832 "B<sigaltstack>()  supersedes the older B<sigstack>()  call.  For backward "
4833 "compatibility, glibc also provides B<sigstack>().  All new applications "
4834 "should be written using B<sigaltstack>()."
4835 msgstr ""
4836
4837 #. type: SS
4838 #: build/C/man2/sigaltstack.2:208 build/C/man3/sigpause.3:61
4839 #, no-wrap
4840 msgid "History"
4841 msgstr ""
4842
4843 #. type: Plain text
4844 #: build/C/man2/sigaltstack.2:215
4845 msgid ""
4846 "4.2BSD had a B<sigstack>()  system call.  It used a slightly different "
4847 "struct, and had the major disadvantage that the caller had to know the "
4848 "direction of stack growth."
4849 msgstr ""
4850
4851 #. type: Plain text
4852 #: build/C/man2/sigaltstack.2:218
4853 msgid "The following code segment demonstrates the use of B<sigaltstack>():"
4854 msgstr ""
4855
4856 #. type: Plain text
4857 #: build/C/man2/sigaltstack.2:222
4858 #, no-wrap
4859 msgid "stack_t ss;\n"
4860 msgstr ""
4861
4862 #. type: Plain text
4863 #: build/C/man2/sigaltstack.2:230
4864 #, no-wrap
4865 msgid ""
4866 "ss.ss_sp = malloc(SIGSTKSZ);\n"
4867 "if (ss.ss_sp == NULL)\n"
4868 "    /* Handle error */;\n"
4869 "ss.ss_size = SIGSTKSZ;\n"
4870 "ss.ss_flags = 0;\n"
4871 "if (sigaltstack(&ss, NULL) == -1)\n"
4872 "    /* Handle error */;\n"
4873 msgstr ""
4874
4875 #. type: Plain text
4876 #: build/C/man2/sigaltstack.2:239
4877 msgid ""
4878 "B<execve>(2), B<setrlimit>(2), B<sigaction>(2), B<siglongjmp>(3), "
4879 "B<sigsetjmp>(3), B<signal>(7)"
4880 msgstr ""
4881
4882 #. type: TH
4883 #: build/C/man7/sigevent.7:26
4884 #, no-wrap
4885 msgid "SIGEVENT"
4886 msgstr ""
4887
4888 #. type: TH
4889 #: build/C/man7/sigevent.7:26
4890 #, no-wrap
4891 msgid "2011-09-09"
4892 msgstr ""
4893
4894 #. type: Plain text
4895 #: build/C/man7/sigevent.7:29
4896 msgid "sigevent - structure for notification from asynchronous routines"
4897 msgstr ""
4898
4899 #. type: Plain text
4900 #: build/C/man7/sigevent.7:36
4901 #, no-wrap
4902 msgid ""
4903 "union sigval {          /* Data passed with notification */\n"
4904 "    int     sival_int;         /* Integer value */\n"
4905 "    void   *sival_ptr;         /* Pointer value */\n"
4906 "};\n"
4907 msgstr ""
4908
4909 #. type: Plain text
4910 #: build/C/man7/sigevent.7:51
4911 #, no-wrap
4912 msgid ""
4913 "struct sigevent {\n"
4914 "    int          sigev_notify; /* Notification method */\n"
4915 "    int          sigev_signo;  /* Notification signal */\n"
4916 "    union sigval sigev_value;  /* Data passed with\n"
4917 "                                  notification */\n"
4918 "    void       (*sigev_notify_function) (union sigval);\n"
4919 "                     /* Function used for thread\n"
4920 "                        notification (SIGEV_THREAD) */\n"
4921 "    void        *sigev_notify_attributes;\n"
4922 "                     /* Attributes for notification thread\n"
4923 "                        (SIGEV_THREAD) */\n"
4924 "    pid_t        sigev_notify_thread_id;\n"
4925 "                     /* ID of thread to signal (SIGEV_THREAD_ID) */\n"
4926 "};\n"
4927 msgstr ""
4928
4929 #. type: Plain text
4930 #: build/C/man7/sigevent.7:60
4931 msgid ""
4932 "The I<sigevent> structure is used by various APIs to describe the way a "
4933 "process is to be notified about an event (e.g., completion of an "
4934 "asynchronous request, expiration of a timer, or the arrival of a message)."
4935 msgstr ""
4936
4937 #. type: Plain text
4938 #: build/C/man7/sigevent.7:68
4939 msgid ""
4940 "The definition shown in the SYNOPSIS is approximate: some of the fields in "
4941 "the I<sigevent> structure may be defined as part of a union.  Programs "
4942 "should employ only those fields relevant to the value specified in "
4943 "I<sigev_notify>."
4944 msgstr ""
4945
4946 #. type: Plain text
4947 #: build/C/man7/sigevent.7:73
4948 msgid ""
4949 "The I<sigev_notify> field specifies how notification is to be performed.  "
4950 "This field can have one of the following values:"
4951 msgstr ""
4952
4953 #. type: TP
4954 #: build/C/man7/sigevent.7:73 build/C/man2/timer_create.2:107
4955 #, no-wrap
4956 msgid "B<SIGEV_NONE>"
4957 msgstr ""
4958
4959 #. type: Plain text
4960 #: build/C/man7/sigevent.7:76
4961 msgid "A \"null\" notification: don't do anything when the event occurs."
4962 msgstr ""
4963
4964 #. type: TP
4965 #: build/C/man7/sigevent.7:76 build/C/man2/timer_create.2:112
4966 #, no-wrap
4967 msgid "B<SIGEV_SIGNAL>"
4968 msgstr ""
4969
4970 #. type: Plain text
4971 #: build/C/man7/sigevent.7:80
4972 msgid "Notify the process by sending the signal specified in I<sigev_signo>."
4973 msgstr ""
4974
4975 #. type: Plain text
4976 #: build/C/man7/sigevent.7:87
4977 msgid ""
4978 "If the signal is caught with a signal handler that was registered using the "
4979 "B<sigaction>(2)  B<SA_SIGINFO> flag, then the following fields are set in "
4980 "the I<siginfo_t> structure that is passed as the second argument of the "
4981 "handler:"
4982 msgstr ""
4983
4984 #. type: Plain text
4985 #: build/C/man7/sigevent.7:92
4986 msgid ""
4987 "This field is set to a value that depends on the API delivering the "
4988 "notification."
4989 msgstr ""
4990
4991 #. type: TP
4992 #: build/C/man7/sigevent.7:92 build/C/man2/wait.2:302
4993 #, no-wrap
4994 msgid "I<si_signo>"
4995 msgstr ""
4996
4997 #. type: Plain text
4998 #: build/C/man7/sigevent.7:96
4999 msgid ""
5000 "This field is set to the signal number (i.e., the same value as in "
5001 "I<sigev_signo>)."
5002 msgstr ""
5003
5004 #. type: Plain text
5005 #: build/C/man7/sigevent.7:100
5006 msgid "This field is set to the value specified in I<sigev_value>."
5007 msgstr ""
5008
5009 #. type: Plain text
5010 #: build/C/man7/sigevent.7:105
5011 msgid ""
5012 "Depending on the API, other fields may also be set in the I<siginfo_t> "
5013 "structure."
5014 msgstr ""
5015
5016 #. type: Plain text
5017 #: build/C/man7/sigevent.7:108
5018 msgid ""
5019 "The same information is also available if the signal is accepted using "
5020 "B<sigwaitinfo>(2)."
5021 msgstr ""
5022
5023 #. type: TP
5024 #: build/C/man7/sigevent.7:108 build/C/man2/timer_create.2:130
5025 #, no-wrap
5026 msgid "B<SIGEV_THREAD>"
5027 msgstr ""
5028
5029 #. type: Plain text
5030 #: build/C/man7/sigevent.7:125
5031 msgid ""
5032 "Notify the process by invoking I<sigev_notify_function> \"as if\" it were "
5033 "the start function of a new thread.  (Among the implementation possibilities "
5034 "here are that each timer notification could result in the creation of a new "
5035 "thread, or that a single thread is created to receive all notifications.)  "
5036 "The function is invoked with I<sigev_value> as its sole argument.  If "
5037 "I<sigev_notify_attributes> is not NULL, it should point to a "
5038 "I<pthread_attr_t> structure that defines attributes for the new thread (see "
5039 "B<pthread_attr_init>(3))."
5040 msgstr ""
5041
5042 #. type: TP
5043 #: build/C/man7/sigevent.7:125 build/C/man2/timer_create.2:138
5044 #, no-wrap
5045 msgid "B<SIGEV_THREAD_ID> (Linux-specific)"
5046 msgstr ""
5047
5048 #.  | SIGEV_SIGNAL vs not?
5049 #. type: Plain text
5050 #: build/C/man7/sigevent.7:130
5051 msgid "Currently used only by POSIX timers; see B<timer_create>(2)."
5052 msgstr ""
5053
5054 #. type: Plain text
5055 #: build/C/man7/sigevent.7:132 build/C/man2/sigpending.2:66 build/C/man2/sigprocmask.2:114 build/C/man3/sigqueue.3:116 build/C/man3/sigsetops.3:133 build/C/man2/sigsuspend.2:86 build/C/man3/sigwait.3:82 build/C/man2/sigwaitinfo.2:135 build/C/man2/timer_create.2:195 build/C/man2/timer_delete.2:69 build/C/man2/timer_getoverrun.2:99 build/C/man2/timer_settime.2:209
5056 msgid "POSIX.1-2001."
5057 msgstr ""
5058
5059 #. type: Plain text
5060 #: build/C/man7/sigevent.7:142
5061 msgid ""
5062 "B<timer_create>(2), B<aio_fsync>(3), B<aio_read>(3), B<aio_write>(3), "
5063 "B<getaddrinfo_a>(3), B<lio_listio>(3), B<mq_notify>(3), B<aio>(7), "
5064 "B<pthreads>(7)"
5065 msgstr ""
5066
5067 #. type: TH
5068 #: build/C/man3/siginterrupt.3:31
5069 #, no-wrap
5070 msgid "SIGINTERRUPT"
5071 msgstr ""
5072
5073 #. type: TH
5074 #: build/C/man3/siginterrupt.3:31 build/C/man2/signal.2:36 build/C/man2/sigpending.2:29 build/C/man2/sigprocmask.2:29 build/C/man3/sigsetops.3:31 build/C/man2/sigsuspend.2:29
5075 #, no-wrap
5076 msgid "2013-04-19"
5077 msgstr ""
5078
5079 #. type: Plain text
5080 #: build/C/man3/siginterrupt.3:34
5081 msgid "siginterrupt - allow signals to interrupt system calls"
5082 msgstr ""
5083
5084 #. type: Plain text
5085 #: build/C/man3/siginterrupt.3:39
5086 #, no-wrap
5087 msgid "B<int siginterrupt(int >I<sig>B<, int >I<flag>B<);>\n"
5088 msgstr ""
5089
5090 #. type: Plain text
5091 #: build/C/man3/siginterrupt.3:47
5092 msgid "B<siginterrupt>():"
5093 msgstr ""
5094
5095 #. type: Plain text
5096 #: build/C/man3/siginterrupt.3:64
5097 msgid ""
5098 "The B<siginterrupt>()  function changes the restart behavior when a system "
5099 "call is interrupted by the signal I<sig>.  If the I<flag> argument is false "
5100 "(0), then system calls will be restarted if interrupted by the specified "
5101 "signal I<sig>.  This is the default behavior in Linux."
5102 msgstr ""
5103
5104 #. type: Plain text
5105 #: build/C/man3/siginterrupt.3:69
5106 msgid ""
5107 "If the I<flag> argument is true (1) and no data has been transferred, then a "
5108 "system call interrupted by the signal I<sig> will return -1 and I<errno> "
5109 "will be set to B<EINTR>."
5110 msgstr ""
5111
5112 #. type: Plain text
5113 #: build/C/man3/siginterrupt.3:73
5114 msgid ""
5115 "If the I<flag> argument is true (1) and data transfer has started, then the "
5116 "system call will be interrupted and will return the actual amount of data "
5117 "transferred."
5118 msgstr ""
5119
5120 #. type: Plain text
5121 #: build/C/man3/siginterrupt.3:83
5122 msgid ""
5123 "The B<siginterrupt>()  function returns 0 on success.  It returns -1 if the "
5124 "signal number I<sig> is invalid, with I<errno> set to indicate the cause of "
5125 "the error."
5126 msgstr ""
5127
5128 #. type: Plain text
5129 #: build/C/man3/siginterrupt.3:87
5130 msgid "The specified signal number is invalid."
5131 msgstr ""
5132
5133 #. type: Plain text
5134 #: build/C/man3/siginterrupt.3:96
5135 msgid ""
5136 "4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<siginterrupt>()  as obsolete, "
5137 "recommending the use of B<sigaction>(2)  with the B<SA_RESTART> flag "
5138 "instead."
5139 msgstr ""
5140
5141 #. type: Plain text
5142 #: build/C/man3/siginterrupt.3:98
5143 msgid "B<signal>(2)"
5144 msgstr ""
5145
5146 #. type: TH
5147 #: build/C/man2/signal.2:36 build/C/man7/signal.7:46
5148 #, no-wrap
5149 msgid "SIGNAL"
5150 msgstr ""
5151
5152 #. type: Plain text
5153 #: build/C/man2/signal.2:39
5154 msgid "signal - ANSI C signal handling"
5155 msgstr ""
5156
5157 #. type: Plain text
5158 #: build/C/man2/signal.2:45
5159 msgid "B<sighandler_t signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
5160 msgstr ""
5161
5162 #. type: Plain text
5163 #: build/C/man2/signal.2:54
5164 msgid ""
5165 "The behavior of B<signal>()  varies across UNIX versions, and has also "
5166 "varied historically across different versions of Linux.  B<Avoid its use>: "
5167 "use B<sigaction>(2)  instead.  See I<Portability> below."
5168 msgstr ""
5169
5170 #. type: Plain text
5171 #: build/C/man2/signal.2:64
5172 msgid ""
5173 "B<signal>()  sets the disposition of the signal I<signum> to I<handler>, "
5174 "which is either B<SIG_IGN>, B<SIG_DFL>, or the address of a "
5175 "programmer-defined function (a \"signal handler\")."
5176 msgstr ""
5177
5178 #. type: Plain text
5179 #: build/C/man2/signal.2:68
5180 msgid ""
5181 "If the signal I<signum> is delivered to the process, then one of the "
5182 "following happens:"
5183 msgstr ""
5184
5185 #. type: Plain text
5186 #: build/C/man2/signal.2:73
5187 msgid "If the disposition is set to B<SIG_IGN>, then the signal is ignored."
5188 msgstr ""
5189
5190 #. type: Plain text
5191 #: build/C/man2/signal.2:80
5192 msgid ""
5193 "If the disposition is set to B<SIG_DFL>, then the default action associated "
5194 "with the signal (see B<signal>(7))  occurs."
5195 msgstr ""
5196
5197 #. type: Plain text
5198 #: build/C/man2/signal.2:91
5199 msgid ""
5200 "If the disposition is set to a function, then first either the disposition "
5201 "is reset to B<SIG_DFL>, or the signal is blocked (see I<Portability> below), "
5202 "and then I<handler> is called with argument I<signum>.  If invocation of the "
5203 "handler caused the signal to be blocked, then the signal is unblocked upon "
5204 "return from the handler."
5205 msgstr ""
5206
5207 #. type: Plain text
5208 #: build/C/man2/signal.2:97
5209 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught or ignored."
5210 msgstr ""
5211
5212 #. type: Plain text
5213 #: build/C/man2/signal.2:105
5214 msgid ""
5215 "B<signal>()  returns the previous value of the signal handler, or B<SIG_ERR> "
5216 "on error.  In the event of an error, I<errno> is set to indicate the cause."
5217 msgstr ""
5218
5219 #. type: Plain text
5220 #: build/C/man2/signal.2:110
5221 msgid "I<signum> is invalid."
5222 msgstr ""
5223
5224 #. type: Plain text
5225 #: build/C/man2/signal.2:116
5226 msgid "The effects of B<signal>()  in a multithreaded process are unspecified."
5227 msgstr ""
5228
5229 #. type: Plain text
5230 #: build/C/man2/signal.2:141
5231 msgid ""
5232 "See B<sigaction>(2)  for details on what happens when B<SIGCHLD> is set to "
5233 "B<SIG_IGN>."
5234 msgstr ""
5235
5236 #. type: Plain text
5237 #: build/C/man2/signal.2:146
5238 msgid ""
5239 "See B<signal>(7)  for a list of the async-signal-safe functions that can be "
5240 "safely called from inside a signal handler."
5241 msgstr ""
5242
5243 #.  libc4 and libc5 define
5244 #.  .IR SignalHandler ;
5245 #. type: Plain text
5246 #: build/C/man2/signal.2:162
5247 msgid ""
5248 "The use of I<sighandler_t> is a GNU extension, exposed if B<_GNU_SOURCE> is "
5249 "defined; glibc also defines (the BSD-derived)  I<sig_t> if B<_BSD_SOURCE> is "
5250 "defined.  Without use of such a type, the declaration of B<signal>()  is the "
5251 "somewhat harder to read:"
5252 msgstr ""
5253
5254 #. type: Plain text
5255 #: build/C/man2/signal.2:166
5256 #, no-wrap
5257 msgid ""
5258 "B<void ( *>I<signal>B<(int >I<signum>B<, void (*>I<handler>B<)(int)) ) "
5259 "(int);>\n"
5260 msgstr ""
5261
5262 #. type: SS
5263 #: build/C/man2/signal.2:168
5264 #, no-wrap
5265 msgid "Portability"
5266 msgstr ""
5267
5268 #. type: Plain text
5269 #: build/C/man2/signal.2:180
5270 msgid ""
5271 "The only portable use of B<signal>()  is to set a signal's disposition to "
5272 "B<SIG_DFL> or B<SIG_IGN>.  The semantics when using B<signal>()  to "
5273 "establish a signal handler vary across systems (and POSIX.1 explicitly "
5274 "permits this variation); B<do not use it for this purpose.>"
5275 msgstr ""
5276
5277 #. type: Plain text
5278 #: build/C/man2/signal.2:186
5279 msgid ""
5280 "POSIX.1 solved the portability mess by specifying B<sigaction>(2), which "
5281 "provides explicit control of the semantics when a signal handler is invoked; "
5282 "use that interface instead of B<signal>()."
5283 msgstr ""
5284
5285 #. type: Plain text
5286 #: build/C/man2/signal.2:196
5287 msgid ""
5288 "In the original UNIX systems, when a handler that was established using "
5289 "B<signal>()  was invoked by the delivery of a signal, the disposition of the "
5290 "signal would be reset to B<SIG_DFL>, and the system did not block delivery "
5291 "of further instances of the signal.  This is equivalent to calling "
5292 "B<sigaction>(2)  with the following flags:"
5293 msgstr ""
5294
5295 #. type: Plain text
5296 #: build/C/man2/signal.2:198
5297 #, no-wrap
5298 msgid "    sa.sa_flags = SA_RESETHAND | SA_NODEFER;\n"
5299 msgstr ""
5300
5301 #. type: Plain text
5302 #: build/C/man2/signal.2:205
5303 msgid ""
5304 "System V also provides these semantics for B<signal>().  This was bad "
5305 "because the signal might be delivered again before the handler had a chance "
5306 "to reestablish itself.  Furthermore, rapid deliveries of the same signal "
5307 "could result in recursive invocations of the handler."
5308 msgstr ""
5309
5310 #. type: Plain text
5311 #: build/C/man2/signal.2:220
5312 msgid ""
5313 "BSD improved on this situation, but unfortunately also changed the semantics "
5314 "of the existing B<signal>()  interface while doing so.  On BSD, when a "
5315 "signal handler is invoked, the signal disposition is not reset, and further "
5316 "instances of the signal are blocked from being delivered while the handler "
5317 "is executing.  Furthermore, certain blocking system calls are automatically "
5318 "restarted if interrupted by a signal handler (see B<signal>(7)).  The BSD "
5319 "semantics are equivalent to calling B<sigaction>(2)  with the following "
5320 "flags:"
5321 msgstr ""
5322
5323 #. type: Plain text
5324 #: build/C/man2/signal.2:222
5325 #, no-wrap
5326 msgid "    sa.sa_flags = SA_RESTART;\n"
5327 msgstr ""
5328
5329 #. type: Plain text
5330 #: build/C/man2/signal.2:224
5331 msgid "The situation on Linux is as follows:"
5332 msgstr ""
5333
5334 #. type: Plain text
5335 #: build/C/man2/signal.2:228
5336 msgid "The kernel's B<signal>()  system call provides System V semantics."
5337 msgstr ""
5338
5339 #. type: Plain text
5340 #: build/C/man2/signal.2:244
5341 msgid ""
5342 "By default, in glibc 2 and later, the B<signal>()  wrapper function does not "
5343 "invoke the kernel system call.  Instead, it calls B<sigaction>(2)  using "
5344 "flags that supply BSD semantics.  This default behavior is provided as long "
5345 "as the B<_BSD_SOURCE> feature test macro is defined.  By default, "
5346 "B<_BSD_SOURCE> is defined; it is also implicitly defined if one defines "
5347 "B<_GNU_SOURCE>, and can of course be explicitly defined."
5348 msgstr ""
5349
5350 #
5351 #.  System V semantics are also provided if one uses the separate
5352 #.  .BR sysv_signal (3)
5353 #.  function.
5354 #. type: Plain text
5355 #: build/C/man2/signal.2:267
5356 msgid ""
5357 "On glibc 2 and later, if the B<_BSD_SOURCE> feature test macro is not "
5358 "defined, then B<signal>()  provides System V semantics.  (The default "
5359 "implicit definition of B<_BSD_SOURCE> is not provided if one invokes "
5360 "B<gcc>(1)  in one of its standard modes (I<-std=xxx> or I<-ansi>)  or "
5361 "defines various other feature test macros such as B<_POSIX_SOURCE>, "
5362 "B<_XOPEN_SOURCE>, or B<_SVID_SOURCE>; see B<feature_test_macros>(7).)"
5363 msgstr ""
5364
5365 #. type: Plain text
5366 #: build/C/man2/signal.2:278
5367 msgid ""
5368 "The B<signal>()  function in Linux libc4 and libc5 provide System V "
5369 "semantics.  If one on a libc5 system includes I<E<lt>bsd/signal.hE<gt>> "
5370 "instead of I<E<lt>signal.hE<gt>>, then B<signal>()  provides BSD semantics."
5371 msgstr ""
5372
5373 #. type: Plain text
5374 #: build/C/man2/signal.2:297
5375 msgid ""
5376 "B<kill>(1), B<alarm>(2), B<kill>(2), B<killpg>(2), B<pause>(2), "
5377 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
5378 "B<sigsuspend>(2), B<bsd_signal>(3), B<raise>(3), B<siginterrupt>(3), "
5379 "B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), B<sysv_signal>(3), "
5380 "B<signal>(7)"
5381 msgstr ""
5382
5383 #. type: Plain text
5384 #: build/C/man7/signal.7:49
5385 msgid "signal - overview of signals"
5386 msgstr ""
5387
5388 #. type: Plain text
5389 #: build/C/man7/signal.7:52
5390 msgid ""
5391 "Linux supports both POSIX reliable signals (hereinafter \"standard "
5392 "signals\") and POSIX real-time signals."
5393 msgstr ""
5394
5395 #. type: SS
5396 #: build/C/man7/signal.7:52
5397 #, no-wrap
5398 msgid "Signal dispositions"
5399 msgstr ""
5400
5401 #. type: Plain text
5402 #: build/C/man7/signal.7:57
5403 msgid ""
5404 "Each signal has a current I<disposition>, which determines how the process "
5405 "behaves when it is delivered the signal."
5406 msgstr ""
5407
5408 #. type: Plain text
5409 #: build/C/man7/signal.7:60
5410 msgid ""
5411 "The entries in the \"Action\" column of the tables below specify the default "
5412 "disposition for each signal, as follows:"
5413 msgstr ""
5414
5415 #. type: IP
5416 #: build/C/man7/signal.7:60
5417 #, no-wrap
5418 msgid "Term"
5419 msgstr ""
5420
5421 #. type: Plain text
5422 #: build/C/man7/signal.7:62
5423 msgid "Default action is to terminate the process."
5424 msgstr ""
5425
5426 #. type: IP
5427 #: build/C/man7/signal.7:62
5428 #, no-wrap
5429 msgid "Ign"
5430 msgstr ""
5431
5432 #. type: Plain text
5433 #: build/C/man7/signal.7:64
5434 msgid "Default action is to ignore the signal."
5435 msgstr ""
5436
5437 #. type: IP
5438 #: build/C/man7/signal.7:64
5439 #, no-wrap
5440 msgid "Core"
5441 msgstr ""
5442
5443 #. type: Plain text
5444 #: build/C/man7/signal.7:67
5445 msgid "Default action is to terminate the process and dump core (see B<core>(5))."
5446 msgstr ""
5447
5448 #. type: IP
5449 #: build/C/man7/signal.7:67
5450 #, no-wrap
5451 msgid "Stop"
5452 msgstr ""
5453
5454 #. type: Plain text
5455 #: build/C/man7/signal.7:69
5456 msgid "Default action is to stop the process."
5457 msgstr ""
5458
5459 #. type: IP
5460 #: build/C/man7/signal.7:69
5461 #, no-wrap
5462 msgid "Cont"
5463 msgstr ""
5464
5465 #. type: Plain text
5466 #: build/C/man7/signal.7:71
5467 msgid "Default action is to continue the process if it is currently stopped."
5468 msgstr ""
5469
5470 #. type: Plain text
5471 #: build/C/man7/signal.7:93
5472 msgid ""
5473 "A process can change the disposition of a signal using B<sigaction>(2)  or "
5474 "B<signal>(2).  (The latter is less portable when establishing a signal "
5475 "handler; see B<signal>(2)  for details.)  Using these system calls, a "
5476 "process can elect one of the following behaviors to occur on delivery of the "
5477 "signal: perform the default action; ignore the signal; or catch the signal "
5478 "with a I<signal handler>, a programmer-defined function that is "
5479 "automatically invoked when the signal is delivered.  (By default, the signal "
5480 "handler is invoked on the normal process stack.  It is possible to arrange "
5481 "that the signal handler uses an alternate stack; see B<sigaltstack>(2)  for "
5482 "a discussion of how to do this and when it might be useful.)"
5483 msgstr ""
5484
5485 #. type: Plain text
5486 #: build/C/man7/signal.7:97
5487 msgid ""
5488 "The signal disposition is a per-process attribute: in a multithreaded "
5489 "application, the disposition of a particular signal is the same for all "
5490 "threads."
5491 msgstr ""
5492
5493 #. type: SS
5494 #: build/C/man7/signal.7:105
5495 #, no-wrap
5496 msgid "Sending a signal"
5497 msgstr ""
5498
5499 #. type: Plain text
5500 #: build/C/man7/signal.7:108
5501 msgid ""
5502 "The following system calls and library functions allow the caller to send a "
5503 "signal:"
5504 msgstr ""
5505
5506 #. type: TP
5507 #: build/C/man7/signal.7:108
5508 #, no-wrap
5509 msgid "B<raise>(3)"
5510 msgstr ""
5511
5512 #. type: Plain text
5513 #: build/C/man7/signal.7:111
5514 msgid "Sends a signal to the calling thread."
5515 msgstr ""
5516
5517 #. type: Plain text
5518 #: build/C/man7/signal.7:116
5519 msgid ""
5520 "Sends a signal to a specified process, to all members of a specified process "
5521 "group, or to all processes on the system."
5522 msgstr ""
5523
5524 #. type: TP
5525 #: build/C/man7/signal.7:116
5526 #, no-wrap
5527 msgid "B<killpg>(2)"
5528 msgstr ""
5529
5530 #. type: Plain text
5531 #: build/C/man7/signal.7:119
5532 msgid "Sends a signal to all of the members of a specified process group."
5533 msgstr ""
5534
5535 #. type: TP
5536 #: build/C/man7/signal.7:119
5537 #, no-wrap
5538 msgid "B<pthread_kill>(3)"
5539 msgstr ""
5540
5541 #. type: Plain text
5542 #: build/C/man7/signal.7:123
5543 msgid ""
5544 "Sends a signal to a specified POSIX thread in the same process as the "
5545 "caller."
5546 msgstr ""
5547
5548 #. type: TP
5549 #: build/C/man7/signal.7:123
5550 #, no-wrap
5551 msgid "B<tgkill>(2)"
5552 msgstr ""
5553
5554 #. type: Plain text
5555 #: build/C/man7/signal.7:128
5556 msgid ""
5557 "Sends a signal to a specified thread within a specific process.  (This is "
5558 "the system call used to implement B<pthread_kill>(3).)"
5559 msgstr ""
5560
5561 #. type: Plain text
5562 #: build/C/man7/signal.7:131
5563 msgid "Sends a real-time signal with accompanying data to a specified process."
5564 msgstr ""
5565
5566 #. type: SS
5567 #: build/C/man7/signal.7:131
5568 #, no-wrap
5569 msgid "Waiting for a signal to be caught"
5570 msgstr ""
5571
5572 #. type: Plain text
5573 #: build/C/man7/signal.7:135
5574 msgid ""
5575 "The following system calls suspend execution of the calling process or "
5576 "thread until a signal is caught (or an unhandled signal terminates the "
5577 "process):"
5578 msgstr ""
5579
5580 #. type: TP
5581 #: build/C/man7/signal.7:135
5582 #, no-wrap
5583 msgid "B<pause>(2)"
5584 msgstr ""
5585
5586 #. type: Plain text
5587 #: build/C/man7/signal.7:138
5588 msgid "Suspends execution until any signal is caught."
5589 msgstr ""
5590
5591 #. type: TP
5592 #: build/C/man7/signal.7:138
5593 #, no-wrap
5594 msgid "B<sigsuspend>(2)"
5595 msgstr ""
5596
5597 #. type: Plain text
5598 #: build/C/man7/signal.7:142
5599 msgid ""
5600 "Temporarily changes the signal mask (see below) and suspends execution until "
5601 "one of the unmasked signals is caught."
5602 msgstr ""
5603
5604 #. type: SS
5605 #: build/C/man7/signal.7:142
5606 #, no-wrap
5607 msgid "Synchronously accepting a signal"
5608 msgstr ""
5609
5610 #. type: Plain text
5611 #: build/C/man7/signal.7:149
5612 msgid ""
5613 "Rather than asynchronously catching a signal via a signal handler, it is "
5614 "possible to synchronously accept the signal, that is, to block execution "
5615 "until the signal is delivered, at which point the kernel returns information "
5616 "about the signal to the caller.  There are two general ways to do this:"
5617 msgstr ""
5618
5619 #. type: Plain text
5620 #: build/C/man7/signal.7:157
5621 msgid ""
5622 "B<sigwaitinfo>(2), B<sigtimedwait>(2), and B<sigwait>(3)  suspend execution "
5623 "until one of the signals in a specified set is delivered.  Each of these "
5624 "calls returns information about the delivered signal."
5625 msgstr ""
5626
5627 #. type: Plain text
5628 #: build/C/man7/signal.7:170
5629 msgid ""
5630 "B<signalfd>(2)  returns a file descriptor that can be used to read "
5631 "information about signals that are delivered to the caller.  Each B<read>(2)  "
5632 "from this file descriptor blocks until one of the signals in the set "
5633 "specified in the B<signalfd>(2)  call is delivered to the caller.  The "
5634 "buffer returned by B<read>(2)  contains a structure describing the signal."
5635 msgstr ""
5636
5637 #. type: SS
5638 #: build/C/man7/signal.7:170
5639 #, no-wrap
5640 msgid "Signal mask and pending signals"
5641 msgstr ""
5642
5643 #. type: Plain text
5644 #: build/C/man7/signal.7:177
5645 msgid ""
5646 "A signal may be I<blocked>, which means that it will not be delivered until "
5647 "it is later unblocked.  Between the time when it is generated and when it is "
5648 "delivered a signal is said to be I<pending>."
5649 msgstr ""
5650
5651 #. type: Plain text
5652 #: build/C/man7/signal.7:186
5653 msgid ""
5654 "Each thread in a process has an independent I<signal mask>, which indicates "
5655 "the set of signals that the thread is currently blocking.  A thread can "
5656 "manipulate its signal mask using B<pthread_sigmask>(3).  In a traditional "
5657 "single-threaded application, B<sigprocmask>(2)  can be used to manipulate "
5658 "the signal mask."
5659 msgstr ""
5660
5661 #. type: Plain text
5662 #: build/C/man7/signal.7:192 build/C/man2/sigprocmask.2:126
5663 msgid ""
5664 "A child created via B<fork>(2)  inherits a copy of its parent's signal mask; "
5665 "the signal mask is preserved across B<execve>(2)."
5666 msgstr ""
5667
5668 #. type: Plain text
5669 #: build/C/man7/signal.7:209
5670 msgid ""
5671 "A signal may be generated (and thus pending)  for a process as a whole "
5672 "(e.g., when sent using B<kill>(2))  or for a specific thread (e.g., certain "
5673 "signals, such as B<SIGSEGV> and B<SIGFPE>, generated as a consequence of "
5674 "executing a specific machine-language instruction are thread directed, as "
5675 "are signals targeted at a specific thread using B<pthread_kill>(3)).  A "
5676 "process-directed signal may be delivered to any one of the threads that does "
5677 "not currently have the signal blocked.  If more than one of the threads has "
5678 "the signal unblocked, then the kernel chooses an arbitrary thread to which "
5679 "to deliver the signal."
5680 msgstr ""
5681
5682 #. type: Plain text
5683 #: build/C/man7/signal.7:216
5684 msgid ""
5685 "A thread can obtain the set of signals that it currently has pending using "
5686 "B<sigpending>(2).  This set will consist of the union of the set of pending "
5687 "process-directed signals and the set of signals pending for the calling "
5688 "thread."
5689 msgstr ""
5690
5691 #. type: Plain text
5692 #: build/C/man7/signal.7:222 build/C/man2/sigpending.2:81
5693 msgid ""
5694 "A child created via B<fork>(2)  initially has an empty pending signal set; "
5695 "the pending signal set is preserved across an B<execve>(2)."
5696 msgstr ""
5697
5698 #. type: SS
5699 #: build/C/man7/signal.7:222
5700 #, no-wrap
5701 msgid "Standard signals"
5702 msgstr ""
5703
5704 #. type: Plain text
5705 #: build/C/man7/signal.7:234
5706 msgid ""
5707 "Linux supports the standard signals listed below.  Several signal numbers "
5708 "are architecture-dependent, as indicated in the \"Value\" column.  (Where "
5709 "three values are given, the first one is usually valid for alpha and sparc, "
5710 "the middle one for x86, arm, and most other architectures, and the last one "
5711 "for mips.  (Values for parisc are I<not> shown; see the Linux kernel source "
5712 "for signal numbering on that architecture.)  A - denotes that a signal is "
5713 "absent on the corresponding architecture.)"
5714 msgstr ""
5715
5716 #. type: Plain text
5717 #: build/C/man7/signal.7:236
5718 msgid "First the signals described in the original POSIX.1-1990 standard."
5719 msgstr ""
5720
5721 #. type: tbl table
5722 #: build/C/man7/signal.7:240 build/C/man7/signal.7:276 build/C/man7/signal.7:305
5723 #, no-wrap
5724 msgid "Signal\tValue\tAction\tComment\n"
5725 msgstr ""
5726
5727 #. type: tbl table
5728 #: build/C/man7/signal.7:241
5729 #, no-wrap
5730 msgid "SIGHUP\t\\01\tTerm\tHangup detected on controlling terminal\n"
5731 msgstr ""
5732
5733 #. type: tbl table
5734 #: build/C/man7/signal.7:242
5735 #, no-wrap
5736 msgid "\t\t\tor death of controlling process\n"
5737 msgstr ""
5738
5739 #. type: tbl table
5740 #: build/C/man7/signal.7:243
5741 #, no-wrap
5742 msgid "SIGINT\t\\02\tTerm\tInterrupt from keyboard\n"
5743 msgstr ""
5744
5745 #. type: tbl table
5746 #: build/C/man7/signal.7:244
5747 #, no-wrap
5748 msgid "SIGQUIT\t\\03\tCore\tQuit from keyboard\n"
5749 msgstr ""
5750
5751 #. type: tbl table
5752 #: build/C/man7/signal.7:245
5753 #, no-wrap
5754 msgid "SIGILL\t\\04\tCore\tIllegal Instruction\n"
5755 msgstr ""
5756
5757 #. type: tbl table
5758 #: build/C/man7/signal.7:246
5759 #, no-wrap
5760 msgid "SIGABRT\t\\06\tCore\tAbort signal from B<abort>(3)\n"
5761 msgstr ""
5762
5763 #. type: tbl table
5764 #: build/C/man7/signal.7:247
5765 #, no-wrap
5766 msgid "SIGFPE\t\\08\tCore\tFloating point exception\n"
5767 msgstr ""
5768
5769 #. type: tbl table
5770 #: build/C/man7/signal.7:248
5771 #, no-wrap
5772 msgid "SIGKILL\t\\09\tTerm\tKill signal\n"
5773 msgstr ""
5774
5775 #. type: tbl table
5776 #: build/C/man7/signal.7:249
5777 #, no-wrap
5778 msgid "SIGSEGV\t11\tCore\tInvalid memory reference\n"
5779 msgstr ""
5780
5781 #. type: tbl table
5782 #: build/C/man7/signal.7:250
5783 #, no-wrap
5784 msgid "SIGPIPE\t13\tTerm\tBroken pipe: write to pipe with no\n"
5785 msgstr ""
5786
5787 #. type: tbl table
5788 #: build/C/man7/signal.7:251
5789 #, no-wrap
5790 msgid "\t\t\treaders\n"
5791 msgstr ""
5792
5793 #. type: tbl table
5794 #: build/C/man7/signal.7:252
5795 #, no-wrap
5796 msgid "SIGALRM\t14\tTerm\tTimer signal from B<alarm>(2)\n"
5797 msgstr ""
5798
5799 #. type: tbl table
5800 #: build/C/man7/signal.7:253
5801 #, no-wrap
5802 msgid "SIGTERM\t15\tTerm\tTermination signal\n"
5803 msgstr ""
5804
5805 #. type: tbl table
5806 #: build/C/man7/signal.7:254
5807 #, no-wrap
5808 msgid "SIGUSR1\t30,10,16\tTerm\tUser-defined signal 1\n"
5809 msgstr ""
5810
5811 #. type: tbl table
5812 #: build/C/man7/signal.7:255
5813 #, no-wrap
5814 msgid "SIGUSR2\t31,12,17\tTerm\tUser-defined signal 2\n"
5815 msgstr ""
5816
5817 #. type: tbl table
5818 #: build/C/man7/signal.7:256
5819 #, no-wrap
5820 msgid "SIGCHLD\t20,17,18\tIgn\tChild stopped or terminated\n"
5821 msgstr ""
5822
5823 #. type: tbl table
5824 #: build/C/man7/signal.7:257
5825 #, no-wrap
5826 msgid "SIGCONT\t19,18,25\tCont\tContinue if stopped\n"
5827 msgstr ""
5828
5829 #. type: tbl table
5830 #: build/C/man7/signal.7:258
5831 #, no-wrap
5832 msgid "SIGSTOP\t17,19,23\tStop\tStop process\n"
5833 msgstr ""
5834
5835 #. type: tbl table
5836 #: build/C/man7/signal.7:259
5837 #, no-wrap
5838 msgid "SIGTSTP\t18,20,24\tStop\tStop typed at terminal\n"
5839 msgstr ""
5840
5841 #. type: tbl table
5842 #: build/C/man7/signal.7:260
5843 #, no-wrap
5844 msgid "SIGTTIN\t21,21,26\tStop\tTerminal input for background process\n"
5845 msgstr ""
5846
5847 #. type: tbl table
5848 #: build/C/man7/signal.7:261
5849 #, no-wrap
5850 msgid "SIGTTOU\t22,22,27\tStop\tTerminal output for background process\n"
5851 msgstr ""
5852
5853 #. type: Plain text
5854 #: build/C/man7/signal.7:269
5855 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught, blocked, or ignored."
5856 msgstr ""
5857
5858 #. type: Plain text
5859 #: build/C/man7/signal.7:272
5860 msgid ""
5861 "Next the signals not in the POSIX.1-1990 standard but described in SUSv2 and "
5862 "POSIX.1-2001."
5863 msgstr ""
5864
5865 #. type: tbl table
5866 #: build/C/man7/signal.7:277
5867 #, no-wrap
5868 msgid "SIGBUS\t10,7,10\tCore\tBus error (bad memory access)\n"
5869 msgstr ""
5870
5871 #. type: tbl table
5872 #: build/C/man7/signal.7:278
5873 #, no-wrap
5874 msgid "SIGPOLL\t\tTerm\tPollable event (Sys V).\n"
5875 msgstr ""
5876
5877 #. type: tbl table
5878 #: build/C/man7/signal.7:279
5879 #, no-wrap
5880 msgid "\t\t\tSynonym for B<SIGIO>\n"
5881 msgstr ""
5882
5883 #. type: tbl table
5884 #: build/C/man7/signal.7:280
5885 #, no-wrap
5886 msgid "SIGPROF\t27,27,29\tTerm\tProfiling timer expired\n"
5887 msgstr ""
5888
5889 #. type: tbl table
5890 #: build/C/man7/signal.7:281
5891 #, no-wrap
5892 msgid "SIGSYS\t12,31,12\tCore\tBad argument to routine (SVr4)\n"
5893 msgstr ""
5894
5895 #. type: tbl table
5896 #: build/C/man7/signal.7:282
5897 #, no-wrap
5898 msgid "SIGTRAP\t5\tCore\tTrace/breakpoint trap\n"
5899 msgstr ""
5900
5901 #. type: tbl table
5902 #: build/C/man7/signal.7:283
5903 #, no-wrap
5904 msgid "SIGURG\t16,23,21\tIgn\tUrgent condition on socket (4.2BSD)\n"
5905 msgstr ""
5906
5907 #. type: tbl table
5908 #: build/C/man7/signal.7:284
5909 #, no-wrap
5910 msgid "SIGVTALRM\t26,26,28\tTerm\tVirtual alarm clock (4.2BSD)\n"
5911 msgstr ""
5912
5913 #. type: tbl table
5914 #: build/C/man7/signal.7:285
5915 #, no-wrap
5916 msgid "SIGXCPU\t24,24,30\tCore\tCPU time limit exceeded (4.2BSD)\n"
5917 msgstr ""
5918
5919 #. type: tbl table
5920 #: build/C/man7/signal.7:286
5921 #, no-wrap
5922 msgid "SIGXFSZ\t25,25,31\tCore\tFile size limit exceeded (4.2BSD)\n"
5923 msgstr ""
5924
5925 #. type: Plain text
5926 #: build/C/man7/signal.7:299
5927 msgid ""
5928 "Up to and including Linux 2.2, the default behavior for B<SIGSYS>, "
5929 "B<SIGXCPU>, B<SIGXFSZ>, and (on architectures other than SPARC and MIPS)  "
5930 "B<SIGBUS> was to terminate the process (without a core dump).  (On some "
5931 "other UNIX systems the default action for B<SIGXCPU> and B<SIGXFSZ> is to "
5932 "terminate the process without a core dump.)  Linux 2.4 conforms to the "
5933 "POSIX.1-2001 requirements for these signals, terminating the process with a "
5934 "core dump."
5935 msgstr ""
5936
5937 #. type: Plain text
5938 #: build/C/man7/signal.7:301
5939 msgid "Next various other signals."
5940 msgstr ""
5941
5942 #. type: tbl table
5943 #: build/C/man7/signal.7:306
5944 #, no-wrap
5945 msgid "SIGIOT\t6\tCore\tIOT trap. A synonym for B<SIGABRT>\n"
5946 msgstr ""
5947
5948 #. type: tbl table
5949 #: build/C/man7/signal.7:307
5950 #, no-wrap
5951 msgid "SIGEMT\t7,-,7\tTerm\n"
5952 msgstr ""
5953
5954 #. type: tbl table
5955 #: build/C/man7/signal.7:308
5956 #, no-wrap
5957 msgid "SIGSTKFLT\t-,16,-\tTerm\tStack fault on coprocessor (unused)\n"
5958 msgstr ""
5959
5960 #. type: tbl table
5961 #: build/C/man7/signal.7:309
5962 #, no-wrap
5963 msgid "SIGIO\t23,29,22\tTerm\tI/O now possible (4.2BSD)\n"
5964 msgstr ""
5965
5966 #. type: tbl table
5967 #: build/C/man7/signal.7:310
5968 #, no-wrap
5969 msgid "SIGCLD\t-,-,18\tIgn\tA synonym for B<SIGCHLD>\n"
5970 msgstr ""
5971
5972 #. type: tbl table
5973 #: build/C/man7/signal.7:311
5974 #, no-wrap
5975 msgid "SIGPWR\t29,30,19\tTerm\tPower failure (System V)\n"
5976 msgstr ""
5977
5978 #. type: tbl table
5979 #: build/C/man7/signal.7:312
5980 #, no-wrap
5981 msgid "SIGINFO\t29,-,-\t\tA synonym for B<SIGPWR>\n"
5982 msgstr ""
5983
5984 #. type: tbl table
5985 #: build/C/man7/signal.7:313
5986 #, no-wrap
5987 msgid "SIGLOST\t-,-,-\tTerm\tFile lock lost (unused)\n"
5988 msgstr ""
5989
5990 #. type: tbl table
5991 #: build/C/man7/signal.7:314
5992 #, no-wrap
5993 msgid "SIGWINCH\t28,28,20\tIgn\tWindow resize signal (4.3BSD, Sun)\n"
5994 msgstr ""
5995
5996 #. type: tbl table
5997 #: build/C/man7/signal.7:315
5998 #, no-wrap
5999 msgid "SIGUNUSED\t-,31,-\tCore\tSynonymous with B<SIGSYS>\n"
6000 msgstr ""
6001
6002 #. type: Plain text
6003 #: build/C/man7/signal.7:325
6004 msgid "(Signal 29 is B<SIGINFO> / B<SIGPWR> on an alpha but B<SIGLOST> on a sparc.)"
6005 msgstr ""
6006
6007 #. type: Plain text
6008 #: build/C/man7/signal.7:331
6009 msgid ""
6010 "B<SIGEMT> is not specified in POSIX.1-2001, but nevertheless appears on most "
6011 "other UNIX systems, where its default action is typically to terminate the "
6012 "process with a core dump."
6013 msgstr ""
6014
6015 #. type: Plain text
6016 #: build/C/man7/signal.7:335
6017 msgid ""
6018 "B<SIGPWR> (which is not specified in POSIX.1-2001) is typically ignored by "
6019 "default on those other UNIX systems where it appears."
6020 msgstr ""
6021
6022 #. type: Plain text
6023 #: build/C/man7/signal.7:339
6024 msgid ""
6025 "B<SIGIO> (which is not specified in POSIX.1-2001) is ignored by default on "
6026 "several other UNIX systems."
6027 msgstr ""
6028
6029 #.  parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
6030 #. type: Plain text
6031 #: build/C/man7/signal.7:346
6032 msgid ""
6033 "Where defined, B<SIGUNUSED> is synonymous with B<SIGSYS> on most "
6034 "architectures."
6035 msgstr ""
6036
6037 #. type: SS
6038 #: build/C/man7/signal.7:346
6039 #, no-wrap
6040 msgid "Real-time signals"
6041 msgstr ""
6042
6043 #. type: Plain text
6044 #: build/C/man7/signal.7:356
6045 msgid ""
6046 "Linux supports real-time signals as originally defined in the POSIX.1b "
6047 "real-time extensions (and now included in POSIX.1-2001).  The range of "
6048 "supported real-time signals is defined by the macros B<SIGRTMIN> and "
6049 "B<SIGRTMAX>.  POSIX.1-2001 requires that an implementation support at least "
6050 "B<_POSIX_RTSIG_MAX> (8) real-time signals."
6051 msgstr ""
6052
6053 #. type: Plain text
6054 #: build/C/man7/signal.7:378
6055 msgid ""
6056 "The Linux kernel supports a range of 32 different real-time signals, "
6057 "numbered 33 to 64.  However, the glibc POSIX threads implementation "
6058 "internally uses two (for NPTL) or three (for LinuxThreads) real-time signals "
6059 "(see B<pthreads>(7)), and adjusts the value of B<SIGRTMIN> suitably (to 34 "
6060 "or 35).  Because the range of available real-time signals varies according "
6061 "to the glibc threading implementation (and this variation can occur at run "
6062 "time according to the available kernel and glibc), and indeed the range of "
6063 "real-time signals varies across UNIX systems, programs should I<never refer "
6064 "to real-time signals using hard-coded numbers>, but instead should always "
6065 "refer to real-time signals using the notation B<SIGRTMIN>+n, and include "
6066 "suitable (run-time) checks that B<SIGRTMIN>+n does not exceed B<SIGRTMAX>."
6067 msgstr ""
6068
6069 #. type: Plain text
6070 #: build/C/man7/signal.7:382
6071 msgid ""
6072 "Unlike standard signals, real-time signals have no predefined meanings: the "
6073 "entire set of real-time signals can be used for application-defined "
6074 "purposes."
6075 msgstr ""
6076
6077 #. type: Plain text
6078 #: build/C/man7/signal.7:385
6079 msgid ""
6080 "The default action for an unhandled real-time signal is to terminate the "
6081 "receiving process."
6082 msgstr ""
6083
6084 #. type: Plain text
6085 #: build/C/man7/signal.7:387
6086 msgid "Real-time signals are distinguished by the following:"
6087 msgstr ""
6088
6089 #. type: Plain text
6090 #: build/C/man7/signal.7:391
6091 msgid ""
6092 "Multiple instances of real-time signals can be queued.  By contrast, if "
6093 "multiple instances of a standard signal are delivered while that signal is "
6094 "currently blocked, then only one instance is queued."
6095 msgstr ""
6096
6097 #. type: Plain text
6098 #: build/C/man7/signal.7:411
6099 msgid ""
6100 "If the signal is sent using B<sigqueue>(3), an accompanying value (either an "
6101 "integer or a pointer) can be sent with the signal.  If the receiving process "
6102 "establishes a handler for this signal using the B<SA_SIGINFO> flag to "
6103 "B<sigaction>(2)  then it can obtain this data via the I<si_value> field of "
6104 "the I<siginfo_t> structure passed as the second argument to the handler.  "
6105 "Furthermore, the I<si_pid> and I<si_uid> fields of this structure can be "
6106 "used to obtain the PID and real user ID of the process sending the signal."
6107 msgstr ""
6108
6109 #. type: Plain text
6110 #: build/C/man7/signal.7:420
6111 msgid ""
6112 "Real-time signals are delivered in a guaranteed order.  Multiple real-time "
6113 "signals of the same type are delivered in the order they were sent.  If "
6114 "different real-time signals are sent to a process, they are delivered "
6115 "starting with the lowest-numbered signal.  (I.e., low-numbered signals have "
6116 "highest priority.)  By contrast, if multiple standard signals are pending "
6117 "for a process, the order in which they are delivered is unspecified."
6118 msgstr ""
6119
6120 #. type: Plain text
6121 #: build/C/man7/signal.7:425
6122 msgid ""
6123 "If both standard and real-time signals are pending for a process, POSIX "
6124 "leaves it unspecified which is delivered first.  Linux, like many other "
6125 "implementations, gives priority to standard signals in this case."
6126 msgstr ""
6127
6128 #. type: Plain text
6129 #: build/C/man7/signal.7:448
6130 msgid ""
6131 "According to POSIX, an implementation should permit at least "
6132 "B<_POSIX_SIGQUEUE_MAX> (32) real-time signals to be queued to a process.  "
6133 "However, Linux does things differently.  In kernels up to and including "
6134 "2.6.7, Linux imposes a system-wide limit on the number of queued real-time "
6135 "signals for all processes.  This limit can be viewed and (with privilege) "
6136 "changed via the I</proc/sys/kernel/rtsig-max> file.  A related file, "
6137 "I</proc/sys/kernel/rtsig-nr>, can be used to find out how many real-time "
6138 "signals are currently queued.  In Linux 2.6.8, these I</proc> interfaces "
6139 "were replaced by the B<RLIMIT_SIGPENDING> resource limit, which specifies a "
6140 "per-user limit for queued signals; see B<setrlimit>(2)  for further details."
6141 msgstr ""
6142
6143 #. type: SS
6144 #: build/C/man7/signal.7:448
6145 #, no-wrap
6146 msgid "Async-signal-safe functions"
6147 msgstr ""
6148
6149 #. type: Plain text
6150 #: build/C/man7/signal.7:457
6151 msgid ""
6152 "A signal handler function must be very careful, since processing elsewhere "
6153 "may be interrupted at some arbitrary point in the execution of the program.  "
6154 "POSIX has the concept of \"safe function\".  If a signal interrupts the "
6155 "execution of an unsafe function, and I<handler> calls an unsafe function, "
6156 "then the behavior of the program is undefined."
6157 msgstr ""
6158
6159 #. type: Plain text
6160 #: build/C/man7/signal.7:461
6161 msgid ""
6162 "POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2)  requires "
6163 "an implementation to guarantee that the following functions can be safely "
6164 "called inside a signal handler:"
6165 msgstr ""
6166
6167 #. type: Plain text
6168 #: build/C/man7/signal.7:582
6169 #, no-wrap
6170 msgid ""
6171 "_Exit()\n"
6172 "_exit()\n"
6173 "abort()\n"
6174 "accept()\n"
6175 "access()\n"
6176 "aio_error()\n"
6177 "aio_return()\n"
6178 "aio_suspend()\n"
6179 "alarm()\n"
6180 "bind()\n"
6181 "cfgetispeed()\n"
6182 "cfgetospeed()\n"
6183 "cfsetispeed()\n"
6184 "cfsetospeed()\n"
6185 "chdir()\n"
6186 "chmod()\n"
6187 "chown()\n"
6188 "clock_gettime()\n"
6189 "close()\n"
6190 "connect()\n"
6191 "creat()\n"
6192 "dup()\n"
6193 "dup2()\n"
6194 "execle()\n"
6195 "execve()\n"
6196 "fchmod()\n"
6197 "fchown()\n"
6198 "fcntl()\n"
6199 "fdatasync()\n"
6200 "fork()\n"
6201 "fpathconf()\n"
6202 "fstat()\n"
6203 "fsync()\n"
6204 "ftruncate()\n"
6205 "getegid()\n"
6206 "geteuid()\n"
6207 "getgid()\n"
6208 "getgroups()\n"
6209 "getpeername()\n"
6210 "getpgrp()\n"
6211 "getpid()\n"
6212 "getppid()\n"
6213 "getsockname()\n"
6214 "getsockopt()\n"
6215 "getuid()\n"
6216 "kill()\n"
6217 "link()\n"
6218 "listen()\n"
6219 "lseek()\n"
6220 "lstat()\n"
6221 "mkdir()\n"
6222 "mkfifo()\n"
6223 "open()\n"
6224 "pathconf()\n"
6225 "pause()\n"
6226 "pipe()\n"
6227 "poll()\n"
6228 "posix_trace_event()\n"
6229 "pselect()\n"
6230 "raise()\n"
6231 "read()\n"
6232 "readlink()\n"
6233 "recv()\n"
6234 "recvfrom()\n"
6235 "recvmsg()\n"
6236 "rename()\n"
6237 "rmdir()\n"
6238 "select()\n"
6239 "sem_post()\n"
6240 "send()\n"
6241 "sendmsg()\n"
6242 "sendto()\n"
6243 "setgid()\n"
6244 "setpgid()\n"
6245 "setsid()\n"
6246 "setsockopt()\n"
6247 "setuid()\n"
6248 "shutdown()\n"
6249 "sigaction()\n"
6250 "sigaddset()\n"
6251 "sigdelset()\n"
6252 "sigemptyset()\n"
6253 "sigfillset()\n"
6254 "sigismember()\n"
6255 "signal()\n"
6256 "sigpause()\n"
6257 "sigpending()\n"
6258 "sigprocmask()\n"
6259 "sigqueue()\n"
6260 "sigset()\n"
6261 "sigsuspend()\n"
6262 "sleep()\n"
6263 "sockatmark()\n"
6264 "socket()\n"
6265 "socketpair()\n"
6266 "stat()\n"
6267 "symlink()\n"
6268 "sysconf()\n"
6269 "tcdrain()\n"
6270 "tcflow()\n"
6271 "tcflush()\n"
6272 "tcgetattr()\n"
6273 "tcgetpgrp()\n"
6274 "tcsendbreak()\n"
6275 "tcsetattr()\n"
6276 "tcsetpgrp()\n"
6277 "time()\n"
6278 "timer_getoverrun()\n"
6279 "timer_gettime()\n"
6280 "timer_settime()\n"
6281 "times()\n"
6282 "umask()\n"
6283 "uname()\n"
6284 "unlink()\n"
6285 "utime()\n"
6286 "wait()\n"
6287 "waitpid()\n"
6288 "write()\n"
6289 msgstr ""
6290
6291 #. type: Plain text
6292 #: build/C/man7/signal.7:587
6293 msgid ""
6294 "POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf()  from the above "
6295 "list, and adds the following functions:"
6296 msgstr ""
6297
6298 #. type: Plain text
6299 #: build/C/man7/signal.7:610
6300 #, no-wrap
6301 msgid ""
6302 "execl()\n"
6303 "execv()\n"
6304 "faccessat()\n"
6305 "fchmodat()\n"
6306 "fchownat()\n"
6307 "fexecve()\n"
6308 "fstatat()\n"
6309 "futimens()\n"
6310 "linkat()\n"
6311 "mkdirat()\n"
6312 "mkfifoat()\n"
6313 "mknod()\n"
6314 "mknodat()\n"
6315 "openat()\n"
6316 "readlinkat()\n"
6317 "renameat()\n"
6318 "symlinkat()\n"
6319 "unlinkat()\n"
6320 "utimensat()\n"
6321 "utimes()\n"
6322 msgstr ""
6323
6324 #. type: SS
6325 #: build/C/man7/signal.7:612
6326 #, no-wrap
6327 msgid "Interruption of system calls and library functions by signal handlers"
6328 msgstr ""
6329
6330 #. type: Plain text
6331 #: build/C/man7/signal.7:615
6332 msgid ""
6333 "If a signal handler is invoked while a system call or library function call "
6334 "is blocked, then either:"
6335 msgstr ""
6336
6337 #. type: Plain text
6338 #: build/C/man7/signal.7:617
6339 msgid "the call is automatically restarted after the signal handler returns; or"
6340 msgstr ""
6341
6342 #. type: Plain text
6343 #: build/C/man7/signal.7:620
6344 msgid "the call fails with the error B<EINTR>."
6345 msgstr ""
6346
6347 #. type: Plain text
6348 #: build/C/man7/signal.7:628
6349 msgid ""
6350 "Which of these two behaviors occurs depends on the interface and whether or "
6351 "not the signal handler was established using the B<SA_RESTART> flag (see "
6352 "B<sigaction>(2)).  The details vary across UNIX systems; below, the details "
6353 "for Linux."
6354 msgstr ""
6355
6356 #.  The following system calls use ERESTARTSYS,
6357 #.  so that they are restartable
6358 #. type: Plain text
6359 #: build/C/man7/signal.7:637
6360 msgid ""
6361 "If a blocked call to one of the following interfaces is interrupted by a "
6362 "signal handler, then the call will be automatically restarted after the "
6363 "signal handler returns if the B<SA_RESTART> flag was used; otherwise the "
6364 "call will fail with the error B<EINTR>:"
6365 msgstr ""
6366
6367 #. type: Plain text
6368 #: build/C/man7/signal.7:653
6369 msgid ""
6370 "B<read>(2), B<readv>(2), B<write>(2), B<writev>(2), and B<ioctl>(2)  calls "
6371 "on \"slow\" devices.  A \"slow\" device is one where the I/O call may block "
6372 "for an indefinite time, for example, a terminal, pipe, or socket.  (A disk "
6373 "is not a slow device according to this definition.)  If an I/O call on a "
6374 "slow device has already transferred some data by the time it is interrupted "
6375 "by a signal handler, then the call will return a success status (normally, "
6376 "the number of bytes transferred)."
6377 msgstr ""
6378
6379 #. type: Plain text
6380 #: build/C/man7/signal.7:657
6381 msgid "B<open>(2), if it can block (e.g., when opening a FIFO; see B<fifo>(7))."
6382 msgstr ""
6383
6384 #. type: Plain text
6385 #: build/C/man7/signal.7:664
6386 msgid "B<wait>(2), B<wait3>(2), B<wait4>(2), B<waitid>(2), and B<waitpid>(2)."
6387 msgstr ""
6388
6389 #.  If a timeout (setsockopt()) is in effect on the socket, then these
6390 #.  system calls switch to using EINTR.  Consequently, they and are not
6391 #.  automatically restarted, and they show the stop/cont behavior
6392 #.  described below.  (Verified from 2.6.26 source, and by experiment; mtk)
6393 #. type: Plain text
6394 #: build/C/man7/signal.7:680
6395 msgid ""
6396 "Socket interfaces: B<accept>(2), B<connect>(2), B<recv>(2), B<recvfrom>(2), "
6397 "B<recvmsg>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), unless a timeout "
6398 "has been set on the socket (see below)."
6399 msgstr ""
6400
6401 #. type: Plain text
6402 #: build/C/man7/signal.7:686
6403 msgid "File locking interfaces: B<flock>(2)  and B<fcntl>(2)  B<F_SETLKW>."
6404 msgstr ""
6405
6406 #. type: Plain text
6407 #: build/C/man7/signal.7:693
6408 msgid ""
6409 "POSIX message queue interfaces: B<mq_receive>(3), B<mq_timedreceive>(3), "
6410 "B<mq_send>(3), and B<mq_timedsend>(3)."
6411 msgstr ""
6412
6413 #. type: Plain text
6414 #: build/C/man7/signal.7:698
6415 msgid ""
6416 "B<futex>(2)  B<FUTEX_WAIT> (since Linux 2.6.22; beforehand, always failed "
6417 "with B<EINTR>)."
6418 msgstr ""
6419
6420 #. type: Plain text
6421 #: build/C/man7/signal.7:705
6422 msgid ""
6423 "POSIX semaphore interfaces: B<sem_wait>(3)  and B<sem_timedwait>(3)  (since "
6424 "Linux 2.6.22; beforehand, always failed with B<EINTR>)."
6425 msgstr ""
6426
6427 #.  These are the system calls that give EINTR or ERESTARTNOHAND
6428 #.  on interruption by a signal handler.
6429 #. type: Plain text
6430 #: build/C/man7/signal.7:716
6431 msgid ""
6432 "The following interfaces are never restarted after being interrupted by a "
6433 "signal handler, regardless of the use of B<SA_RESTART>; they always fail "
6434 "with the error B<EINTR> when interrupted by a signal handler:"
6435 msgstr ""
6436
6437 #. type: Plain text
6438 #: build/C/man7/signal.7:736 build/C/man7/signal.7:810
6439 msgid ""
6440 "Socket interfaces, when a timeout has been set on the socket using "
6441 "B<setsockopt>(2): B<accept>(2), B<recv>(2), B<recvfrom>(2), and "
6442 "B<recvmsg>(2), if a receive timeout (B<SO_RCVTIMEO>)  has been set; "
6443 "B<connect>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), if a send "
6444 "timeout (B<SO_SNDTIMEO>)  has been set."
6445 msgstr ""
6446
6447 #. type: Plain text
6448 #: build/C/man7/signal.7:743
6449 msgid ""
6450 "Interfaces used to wait for signals: B<pause>(2), B<sigsuspend>(2), "
6451 "B<sigtimedwait>(2), and B<sigwaitinfo>(2)."
6452 msgstr ""
6453
6454 #. type: Plain text
6455 #: build/C/man7/signal.7:752
6456 msgid ""
6457 "File descriptor multiplexing interfaces: B<epoll_wait>(2), "
6458 "B<epoll_pwait>(2), B<poll>(2), B<ppoll>(2), B<select>(2), and B<pselect>(2)."
6459 msgstr ""
6460
6461 #.  On some other systems, SA_RESTART does restart these system calls
6462 #. type: Plain text
6463 #: build/C/man7/signal.7:760
6464 msgid ""
6465 "System V IPC interfaces: B<msgrcv>(2), B<msgsnd>(2), B<semop>(2), and "
6466 "B<semtimedop>(2)."
6467 msgstr ""
6468
6469 #. type: Plain text
6470 #: build/C/man7/signal.7:766
6471 msgid "Sleep interfaces: B<clock_nanosleep>(2), B<nanosleep>(2), and B<usleep>(3)."
6472 msgstr ""
6473
6474 #. type: Plain text
6475 #: build/C/man7/signal.7:771 build/C/man7/signal.7:824
6476 msgid "B<read>(2)  from an B<inotify>(7)  file descriptor."
6477 msgstr ""
6478
6479 #. type: Plain text
6480 #: build/C/man7/signal.7:773
6481 msgid "B<io_getevents>(2)."
6482 msgstr ""
6483
6484 #. type: Plain text
6485 #: build/C/man7/signal.7:779
6486 msgid ""
6487 "The B<sleep>(3)  function is also never restarted if interrupted by a "
6488 "handler, but gives a success return: the number of seconds remaining to "
6489 "sleep."
6490 msgstr ""
6491
6492 #. type: SS
6493 #: build/C/man7/signal.7:779
6494 #, no-wrap
6495 msgid "Interruption of system calls and library functions by stop signals"
6496 msgstr ""
6497
6498 #. type: Plain text
6499 #: build/C/man7/signal.7:788
6500 msgid ""
6501 "On Linux, even in the absence of signal handlers, certain blocking "
6502 "interfaces can fail with the error B<EINTR> after the process is stopped by "
6503 "one of the stop signals and then resumed via B<SIGCONT>.  This behavior is "
6504 "not sanctioned by POSIX.1, and doesn't occur on other systems."
6505 msgstr ""
6506
6507 #. type: Plain text
6508 #: build/C/man7/signal.7:790
6509 msgid "The Linux interfaces that display this behavior are:"
6510 msgstr ""
6511
6512 #. type: Plain text
6513 #: build/C/man7/signal.7:813
6514 msgid "B<epoll_wait>(2), B<epoll_pwait>(2)."
6515 msgstr ""
6516
6517 #. type: Plain text
6518 #: build/C/man7/signal.7:816
6519 msgid "B<semop>(2), B<semtimedop>(2)."
6520 msgstr ""
6521
6522 #. type: Plain text
6523 #: build/C/man7/signal.7:819
6524 msgid "B<sigtimedwait>(2), B<sigwaitinfo>(2)."
6525 msgstr ""
6526
6527 #. type: Plain text
6528 #: build/C/man7/signal.7:830
6529 msgid ""
6530 "Linux 2.6.21 and earlier: B<futex>(2)  B<FUTEX_WAIT>, B<sem_timedwait>(3), "
6531 "B<sem_wait>(3)."
6532 msgstr ""
6533
6534 #. type: Plain text
6535 #: build/C/man7/signal.7:834
6536 msgid "Linux 2.6.8 and earlier: B<msgrcv>(2), B<msgsnd>(2)."
6537 msgstr ""
6538
6539 #. type: Plain text
6540 #: build/C/man7/signal.7:837
6541 msgid "Linux 2.4 and earlier: B<nanosleep>(2)."
6542 msgstr ""
6543
6544 #.  It must be a *very* long time since this was true:
6545 #.  .SH BUGS
6546 #.  .B SIGIO
6547 #.  and
6548 #.  .B SIGLOST
6549 #.  have the same value.
6550 #.  The latter is commented out in the kernel source, but
6551 #.  the build process of some software still thinks that
6552 #.  signal 29 is
6553 #.  .BR SIGLOST .
6554 #. type: Plain text
6555 #: build/C/man7/signal.7:850
6556 msgid "POSIX.1, except as noted."
6557 msgstr ""
6558
6559 #. type: Plain text
6560 #: build/C/man7/signal.7:884
6561 msgid ""
6562 "B<kill>(1), B<getrlimit>(2), B<kill>(2), B<killpg>(2), "
6563 "B<restart_syscall>(2), B<rt_sigqueueinfo>(2), B<setitimer>(2), "
6564 "B<setrlimit>(2), B<sgetmask>(2), B<sigaction>(2), B<sigaltstack>(2), "
6565 "B<signal>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
6566 "B<sigsuspend>(2), B<sigwaitinfo>(2), B<abort>(3), B<bsd_signal>(3), "
6567 "B<longjmp>(3), B<raise>(3), B<pthread_sigqueue>(3), B<sigqueue>(3), "
6568 "B<sigset>(3), B<sigsetops>(3), B<sigvec>(3), B<sigwait>(3), B<strsignal>(3), "
6569 "B<sysv_signal>(3), B<core>(5), B<proc>(5), B<pthreads>(7), B<sigevent>(7)"
6570 msgstr ""
6571
6572 #. type: TH
6573 #: build/C/man2/signalfd.2:20
6574 #, no-wrap
6575 msgid "SIGNALFD"
6576 msgstr ""
6577
6578 #. type: TH
6579 #: build/C/man2/signalfd.2:20
6580 #, no-wrap
6581 msgid "2009-01-13"
6582 msgstr ""
6583
6584 #. type: Plain text
6585 #: build/C/man2/signalfd.2:23
6586 msgid "signalfd - create a file descriptor for accepting signals"
6587 msgstr ""
6588
6589 #. type: Plain text
6590 #: build/C/man2/signalfd.2:25
6591 msgid "B<#include E<lt>sys/signalfd.hE<gt>>"
6592 msgstr ""
6593
6594 #. type: Plain text
6595 #: build/C/man2/signalfd.2:27
6596 msgid "B<int signalfd(int >I<fd>B<, const sigset_t *>I<mask>B<, int >I<flags>B<);>"
6597 msgstr ""
6598
6599 #. type: Plain text
6600 #: build/C/man2/signalfd.2:38
6601 msgid ""
6602 "B<signalfd>()  creates a file descriptor that can be used to accept signals "
6603 "targeted at the caller.  This provides an alternative to the use of a signal "
6604 "handler or B<sigwaitinfo>(2), and has the advantage that the file descriptor "
6605 "may be monitored by B<select>(2), B<poll>(2), and B<epoll>(7)."
6606 msgstr ""
6607
6608 #. type: Plain text
6609 #: build/C/man2/signalfd.2:58
6610 msgid ""
6611 "The I<mask> argument specifies the set of signals that the caller wishes to "
6612 "accept via the file descriptor.  This argument is a signal set whose "
6613 "contents can be initialized using the macros described in B<sigsetops>(3).  "
6614 "Normally, the set of signals to be received via the file descriptor should "
6615 "be blocked using B<sigprocmask>(2), to prevent the signals being handled "
6616 "according to their default dispositions.  It is not possible to receive "
6617 "B<SIGKILL> or B<SIGSTOP> signals via a signalfd file descriptor; these "
6618 "signals are silently ignored if specified in I<mask>."
6619 msgstr ""
6620
6621 #. type: Plain text
6622 #: build/C/man2/signalfd.2:72
6623 msgid ""
6624 "If the I<fd> argument is -1, then the call creates a new file descriptor and "
6625 "associates the signal set specified in I<mask> with that descriptor.  If "
6626 "I<fd> is not -1, then it must specify a valid existing signalfd file "
6627 "descriptor, and I<mask> is used to replace the signal set associated with "
6628 "that descriptor."
6629 msgstr ""
6630
6631 #. type: Plain text
6632 #: build/C/man2/signalfd.2:77
6633 msgid ""
6634 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
6635 "I<flags> to change the behaviour of B<signalfd>():"
6636 msgstr ""
6637
6638 #. type: TP
6639 #: build/C/man2/signalfd.2:77
6640 #, no-wrap
6641 msgid "B<SFD_NONBLOCK>"
6642 msgstr ""
6643
6644 #. type: TP
6645 #: build/C/man2/signalfd.2:85
6646 #, no-wrap
6647 msgid "B<SFD_CLOEXEC>"
6648 msgstr ""
6649
6650 #. type: Plain text
6651 #: build/C/man2/signalfd.2:102
6652 msgid ""
6653 "B<signalfd>()  returns a file descriptor that supports the following "
6654 "operations:"
6655 msgstr ""
6656
6657 #. type: Plain text
6658 #: build/C/man2/signalfd.2:121
6659 msgid ""
6660 "If one or more of the signals specified in I<mask> is pending for the "
6661 "process, then the buffer supplied to B<read>(2)  is used to return one or "
6662 "more I<signalfd_siginfo> structures (see below) that describe the signals.  "
6663 "The B<read>(2)  returns information for as many signals as are pending and "
6664 "will fit in the supplied buffer.  The buffer must be at least "
6665 "I<sizeof(struct signalfd_siginfo)> bytes.  The return value of the "
6666 "B<read>(2)  is the total number of bytes read."
6667 msgstr ""
6668
6669 #. type: Plain text
6670 #: build/C/man2/signalfd.2:129
6671 msgid ""
6672 "As a consequence of the B<read>(2), the signals are consumed, so that they "
6673 "are no longer pending for the process (i.e., will not be caught by signal "
6674 "handlers, and cannot be accepted using B<sigwaitinfo>(2))."
6675 msgstr ""
6676
6677 #. type: Plain text
6678 #: build/C/man2/signalfd.2:140
6679 msgid ""
6680 "If none of the signals in I<mask> is pending for the process, then the "
6681 "B<read>(2)  either blocks until one of the signals in I<mask> is generated "
6682 "for the process, or fails with the error B<EAGAIN> if the file descriptor "
6683 "has been made nonblocking."
6684 msgstr ""
6685
6686 #. type: Plain text
6687 #: build/C/man2/signalfd.2:153
6688 msgid ""
6689 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
6690 "B<poll>(2)  B<POLLIN> flag)  if one or more of the signals in I<mask> is "
6691 "pending for the process."
6692 msgstr ""
6693
6694 #. type: Plain text
6695 #: build/C/man2/signalfd.2:160
6696 msgid ""
6697 "The signalfd file descriptor also supports the other file-descriptor "
6698 "multiplexing APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
6699 msgstr ""
6700
6701 #. type: Plain text
6702 #: build/C/man2/signalfd.2:165
6703 msgid ""
6704 "When the file descriptor is no longer required it should be closed.  When "
6705 "all file descriptors associated with the same signalfd object have been "
6706 "closed, the resources for object are freed by the kernel."
6707 msgstr ""
6708
6709 #. type: SS
6710 #: build/C/man2/signalfd.2:165
6711 #, no-wrap
6712 msgid "The signalfd_siginfo structure"
6713 msgstr ""
6714
6715 #. type: Plain text
6716 #: build/C/man2/signalfd.2:171
6717 msgid ""
6718 "The format of the I<signalfd_siginfo> structure(s) returned by B<read>(2)s "
6719 "from a signalfd file descriptor is as follows:"
6720 msgstr ""
6721
6722 #.  ssi_trapno is unused on most arches
6723 #.  FIXME Since Linux 2.6.37 there is 'uint16_t ssi_addr_lsb'
6724 #.  which is not yet documented
6725 #. type: Plain text
6726 #: build/C/man2/signalfd.2:198
6727 #, no-wrap
6728 msgid ""
6729 "struct signalfd_siginfo {\n"
6730 "    uint32_t ssi_signo;   /* Signal number */\n"
6731 "    int32_t  ssi_errno;   /* Error number (unused) */\n"
6732 "    int32_t  ssi_code;    /* Signal code */\n"
6733 "    uint32_t ssi_pid;     /* PID of sender */\n"
6734 "    uint32_t ssi_uid;     /* Real UID of sender */\n"
6735 "    int32_t  ssi_fd;      /* File descriptor (SIGIO) */\n"
6736 "    uint32_t ssi_tid;     /* Kernel timer ID (POSIX timers)\n"
6737 "    uint32_t ssi_band;    /* Band event (SIGIO) */\n"
6738 "    uint32_t ssi_overrun; /* POSIX timer overrun count */\n"
6739 "    uint32_t ssi_trapno;  /* Trap number that caused signal */\n"
6740 "    int32_t  ssi_status;  /* Exit status or signal (SIGCHLD) */\n"
6741 "    int32_t  ssi_int;     /* Integer sent by sigqueue(3) */\n"
6742 "    uint64_t ssi_ptr;     /* Pointer sent by sigqueue(3) */\n"
6743 "    uint64_t ssi_utime;   /* User CPU time consumed (SIGCHLD) */\n"
6744 "    uint64_t ssi_stime;   /* System CPU time consumed (SIGCHLD) */\n"
6745 "    uint64_t ssi_addr;    /* Address that generated signal\n"
6746 "                             (for hardware-generated signals) */\n"
6747 "    uint8_t  pad[I<X>];      /* Pad size to 128 bytes (allow for\n"
6748 "                              additional fields in the future) */\n"
6749 "};\n"
6750 msgstr ""
6751
6752 #. type: Plain text
6753 #: build/C/man2/signalfd.2:221
6754 msgid ""
6755 "Each of the fields in this structure is analogous to the similarly named "
6756 "field in the I<siginfo_t> structure.  The I<siginfo_t> structure is "
6757 "described in B<sigaction>(2).  Not all fields in the returned "
6758 "I<signalfd_siginfo> structure will be valid for a specific signal; the set "
6759 "of valid fields can be determined from the value returned in the I<ssi_code> "
6760 "field.  This field is the analog of the I<siginfo_t> I<si_code> field; see "
6761 "B<sigaction>(2)  for details."
6762 msgstr ""
6763
6764 #. type: SS
6765 #: build/C/man2/signalfd.2:221 build/C/man2/timerfd_create.2:269
6766 #, no-wrap
6767 msgid "fork(2) semantics"
6768 msgstr ""
6769
6770 #. type: Plain text
6771 #: build/C/man2/signalfd.2:229
6772 msgid ""
6773 "After a B<fork>(2), the child inherits a copy of the signalfd file "
6774 "descriptor.  A B<read>(2)  from the file descriptor in the child will return "
6775 "information about signals queued to the child."
6776 msgstr ""
6777
6778 #. type: SS
6779 #: build/C/man2/signalfd.2:229 build/C/man2/timerfd_create.2:281
6780 #, no-wrap
6781 msgid "execve(2) semantics"
6782 msgstr ""
6783
6784 #. type: Plain text
6785 #: build/C/man2/signalfd.2:241
6786 msgid ""
6787 "Just like any other file descriptor, a signalfd file descriptor remains open "
6788 "across an B<execve>(2), unless it has been marked for close-on-exec (see "
6789 "B<fcntl>(2)).  Any signals that were available for reading before the "
6790 "B<execve>(2)  remain available to the newly loaded program.  (This is "
6791 "analogous to traditional signal semantics, where a blocked signal that is "
6792 "pending remains pending across an B<execve>(2).)"
6793 msgstr ""
6794
6795 #. type: SS
6796 #: build/C/man2/signalfd.2:241
6797 #, no-wrap
6798 msgid "Thread semantics"
6799 msgstr ""
6800
6801 #. type: Plain text
6802 #: build/C/man2/signalfd.2:251
6803 msgid ""
6804 "The semantics of signalfd file descriptors in a multithreaded program mirror "
6805 "the standard semantics for signals.  In other words, when a thread reads "
6806 "from a signalfd file descriptor, it will read the signals that are directed "
6807 "to the thread itself and the signals that are directed to the process (i.e., "
6808 "the entire thread group).  (A thread will not be able to read signals that "
6809 "are directed to other threads in the process.)"
6810 msgstr ""
6811
6812 #. type: Plain text
6813 #: build/C/man2/signalfd.2:265
6814 msgid ""
6815 "On success, B<signalfd>()  returns a signalfd file descriptor; this is "
6816 "either a new file descriptor (if I<fd> was -1), or I<fd> if I<fd> was a "
6817 "valid signalfd file descriptor.  On error, -1 is returned and I<errno> is "
6818 "set to indicate the error."
6819 msgstr ""
6820
6821 #. type: TP
6822 #: build/C/man2/signalfd.2:266 build/C/man2/timerfd_create.2:338
6823 #, no-wrap
6824 msgid "B<EBADF>"
6825 msgstr ""
6826
6827 #. type: Plain text
6828 #: build/C/man2/signalfd.2:271
6829 msgid "The I<fd> file descriptor is not a valid file descriptor."
6830 msgstr ""
6831
6832 #.  or, the
6833 #.  .I sizemask
6834 #.  argument is not equal to
6835 #.  .IR sizeof(sigset_t) ;
6836 #. type: Plain text
6837 #: build/C/man2/signalfd.2:279
6838 msgid "I<fd> is not a valid signalfd file descriptor."
6839 msgstr ""
6840
6841 #. type: Plain text
6842 #: build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:320
6843 msgid "I<flags> is invalid; or, in Linux 2.6.26 or earlier, I<flags> is nonzero."
6844 msgstr ""
6845
6846 #. type: Plain text
6847 #: build/C/man2/signalfd.2:289 build/C/man2/timerfd_create.2:323
6848 msgid "The per-process limit of open file descriptors has been reached."
6849 msgstr ""
6850
6851 #. type: Plain text
6852 #: build/C/man2/signalfd.2:299
6853 msgid "There was insufficient memory to create a new signalfd file descriptor."
6854 msgstr ""
6855
6856 #.  signalfd() is in glibc 2.7, but reportedly does not build
6857 #. type: Plain text
6858 #: build/C/man2/signalfd.2:307
6859 msgid ""
6860 "B<signalfd>()  is available on Linux since kernel 2.6.22.  Working support "
6861 "is provided in glibc since version 2.8.  The B<signalfd4>()  system call "
6862 "(see NOTES) is available on Linux since kernel 2.6.27."
6863 msgstr ""
6864
6865 #. type: Plain text
6866 #: build/C/man2/signalfd.2:312
6867 msgid "B<signalfd>()  and B<signalfd4>()  are Linux-specific."
6868 msgstr ""
6869
6870 #. type: Plain text
6871 #: build/C/man2/signalfd.2:322
6872 msgid ""
6873 "The underlying Linux system call requires an additional argument, I<size_t "
6874 "sizemask>, which specifies the size of the I<mask> argument.  The glibc "
6875 "B<signalfd>()  wrapper function does not include this argument, since it "
6876 "provides the required value for the underlying system call."
6877 msgstr ""
6878
6879 #. type: Plain text
6880 #: build/C/man2/signalfd.2:336
6881 msgid ""
6882 "A process can create multiple signalfd file descriptors.  This makes it "
6883 "possible to accept different signals on different file descriptors.  (This "
6884 "may be useful if monitoring the file descriptors using B<select>(2), "
6885 "B<poll>(2), or B<epoll>(7): the arrival of different signals will make "
6886 "different descriptors ready.)  If a signal appears in the I<mask> of more "
6887 "than one of the file descriptors, then occurrences of that signal can be "
6888 "read (once) from any one of the descriptors."
6889 msgstr ""
6890
6891 #. type: Plain text
6892 #: build/C/man2/signalfd.2:352
6893 msgid ""
6894 "There are two underlying Linux system calls: B<signalfd>()  and the more "
6895 "recent B<signalfd4>().  The former system call does not implement a I<flags> "
6896 "argument.  The latter system call implements the I<flags> values described "
6897 "above.  Starting with glibc 2.9, the B<signalfd>()  wrapper function will "
6898 "use B<signalfd4>()  where it is available."
6899 msgstr ""
6900
6901 #.  The fix also was put into 2.6.24.5
6902 #. type: Plain text
6903 #: build/C/man2/signalfd.2:360
6904 msgid ""
6905 "In kernels before 2.6.25, the I<ssi_ptr> and I<ssi_int> fields are not "
6906 "filled in with the data accompanying a signal sent by B<sigqueue>(3)."
6907 msgstr ""
6908
6909 #. type: Plain text
6910 #: build/C/man2/signalfd.2:370
6911 msgid ""
6912 "The program below accepts the signals B<SIGINT> and B<SIGQUIT> via a "
6913 "signalfd file descriptor.  The program terminates after accepting a "
6914 "B<SIGQUIT> signal.  The following shell session demonstrates the use of the "
6915 "program:"
6916 msgstr ""
6917
6918 #. type: Plain text
6919 #: build/C/man2/signalfd.2:381
6920 #, no-wrap
6921 msgid ""
6922 "$B< ./signalfd_demo>\n"
6923 "B<^C>                   # Control-C generates SIGINT\n"
6924 "Got SIGINT\n"
6925 "B<^C>\n"
6926 "Got SIGINT\n"
6927 "B<^\\e>                    # Control-\\e generates SIGQUIT\n"
6928 "Got SIGQUIT\n"
6929 "$\n"
6930 msgstr ""
6931
6932 #. type: Plain text
6933 #: build/C/man2/signalfd.2:391
6934 #, no-wrap
6935 msgid ""
6936 "#include E<lt>sys/signalfd.hE<gt>\n"
6937 "#include E<lt>signal.hE<gt>\n"
6938 "#include E<lt>unistd.hE<gt>\n"
6939 "#include E<lt>stdlib.hE<gt>\n"
6940 "#include E<lt>stdio.hE<gt>\n"
6941 msgstr ""
6942
6943 #. type: Plain text
6944 #: build/C/man2/signalfd.2:402
6945 #, no-wrap
6946 msgid ""
6947 "int\n"
6948 "main(int argc, char *argv[])\n"
6949 "{\n"
6950 "    sigset_t mask;\n"
6951 "    int sfd;\n"
6952 "    struct signalfd_siginfo fdsi;\n"
6953 "    ssize_t s;\n"
6954 msgstr ""
6955
6956 #. type: Plain text
6957 #: build/C/man2/signalfd.2:406
6958 #, no-wrap
6959 msgid ""
6960 "    sigemptyset(&mask);\n"
6961 "    sigaddset(&mask, SIGINT);\n"
6962 "    sigaddset(&mask, SIGQUIT);\n"
6963 msgstr ""
6964
6965 #. type: Plain text
6966 #: build/C/man2/signalfd.2:409
6967 #, no-wrap
6968 msgid ""
6969 "    /* Block signals so that they aren\\(aqt handled\n"
6970 "       according to their default dispositions */\n"
6971 msgstr ""
6972
6973 #. type: Plain text
6974 #: build/C/man2/signalfd.2:412
6975 #, no-wrap
6976 msgid ""
6977 "    if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1)\n"
6978 "        handle_error(\"sigprocmask\");\n"
6979 msgstr ""
6980
6981 #. type: Plain text
6982 #: build/C/man2/signalfd.2:416
6983 #, no-wrap
6984 msgid ""
6985 "    sfd = signalfd(-1, &mask, 0);\n"
6986 "    if (sfd == -1)\n"
6987 "        handle_error(\"signalfd\");\n"
6988 msgstr ""
6989
6990 #. type: Plain text
6991 #: build/C/man2/signalfd.2:421
6992 #, no-wrap
6993 msgid ""
6994 "    for (;;) {\n"
6995 "        s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo));\n"
6996 "        if (s != sizeof(struct signalfd_siginfo))\n"
6997 "            handle_error(\"read\");\n"
6998 msgstr ""
6999
7000 #. type: Plain text
7001 #: build/C/man2/signalfd.2:432
7002 #, no-wrap
7003 msgid ""
7004 "        if (fdsi.ssi_signo == SIGINT) {\n"
7005 "            printf(\"Got SIGINT\\en\");\n"
7006 "        } else if (fdsi.ssi_signo == SIGQUIT) {\n"
7007 "            printf(\"Got SIGQUIT\\en\");\n"
7008 "            exit(EXIT_SUCCESS);\n"
7009 "        } else {\n"
7010 "            printf(\"Read unexpected signal\\en\");\n"
7011 "        }\n"
7012 "    }\n"
7013 "}\n"
7014 msgstr ""
7015
7016 #. type: Plain text
7017 #: build/C/man2/signalfd.2:446
7018 msgid ""
7019 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<sigaction>(2), "
7020 "B<sigprocmask>(2), B<sigwaitinfo>(2), B<timerfd_create>(2), B<sigsetops>(3), "
7021 "B<sigwait>(3), B<epoll>(7), B<signal>(7)"
7022 msgstr ""
7023
7024 #. type: TH
7025 #: build/C/man3/sigpause.3:25
7026 #, no-wrap
7027 msgid "SIGPAUSE"
7028 msgstr ""
7029
7030 #. type: TH
7031 #: build/C/man3/sigpause.3:25
7032 #, no-wrap
7033 msgid "2010-09-12"
7034 msgstr ""
7035
7036 #. type: Plain text
7037 #: build/C/man3/sigpause.3:28
7038 msgid "sigpause - atomically release blocked signals and wait for interrupt"
7039 msgstr ""
7040
7041 #. type: Plain text
7042 #: build/C/man3/sigpause.3:33
7043 #, no-wrap
7044 msgid "B<int sigpause(int >I<sigmask>B<);  /* BSD */>\n"
7045 msgstr ""
7046
7047 #. type: Plain text
7048 #: build/C/man3/sigpause.3:35
7049 #, no-wrap
7050 msgid "B<int sigpause(int >I<sig>B<);      /* System V / UNIX 95 */>\n"
7051 msgstr ""
7052
7053 #. type: Plain text
7054 #: build/C/man3/sigpause.3:41
7055 msgid "Don't use this function.  Use B<sigsuspend>(2)  instead."
7056 msgstr ""
7057
7058 #. type: Plain text
7059 #: build/C/man3/sigpause.3:48
7060 msgid ""
7061 "The function B<sigpause>()  is designed to wait for some signal.  It changes "
7062 "the process's signal mask (set of blocked signals), and then waits for a "
7063 "signal to arrive.  Upon arrival of a signal, the original signal mask is "
7064 "restored."
7065 msgstr ""
7066
7067 #. type: Plain text
7068 #: build/C/man3/sigpause.3:56
7069 msgid ""
7070 "If B<sigpause>()  returns, it was interrupted by a signal and the return "
7071 "value is -1 with I<errno> set to B<EINTR>."
7072 msgstr ""
7073
7074 #. type: Plain text
7075 #: build/C/man3/sigpause.3:60
7076 msgid "The System V version of B<sigpause>()  is standardized in POSIX.1-2001."
7077 msgstr ""
7078
7079 #.  __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
7080 #. type: Plain text
7081 #: build/C/man3/sigpause.3:77
7082 msgid ""
7083 "The classical BSD version of this function appeared in 4.2BSD.  It sets the "
7084 "process's signal mask to I<sigmask>.  UNIX 95 standardized the incompatible "
7085 "System V version of this function, which removes only the specified signal "
7086 "I<sig> from the process's signal mask.  The unfortunate situation with two "
7087 "incompatible functions with the same name was solved by the "
7088 "B<\\%sigsuspend>(2)  function, that takes a I<sigset_t\\ *> argument "
7089 "(instead of an I<int>)."
7090 msgstr ""
7091
7092 #. type: Plain text
7093 #: build/C/man3/sigpause.3:80
7094 msgid ""
7095 "On Linux, this routine is a system call only on the Sparc (sparc64)  "
7096 "architecture."
7097 msgstr ""
7098
7099 #. type: Plain text
7100 #: build/C/man3/sigpause.3:82
7101 msgid "Libc4 and libc5 know only about the BSD version."
7102 msgstr ""
7103
7104 #
7105 #.  For the BSD version, one usually uses a zero
7106 #.  .I sigmask
7107 #.  to indicate that no signals are to be blocked.
7108 #. type: Plain text
7109 #: build/C/man3/sigpause.3:98
7110 msgid ""
7111 "Glibc uses the BSD version if the B<_BSD_SOURCE> feature test macro is "
7112 "defined and none of B<_POSIX_SOURCE>, B<_POSIX_C_SOURCE>, B<_XOPEN_SOURCE>, "
7113 "B<_GNU_SOURCE>, or B<_SVID_SOURCE> is defined.  Otherwise, the System V "
7114 "version is used."
7115 msgstr ""
7116
7117 #. type: Plain text
7118 #: build/C/man3/sigpause.3:106
7119 msgid ""
7120 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<sigsuspend>(2), "
7121 "B<sigblock>(3), B<sigvec>(3), B<feature_test_macros>(7)"
7122 msgstr ""
7123
7124 #. type: TH
7125 #: build/C/man2/sigpending.2:29
7126 #, no-wrap
7127 msgid "SIGPENDING"
7128 msgstr ""
7129
7130 #. type: Plain text
7131 #: build/C/man2/sigpending.2:32
7132 msgid "sigpending - examine pending signals"
7133 msgstr ""
7134
7135 #. type: Plain text
7136 #: build/C/man2/sigpending.2:36
7137 msgid "B<int sigpending(sigset_t *>I<set>B<);>"
7138 msgstr ""
7139
7140 #. type: Plain text
7141 #: build/C/man2/sigpending.2:45
7142 msgid ""
7143 "B<sigpending>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7144 "_POSIX_SOURCE"
7145 msgstr ""
7146
7147 #. type: Plain text
7148 #: build/C/man2/sigpending.2:53
7149 msgid ""
7150 "B<sigpending>()  returns the set of signals that are pending for delivery to "
7151 "the calling thread (i.e., the signals which have been raised while "
7152 "blocked).  The mask of pending signals is returned in I<set>."
7153 msgstr ""
7154
7155 #. type: Plain text
7156 #: build/C/man2/sigpending.2:59
7157 msgid ""
7158 "B<sigpending>()  returns 0 on success and -1 on error.  In the event of an "
7159 "error, I<errno> is set to indicate the cause."
7160 msgstr ""
7161
7162 #. type: Plain text
7163 #: build/C/man2/sigpending.2:64
7164 msgid ""
7165 "I<set> points to memory which is not a valid part of the process address "
7166 "space."
7167 msgstr ""
7168
7169 #. type: Plain text
7170 #: build/C/man2/sigpending.2:75
7171 msgid ""
7172 "The set of signals that is pending for a thread is the union of the set of "
7173 "signals that is pending for that thread and the set of signals that is "
7174 "pending for the process as a whole; see B<signal>(7)."
7175 msgstr ""
7176
7177 #. type: Plain text
7178 #: build/C/man2/sigpending.2:87
7179 msgid ""
7180 "In versions of glibc up to and including 2.2.1, there is a bug in the "
7181 "wrapper function for B<sigpending>()  which means that information about "
7182 "pending real-time signals is not correctly returned."
7183 msgstr ""
7184
7185 #. type: Plain text
7186 #: build/C/man2/sigpending.2:95
7187 msgid ""
7188 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7189 "B<sigsuspend>(2), B<sigsetops>(3), B<signal>(7)"
7190 msgstr ""
7191
7192 #. type: TH
7193 #: build/C/man2/sigprocmask.2:29
7194 #, no-wrap
7195 msgid "SIGPROCMASK"
7196 msgstr ""
7197
7198 #. type: Plain text
7199 #: build/C/man2/sigprocmask.2:32
7200 msgid "sigprocmask - examine and change blocked signals"
7201 msgstr ""
7202
7203 #. type: Plain text
7204 #: build/C/man2/sigprocmask.2:37
7205 msgid ""
7206 "B<int sigprocmask(int >I<how>B<, const sigset_t *>I<set>B<,> B<sigset_t "
7207 "*>I<oldset>B<);>"
7208 msgstr ""
7209
7210 #. type: Plain text
7211 #: build/C/man2/sigprocmask.2:46
7212 msgid ""
7213 "B<sigprocmask>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7214 "_POSIX_SOURCE"
7215 msgstr ""
7216
7217 #. type: Plain text
7218 #: build/C/man2/sigprocmask.2:55
7219 msgid ""
7220 "B<sigprocmask>()  is used to fetch and/or change the signal mask of the "
7221 "calling thread.  The signal mask is the set of signals whose delivery is "
7222 "currently blocked for the caller (see also B<signal>(7)  for more details)."
7223 msgstr ""
7224
7225 #. type: Plain text
7226 #: build/C/man2/sigprocmask.2:59
7227 msgid "The behavior of the call is dependent on the value of I<how>, as follows."
7228 msgstr ""
7229
7230 #. type: TP
7231 #: build/C/man2/sigprocmask.2:59
7232 #, no-wrap
7233 msgid "B<SIG_BLOCK>"
7234 msgstr ""
7235
7236 #. type: Plain text
7237 #: build/C/man2/sigprocmask.2:64
7238 msgid ""
7239 "The set of blocked signals is the union of the current set and the I<set> "
7240 "argument."
7241 msgstr ""
7242
7243 #. type: TP
7244 #: build/C/man2/sigprocmask.2:64
7245 #, no-wrap
7246 msgid "B<SIG_UNBLOCK>"
7247 msgstr ""
7248
7249 #. type: Plain text
7250 #: build/C/man2/sigprocmask.2:70
7251 msgid ""
7252 "The signals in I<set> are removed from the current set of blocked signals.  "
7253 "It is permissible to attempt to unblock a signal which is not blocked."
7254 msgstr ""
7255
7256 #. type: TP
7257 #: build/C/man2/sigprocmask.2:70
7258 #, no-wrap
7259 msgid "B<SIG_SETMASK>"
7260 msgstr ""
7261
7262 #. type: Plain text
7263 #: build/C/man2/sigprocmask.2:74
7264 msgid "The set of blocked signals is set to the argument I<set>."
7265 msgstr ""
7266
7267 #. type: Plain text
7268 #: build/C/man2/sigprocmask.2:79
7269 msgid ""
7270 "If I<oldset> is non-NULL, the previous value of the signal mask is stored in "
7271 "I<oldset>."
7272 msgstr ""
7273
7274 #. type: Plain text
7275 #: build/C/man2/sigprocmask.2:88
7276 msgid ""
7277 "If I<set> is NULL, then the signal mask is unchanged (i.e., I<how> is "
7278 "ignored), but the current value of the signal mask is nevertheless returned "
7279 "in I<oldset> (if it is not NULL)."
7280 msgstr ""
7281
7282 #. type: Plain text
7283 #: build/C/man2/sigprocmask.2:93
7284 msgid ""
7285 "The use of B<sigprocmask>()  is unspecified in a multithreaded process; see "
7286 "B<pthread_sigmask>(3)."
7287 msgstr ""
7288
7289 #. type: Plain text
7290 #: build/C/man2/sigprocmask.2:99
7291 msgid ""
7292 "B<sigprocmask>()  returns 0 on success and -1 on error.  In the event of an "
7293 "error, I<errno> is set to indicate the cause."
7294 msgstr ""
7295
7296 #. type: Plain text
7297 #: build/C/man2/sigprocmask.2:107
7298 msgid ""
7299 "the I<set> or I<oldset> argument points outside the process's allocated "
7300 "address space."
7301 msgstr ""
7302
7303 #. type: Plain text
7304 #: build/C/man2/sigprocmask.2:112
7305 msgid "The value specified in I<how> was invalid."
7306 msgstr ""
7307
7308 #. type: Plain text
7309 #: build/C/man2/sigprocmask.2:118
7310 msgid ""
7311 "It is not possible to block B<SIGKILL> or B<SIGSTOP>.  Attempts to do so are "
7312 "silently ignored."
7313 msgstr ""
7314
7315 #. type: Plain text
7316 #: build/C/man2/sigprocmask.2:120
7317 msgid "Each of the threads in a process has its own signal mask."
7318 msgstr ""
7319
7320 #. type: Plain text
7321 #: build/C/man2/sigprocmask.2:140
7322 msgid ""
7323 "If B<SIGBUS>, B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> are generated while they "
7324 "are blocked, the result is undefined, unless the signal was generated by "
7325 "B<kill>(2), B<sigqueue>(3), or B<raise>(3)."
7326 msgstr ""
7327
7328 #. type: Plain text
7329 #: build/C/man2/sigprocmask.2:155
7330 msgid ""
7331 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigpending>(2), "
7332 "B<sigsuspend>(2), B<pthread_sigmask>(3), B<sigqueue>(3), B<sigsetops>(3), "
7333 "B<signal>(7)"
7334 msgstr ""
7335
7336 #. type: TH
7337 #: build/C/man3/sigqueue.3:28
7338 #, no-wrap
7339 msgid "SIGQUEUE"
7340 msgstr ""
7341
7342 #. type: TH
7343 #: build/C/man3/sigqueue.3:28
7344 #, no-wrap
7345 msgid "2012-03-25"
7346 msgstr ""
7347
7348 #. type: Plain text
7349 #: build/C/man3/sigqueue.3:31
7350 msgid "sigqueue - queue a signal and data to a process"
7351 msgstr ""
7352
7353 #. type: Plain text
7354 #: build/C/man3/sigqueue.3:35
7355 msgid ""
7356 "B<int sigqueue(pid_t >I<pid>B<, int >I<sig>B<, const union sigval "
7357 ">I<value>B<);>"
7358 msgstr ""
7359
7360 #. type: Plain text
7361 #: build/C/man3/sigqueue.3:43
7362 msgid "B<sigqueue>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
7363 msgstr ""
7364
7365 #. type: Plain text
7366 #: build/C/man3/sigqueue.3:55
7367 msgid ""
7368 "B<sigqueue>()  sends the signal specified in I<sig> to the process whose PID "
7369 "is given in I<pid>.  The permissions required to send a signal are the same "
7370 "as for B<kill>(2).  As with B<kill>(2), the null signal (0) can be used to "
7371 "check if a process with a given PID exists."
7372 msgstr ""
7373
7374 #. type: Plain text
7375 #: build/C/man3/sigqueue.3:60
7376 msgid ""
7377 "The I<value> argument is used to specify an accompanying item of data "
7378 "(either an integer or a pointer value) to be sent with the signal, and has "
7379 "the following type:"
7380 msgstr ""
7381
7382 #. type: Plain text
7383 #: build/C/man3/sigqueue.3:67
7384 #, no-wrap
7385 msgid ""
7386 "union sigval {\n"
7387 "    int   sival_int;\n"
7388 "    void *sival_ptr;\n"
7389 "};\n"
7390 msgstr ""
7391
7392 #. type: Plain text
7393 #: build/C/man3/sigqueue.3:83
7394 msgid ""
7395 "If the receiving process has installed a handler for this signal using the "
7396 "B<SA_SIGINFO> flag to B<sigaction>(2), then it can obtain this data via the "
7397 "I<si_value> field of the I<siginfo_t> structure passed as the second "
7398 "argument to the handler.  Furthermore, the I<si_code> field of that "
7399 "structure will be set to B<SI_QUEUE>."
7400 msgstr ""
7401
7402 #. type: Plain text
7403 #: build/C/man3/sigqueue.3:91
7404 msgid ""
7405 "On success, B<sigqueue>()  returns 0, indicating that the signal was "
7406 "successfully queued to the receiving process.  Otherwise -1 is returned and "
7407 "I<errno> is set to indicate the error."
7408 msgstr ""
7409
7410 #. type: Plain text
7411 #: build/C/man3/sigqueue.3:102
7412 msgid "I<sig> was invalid."
7413 msgstr ""
7414
7415 #. type: Plain text
7416 #: build/C/man3/sigqueue.3:108
7417 msgid ""
7418 "The process does not have permission to send the signal to the receiving "
7419 "process.  For the required permissions, see B<kill>(2)."
7420 msgstr ""
7421
7422 #. type: Plain text
7423 #: build/C/man3/sigqueue.3:112
7424 msgid "No process has a PID matching I<pid>."
7425 msgstr ""
7426
7427 #. type: Plain text
7428 #: build/C/man3/sigqueue.3:114
7429 msgid "This system call first appeared in Linux 2.2."
7430 msgstr ""
7431
7432 #. type: Plain text
7433 #: build/C/man3/sigqueue.3:124
7434 msgid ""
7435 "If this function results in the sending of a signal to the process that "
7436 "invoked it, and that signal was not blocked by the calling thread, and no "
7437 "other threads were willing to handle this signal (either by having it "
7438 "unblocked, or by waiting for it using B<sigwait>(3)), then at least some "
7439 "signal must be delivered to this thread before this function returns."
7440 msgstr ""
7441
7442 #. type: Plain text
7443 #: build/C/man3/sigqueue.3:139
7444 msgid ""
7445 "On Linux, this function is implemented using the B<rt_sigqueueinfo>(2)  "
7446 "system call.  The system call differs in its third argument, which is the "
7447 "I<siginfo_t> structure that will be supplied to the receiving process's "
7448 "signal handler or returned by the receiving process's B<sigtimedwait>(2)  "
7449 "call.  Inside the glibc B<sigqueue>()  wrapper, this argument, I<uinfo>, is "
7450 "initialized as follows:"
7451 msgstr ""
7452
7453 #. type: Plain text
7454 #: build/C/man3/sigqueue.3:147
7455 #, no-wrap
7456 msgid ""
7457 "uinfo.si_signo = sig;      /* argument supplied to sigqueue() */\n"
7458 "uinfo.si_code = SI_QUEUE;\n"
7459 "uinfo.si_pid = getpid();   /* Process ID of sender */\n"
7460 "uinfo.si_uid = getuid();   /* Real UID of sender */\n"
7461 "uinfo.si_value = val;      /* argument supplied to sigqueue() */\n"
7462 msgstr ""
7463
7464 #. type: Plain text
7465 #: build/C/man3/sigqueue.3:157
7466 msgid ""
7467 "B<kill>(2), B<rt_sigqueueinfo>(2), B<sigaction>(2), B<signal>(2), "
7468 "B<pthread_sigqueue>(3), B<sigwait>(3), B<signal>(7)"
7469 msgstr ""
7470
7471 #. type: TH
7472 #: build/C/man2/sigreturn.2:29
7473 #, no-wrap
7474 msgid "SIGRETURN"
7475 msgstr ""
7476
7477 #. type: Plain text
7478 #: build/C/man2/sigreturn.2:32
7479 msgid "sigreturn - return from signal handler and cleanup stack frame"
7480 msgstr ""
7481
7482 #. type: Plain text
7483 #: build/C/man2/sigreturn.2:34
7484 msgid "B<int sigreturn(unsigned long >I<__unused>B<);>"
7485 msgstr ""
7486
7487 #. type: Plain text
7488 #: build/C/man2/sigreturn.2:42
7489 msgid ""
7490 "When the Linux kernel creates the stack frame for a signal handler, a call "
7491 "to B<sigreturn>()  is inserted into the stack frame so that upon return from "
7492 "the signal handler, B<sigreturn>()  will be called."
7493 msgstr ""
7494
7495 #. type: Plain text
7496 #: build/C/man2/sigreturn.2:53
7497 msgid ""
7498 "This B<sigreturn>()  call undoes everything that was done\\(emchanging the "
7499 "process's signal mask, switching stacks (see B<sigaltstack>(2))\\(emin order "
7500 "to invoke the signal handler: it restores the process's signal mask, "
7501 "switches stacks, and restores the process's context (registers, processor "
7502 "flags), so that the process directly resumes execution at the point where it "
7503 "was interrupted by the signal."
7504 msgstr ""
7505
7506 #. type: Plain text
7507 #: build/C/man2/sigreturn.2:56
7508 msgid "B<sigreturn>()  never returns."
7509 msgstr ""
7510
7511 #. type: SH
7512 #: build/C/man2/sigreturn.2:56
7513 #, no-wrap
7514 msgid "FILES"
7515 msgstr ""
7516
7517 #. type: Plain text
7518 #: build/C/man2/sigreturn.2:58
7519 msgid "/usr/src/linux/arch/i386/kernel/signal.c"
7520 msgstr ""
7521
7522 #. type: Plain text
7523 #: build/C/man2/sigreturn.2:60
7524 msgid "/usr/src/linux/arch/alpha/kernel/entry.S"
7525 msgstr ""
7526
7527 #. type: Plain text
7528 #: build/C/man2/sigreturn.2:64
7529 msgid ""
7530 "B<sigreturn>()  is specific to Linux and should not be used in programs "
7531 "intended to be portable."
7532 msgstr ""
7533
7534 #. type: Plain text
7535 #: build/C/man2/sigreturn.2:74
7536 msgid ""
7537 "The B<sigreturn>()  call is used by the kernel to implement signal "
7538 "handlers.  It should B<never> be called directly.  Better yet, the specific "
7539 "use of the I<__unused> argument varies depending on the architecture."
7540 msgstr ""
7541
7542 #. type: Plain text
7543 #: build/C/man2/sigreturn.2:80
7544 msgid ""
7545 "B<kill>(2), B<restart_syscall>(2), B<sigaltstack>(2), B<signal>(2), "
7546 "B<signal>(7)"
7547 msgstr ""
7548
7549 #. type: TH
7550 #: build/C/man3/sigset.3:26
7551 #, no-wrap
7552 msgid "SIGSET"
7553 msgstr ""
7554
7555 #. type: Plain text
7556 #: build/C/man3/sigset.3:29
7557 msgid "sigset, sighold, sigrelse, sigignore - System V signal API"
7558 msgstr ""
7559
7560 #. type: Plain text
7561 #: build/C/man3/sigset.3:35
7562 msgid "B<sighandler_t sigset(int >I<sig>B<, sighandler_t >I<disp>B<);>"
7563 msgstr ""
7564
7565 #. type: Plain text
7566 #: build/C/man3/sigset.3:37
7567 msgid "B<int sighold(int >I<sig>B<);>"
7568 msgstr ""
7569
7570 #. type: Plain text
7571 #: build/C/man3/sigset.3:39
7572 msgid "B<int sigrelse(int >I<sig>B<);>"
7573 msgstr ""
7574
7575 #. type: Plain text
7576 #: build/C/man3/sigset.3:41
7577 msgid "B<int sigignore(int >I<sig>B<);>"
7578 msgstr ""
7579
7580 #. type: Plain text
7581 #: build/C/man3/sigset.3:52
7582 msgid "B<sigset>(), B<sighold>(), B<sigrelse>(), B<sigignore>():"
7583 msgstr ""
7584
7585 #. type: Plain text
7586 #: build/C/man3/sigset.3:56
7587 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
7588 msgstr ""
7589
7590 #. type: Plain text
7591 #: build/C/man3/sigset.3:65
7592 msgid ""
7593 "These functions are provided in glibc as a compatibility interface for "
7594 "programs that make use of the historical System V signal API.  This API is "
7595 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
7596 "B<sigprocmask>(2), etc.)"
7597 msgstr ""
7598
7599 #. type: Plain text
7600 #: build/C/man3/sigset.3:74
7601 msgid ""
7602 "The B<sigset>()  function modifies the disposition of the signal I<sig>.  "
7603 "The I<disp> argument can be the address of a signal handler function, or one "
7604 "of the following constants:"
7605 msgstr ""
7606
7607 #. type: TP
7608 #: build/C/man3/sigset.3:74
7609 #, no-wrap
7610 msgid "B<SIG_DFL>"
7611 msgstr ""
7612
7613 #. type: Plain text
7614 #: build/C/man3/sigset.3:79
7615 msgid "Reset the disposition of I<sig> to the default."
7616 msgstr ""
7617
7618 #. type: TP
7619 #: build/C/man3/sigset.3:79
7620 #, no-wrap
7621 msgid "B<SIG_IGN>"
7622 msgstr ""
7623
7624 #. type: Plain text
7625 #: build/C/man3/sigset.3:83
7626 msgid "Ignore I<sig>."
7627 msgstr ""
7628
7629 #. type: TP
7630 #: build/C/man3/sigset.3:83
7631 #, no-wrap
7632 msgid "B<SIG_HOLD>"
7633 msgstr ""
7634
7635 #. type: Plain text
7636 #: build/C/man3/sigset.3:90
7637 msgid ""
7638 "Add I<sig> to the process's signal mask, but leave the disposition of I<sig> "
7639 "unchanged."
7640 msgstr ""
7641
7642 #. type: Plain text
7643 #: build/C/man3/sigset.3:96
7644 msgid ""
7645 "If I<disp> specifies the address of a signal handler, then I<sig> is added "
7646 "to the process's signal mask during execution of the handler."
7647 msgstr ""
7648
7649 #. type: Plain text
7650 #: build/C/man3/sigset.3:104
7651 msgid ""
7652 "If I<disp> was specified as a value other than B<SIG_HOLD>, then I<sig> is "
7653 "removed from the process's signal mask."
7654 msgstr ""
7655
7656 #. type: Plain text
7657 #: build/C/man3/sigset.3:110 build/C/man3/sigvec.3:87
7658 msgid "The dispositions for B<SIGKILL> and B<SIGSTOP> cannot be changed."
7659 msgstr ""
7660
7661 #. type: Plain text
7662 #: build/C/man3/sigset.3:116
7663 msgid "The B<sighold>()  function adds I<sig> to the calling process's signal mask."
7664 msgstr ""
7665
7666 #. type: Plain text
7667 #: build/C/man3/sigset.3:122
7668 msgid ""
7669 "The B<sigrelse>()  function removes I<sig> from the calling process's signal "
7670 "mask."
7671 msgstr ""
7672
7673 #. type: Plain text
7674 #: build/C/man3/sigset.3:129
7675 msgid "The B<sigignore>()  function sets the disposition of I<sig> to B<SIG_IGN>."
7676 msgstr ""
7677
7678 #. type: Plain text
7679 #: build/C/man3/sigset.3:145
7680 msgid ""
7681 "On success, B<sigset>()  returns B<SIG_HOLD> if I<sig> was blocked before "
7682 "the call, or the signal's previous disposition if it was not blocked before "
7683 "the call.  On error, B<sigset>()  returns -1, with I<errno> set to indicate "
7684 "the error.  (But see BUGS below.)"
7685 msgstr ""
7686
7687 #. type: Plain text
7688 #: build/C/man3/sigset.3:154
7689 msgid ""
7690 "The B<sighold>(), B<sigrelse>(), and B<sigignore>()  functions return 0 on "
7691 "success; on error, these functions return -1 and set I<errno> to indicate "
7692 "the error."
7693 msgstr ""
7694
7695 #. type: Plain text
7696 #: build/C/man3/sigset.3:161
7697 msgid ""
7698 "For B<sigset>()  see the ERRORS under B<sigaction>(2)  and "
7699 "B<sigprocmask>(2)."
7700 msgstr ""
7701
7702 #. type: Plain text
7703 #: build/C/man3/sigset.3:168
7704 msgid "For B<sighold>()  and B<sigrelse>()  see the ERRORS under B<sigprocmask>(2)."
7705 msgstr ""
7706
7707 #. type: Plain text
7708 #: build/C/man3/sigset.3:173
7709 msgid "For B<sigignore>(), see the errors under B<sigaction>(2)."
7710 msgstr ""
7711
7712 #. type: Plain text
7713 #: build/C/man3/sigset.3:190
7714 msgid ""
7715 "SVr4, POSIX.1-2001.  These functions are obsolete: do not use them in new "
7716 "programs.  POSIX.1-2008 marks B<sighold>(), B<sigignore>(), B<sigpause>(), "
7717 "B<sigrelse>(), and B<sigset>()  as obsolete, recommending the use of "
7718 "B<sigaction>(2), B<sigprocmask>(2), B<pthread_sigmask>(3), and "
7719 "B<sigsuspend>(2)  instead."
7720 msgstr ""
7721
7722 #. type: Plain text
7723 #: build/C/man3/sigset.3:192
7724 msgid "These functions appeared in glibc version 2.1."
7725 msgstr ""
7726
7727 #. type: Plain text
7728 #: build/C/man3/sigset.3:198
7729 msgid ""
7730 "The I<sighandler_t> type is a GNU extension; it is used on this page only to "
7731 "make the B<sigset>()  prototype more easily readable."
7732 msgstr ""
7733
7734 #. type: Plain text
7735 #: build/C/man3/sigset.3:206
7736 msgid ""
7737 "The B<sigset>()  function provides reliable signal handling semantics (as "
7738 "when calling B<sigaction>(2)  with I<sa_mask> equal to 0)."
7739 msgstr ""
7740
7741 #. type: Plain text
7742 #: build/C/man3/sigset.3:224
7743 msgid ""
7744 "On System V, the B<signal>()  function provides unreliable semantics (as "
7745 "when calling B<sigaction>(2)  with I<sa_mask> equal to I<SA_RESETHAND | "
7746 "SA_NODEFER>).  On BSD, B<signal>()  provides reliable semantics.  "
7747 "POSIX.1-2001 leaves these aspects of B<signal>()  unspecified.  See "
7748 "B<signal>(2)  for further details."
7749 msgstr ""
7750
7751 #. type: Plain text
7752 #: build/C/man3/sigset.3:232 build/C/man3/sigvec.3:252
7753 msgid ""
7754 "In order to wait for a signal, BSD and System V both provided a function "
7755 "named B<sigpause>(3), but this function has a different argument on the two "
7756 "systems.  See B<sigpause>(3)  for details."
7757 msgstr ""
7758
7759 #. type: Plain text
7760 #: build/C/man3/sigset.3:241
7761 msgid ""
7762 "In versions of glibc before 2.2, B<sigset>()  did not unblock I<sig> if "
7763 "I<disp> was specified as a value other than B<SIG_HOLD>."
7764 msgstr ""
7765
7766 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
7767 #. type: Plain text
7768 #: build/C/man3/sigset.3:266
7769 msgid ""
7770 "In versions of glibc before 2.5, B<sigset>()  does not correctly return the "
7771 "previous disposition of the signal in two cases.  First, if I<disp> is "
7772 "specified as B<SIG_HOLD>, then a successful B<sigset>()  always returns "
7773 "B<SIG_HOLD>.  Instead, it should return the previous disposition of the "
7774 "signal (unless the signal was blocked, in which case B<SIG_HOLD> should be "
7775 "returned).  Second, if the signal is currently blocked, then the return "
7776 "value of a successful B<sigset>()  should be B<SIG_HOLD>.  Instead, the "
7777 "previous disposition of the signal is returned.  These problems have been "
7778 "fixed since glibc 2.5."
7779 msgstr ""
7780
7781 #. type: Plain text
7782 #: build/C/man3/sigset.3:276
7783 msgid ""
7784 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7785 "B<raise>(3), B<sigpause>(3), B<sigvec>(3), B<signal>(7)"
7786 msgstr ""
7787
7788 #. type: TH
7789 #: build/C/man3/sigsetops.3:31
7790 #, no-wrap
7791 msgid "SIGSETOPS"
7792 msgstr ""
7793
7794 #. type: Plain text
7795 #: build/C/man3/sigsetops.3:35
7796 msgid ""
7797 "sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX signal "
7798 "set operations."
7799 msgstr ""
7800
7801 #. type: Plain text
7802 #: build/C/man3/sigsetops.3:39
7803 msgid "B<int sigemptyset(sigset_t *>I<set>B<);>"
7804 msgstr ""
7805
7806 #. type: Plain text
7807 #: build/C/man3/sigsetops.3:41
7808 msgid "B<int sigfillset(sigset_t *>I<set>B<);>"
7809 msgstr ""
7810
7811 #. type: Plain text
7812 #: build/C/man3/sigsetops.3:43
7813 msgid "B<int sigaddset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7814 msgstr ""
7815
7816 #. type: Plain text
7817 #: build/C/man3/sigsetops.3:45
7818 msgid "B<int sigdelset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7819 msgstr ""
7820
7821 #. type: Plain text
7822 #: build/C/man3/sigsetops.3:47
7823 msgid "B<int sigismember(const sigset_t *>I<set>B<, int >I<signum>B<);>"
7824 msgstr ""
7825
7826 #. type: Plain text
7827 #: build/C/man3/sigsetops.3:59
7828 msgid ""
7829 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), B<sigdelset>(), "
7830 "B<sigismember>():"
7831 msgstr ""
7832
7833 #. type: Plain text
7834 #: build/C/man3/sigsetops.3:61
7835 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
7836 msgstr ""
7837
7838 #. type: Plain text
7839 #: build/C/man3/sigsetops.3:65
7840 msgid "These functions allow the manipulation of POSIX signal sets."
7841 msgstr ""
7842
7843 #. type: Plain text
7844 #: build/C/man3/sigsetops.3:70
7845 msgid ""
7846 "B<sigemptyset>()  initializes the signal set given by I<set> to empty, with "
7847 "all signals excluded from the set."
7848 msgstr ""
7849
7850 #. type: Plain text
7851 #: build/C/man3/sigsetops.3:75
7852 msgid "B<sigfillset>()  initializes I<set> to full, including all signals."
7853 msgstr ""
7854
7855 #. type: Plain text
7856 #: build/C/man3/sigsetops.3:83
7857 msgid ""
7858 "B<sigaddset>()  and B<sigdelset>()  add and delete respectively signal "
7859 "I<signum> from I<set>."
7860 msgstr ""
7861
7862 #. type: Plain text
7863 #: build/C/man3/sigsetops.3:89
7864 msgid "B<sigismember>()  tests whether I<signum> is a member of I<set>."
7865 msgstr ""
7866
7867 #. type: Plain text
7868 #: build/C/man3/sigsetops.3:107
7869 msgid ""
7870 "Objects of type I<sigset_t> must be initialized by a call to either "
7871 "B<sigemptyset>()  or B<sigfillset>()  before being passed to the functions "
7872 "B<sigaddset>(), B<sigdelset>()  and B<sigismember>()  or the additional "
7873 "glibc functions described below (B<sigisemptyset>(), B<sigandset>(), and "
7874 "B<sigorset>()).  The results are undefined if this is not done."
7875 msgstr ""
7876
7877 #. type: Plain text
7878 #: build/C/man3/sigsetops.3:114
7879 msgid ""
7880 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), and B<sigdelset>()  "
7881 "return 0 on success and -1 on error."
7882 msgstr ""
7883
7884 #. type: Plain text
7885 #: build/C/man3/sigsetops.3:126
7886 msgid ""
7887 "B<sigismember>()  returns 1 if I<signum> is a member of I<set>, 0 if "
7888 "I<signum> is not a member, and -1 on error.  On error, these functions set "
7889 "I<errno> to indicate the cause."
7890 msgstr ""
7891
7892 #. type: Plain text
7893 #: build/C/man3/sigsetops.3:131
7894 msgid "I<sig> is not a valid signal."
7895 msgstr ""
7896
7897 #. type: SS
7898 #: build/C/man3/sigsetops.3:134
7899 #, no-wrap
7900 msgid "Glibc notes"
7901 msgstr ""
7902
7903 #. type: Plain text
7904 #: build/C/man3/sigsetops.3:140
7905 msgid ""
7906 "If the B<_GNU_SOURCE> feature test macro is defined, then "
7907 "I<E<lt>signal.hE<gt>> exposes three other functions for manipulating signal "
7908 "sets."
7909 msgstr ""
7910
7911 #. type: TP
7912 #: build/C/man3/sigsetops.3:140
7913 #, no-wrap
7914 msgid "B<int sigisemptyset(sigset_t *>I<set>B<);>"
7915 msgstr ""
7916
7917 #. type: Plain text
7918 #: build/C/man3/sigsetops.3:145
7919 msgid "returns 1 if I<set> contains no signals, and 0 otherwise."
7920 msgstr ""
7921
7922 #. type: TP
7923 #: build/C/man3/sigsetops.3:145
7924 #, no-wrap
7925 msgid ""
7926 "B<int sigorset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7927 "*>I<right>B<);>"
7928 msgstr ""
7929
7930 #. type: Plain text
7931 #: build/C/man3/sigsetops.3:154
7932 msgid "places the union of the sets I<left> and I<right> in I<dest>."
7933 msgstr ""
7934
7935 #. type: TP
7936 #: build/C/man3/sigsetops.3:154
7937 #, no-wrap
7938 msgid ""
7939 "B<int sigandset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7940 "*>I<right>B<);>"
7941 msgstr ""
7942
7943 #. type: Plain text
7944 #: build/C/man3/sigsetops.3:163
7945 msgid "places the intersection of the sets I<left> and I<right> in I<dest>."
7946 msgstr ""
7947
7948 #. type: Plain text
7949 #: build/C/man3/sigsetops.3:168
7950 msgid "B<sigorset>()  and B<sigandset>()  return 0 on success, and -1 on failure."
7951 msgstr ""
7952
7953 #. type: Plain text
7954 #: build/C/man3/sigsetops.3:171
7955 msgid ""
7956 "These functions are nonstandard (a few other systems provide similar "
7957 "functions) and their use should be avoided in portable applications."
7958 msgstr ""
7959
7960 #. type: Plain text
7961 #: build/C/man3/sigsetops.3:176
7962 msgid "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<sigsuspend>(2)"
7963 msgstr ""
7964
7965 #. type: TH
7966 #: build/C/man2/sigsuspend.2:29
7967 #, no-wrap
7968 msgid "SIGSUSPEND"
7969 msgstr ""
7970
7971 #. type: Plain text
7972 #: build/C/man2/sigsuspend.2:32
7973 msgid "sigsuspend - wait for a signal"
7974 msgstr ""
7975
7976 #. type: Plain text
7977 #: build/C/man2/sigsuspend.2:36
7978 msgid "B<int sigsuspend(const sigset_t *>I<mask>B<);>"
7979 msgstr ""
7980
7981 #. type: Plain text
7982 #: build/C/man2/sigsuspend.2:45
7983 msgid ""
7984 "B<sigsuspend>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7985 "_POSIX_SOURCE"
7986 msgstr ""
7987
7988 #. type: Plain text
7989 #: build/C/man2/sigsuspend.2:53
7990 msgid ""
7991 "B<sigsuspend>()  temporarily replaces the signal mask of the calling process "
7992 "with the mask given by I<mask> and then suspends the process until delivery "
7993 "of a signal whose action is to invoke a signal handler or to terminate a "
7994 "process."
7995 msgstr ""
7996
7997 #. type: Plain text
7998 #: build/C/man2/sigsuspend.2:62
7999 msgid ""
8000 "If the signal terminates the process, then B<sigsuspend>()  does not "
8001 "return.  If the signal is caught, then B<sigsuspend>()  returns after the "
8002 "signal handler returns, and the signal mask is restored to the state before "
8003 "the call to B<sigsuspend>()."
8004 msgstr ""
8005
8006 #. type: Plain text
8007 #: build/C/man2/sigsuspend.2:70
8008 msgid ""
8009 "It is not possible to block B<SIGKILL> or B<SIGSTOP>; specifying these "
8010 "signals in I<mask>, has no effect on the process's signal mask."
8011 msgstr ""
8012
8013 #. type: Plain text
8014 #: build/C/man2/sigsuspend.2:76
8015 msgid ""
8016 "B<sigsuspend>()  always returns -1, with I<errno> set to inndicate the error "
8017 "(normally, B<EINTR>)."
8018 msgstr ""
8019
8020 #. type: Plain text
8021 #: build/C/man2/sigsuspend.2:81
8022 msgid ""
8023 "I<mask> points to memory which is not a valid part of the process address "
8024 "space."
8025 msgstr ""
8026
8027 #. type: Plain text
8028 #: build/C/man2/sigsuspend.2:84
8029 msgid "The call was interrupted by a signal."
8030 msgstr ""
8031
8032 #. type: Plain text
8033 #: build/C/man2/sigsuspend.2:104
8034 msgid ""
8035 "Normally, B<sigsuspend>()  is used in conjunction with B<sigprocmask>(2)  in "
8036 "order to prevent delivery of a signal during the execution of a critical "
8037 "code section.  The caller first blocks the signals with B<sigprocmask>(2).  "
8038 "When the critical code has completed, the caller then waits for the signals "
8039 "by calling B<sigsuspend>()  with the signal mask that was returned by "
8040 "B<sigprocmask>(2)  (in the I<oldset> argument)."
8041 msgstr ""
8042
8043 #. type: Plain text
8044 #: build/C/man2/sigsuspend.2:118
8045 msgid ""
8046 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
8047 "B<sigwaitinfo>(2), B<sigsetops>(3), B<sigwait>(3), B<signal>(7)"
8048 msgstr ""
8049
8050 #. type: TH
8051 #: build/C/man3/sigvec.3:26
8052 #, no-wrap
8053 msgid "SIGVEC"
8054 msgstr ""
8055
8056 #. type: TH
8057 #: build/C/man3/sigvec.3:26
8058 #, no-wrap
8059 msgid "2012-09-06"
8060 msgstr ""
8061
8062 #. type: Plain text
8063 #: build/C/man3/sigvec.3:29
8064 msgid "sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal API"
8065 msgstr ""
8066
8067 #. type: Plain text
8068 #: build/C/man3/sigvec.3:33
8069 msgid ""
8070 "B<int sigvec(int >I<sig>B<, struct sigvec *>I<vec>B<, struct sigvec "
8071 "*>I<ovec>B<);>"
8072 msgstr ""
8073
8074 #. type: Plain text
8075 #: build/C/man3/sigvec.3:35
8076 msgid "B<int sigmask(int >I<signum>B<);>"
8077 msgstr ""
8078
8079 #. type: Plain text
8080 #: build/C/man3/sigvec.3:37
8081 msgid "B<int sigblock(int >I<mask>B<);>"
8082 msgstr ""
8083
8084 #. type: Plain text
8085 #: build/C/man3/sigvec.3:39
8086 msgid "B<int sigsetmask(int >I<mask>B<);>"
8087 msgstr ""
8088
8089 #. type: Plain text
8090 #: build/C/man3/sigvec.3:41
8091 msgid "B<int siggetmask(void);>"
8092 msgstr ""
8093
8094 #. type: Plain text
8095 #: build/C/man3/sigvec.3:49
8096 msgid "All functions shown above: _BSD_SOURCE"
8097 msgstr ""
8098
8099 #. type: Plain text
8100 #: build/C/man3/sigvec.3:56
8101 msgid ""
8102 "These functions are provided in glibc as a compatibility interface for "
8103 "programs that make use of the historical BSD signal API.  This API is "
8104 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
8105 "B<sigprocmask>(2), etc.)."
8106 msgstr ""
8107
8108 #. type: Plain text
8109 #: build/C/man3/sigvec.3:81
8110 msgid ""
8111 "The B<sigvec>()  function sets and/or gets the disposition of the signal "
8112 "I<sig> (like the POSIX B<sigaction>(2)).  If I<vec> is not NULL, it points "
8113 "to a I<sigvec> structure that defines the new disposition for I<sig>.  If "
8114 "I<ovec> is not NULL, it points to a I<sigvec> structure that is used to "
8115 "return the previous disposition of I<sig>.  To obtain the current "
8116 "disposition of I<sig> without changing it, specify NULL for I<vec>, and a "
8117 "non-NULL pointer for I<ovec>."
8118 msgstr ""
8119
8120 #. type: Plain text
8121 #: build/C/man3/sigvec.3:91
8122 msgid "The I<sigvec> structure has the following form:"
8123 msgstr ""
8124
8125 #. type: Plain text
8126 #: build/C/man3/sigvec.3:99
8127 #, no-wrap
8128 msgid ""
8129 "struct sigvec {\n"
8130 "    void (*sv_handler)(int); /* Signal disposition */\n"
8131 "    int    sv_mask;          /* Signals to be blocked in handler */\n"
8132 "    int    sv_flags;         /* Flags */\n"
8133 "};\n"
8134 msgstr ""
8135
8136 #. type: Plain text
8137 #: build/C/man3/sigvec.3:110
8138 msgid ""
8139 "The I<sv_handler> field specifies the disposition of the signal, and is "
8140 "either: the address of a signal handler function; B<SIG_DFL>, meaning the "
8141 "default disposition applies for the signal; or B<SIG_IGN>, meaning that the "
8142 "signal is ignored."
8143 msgstr ""
8144
8145 #. type: Plain text
8146 #: build/C/man3/sigvec.3:124
8147 msgid ""
8148 "If I<sv_handler> specifies the address of a signal handler, then I<sv_mask> "
8149 "specifies a mask of signals that are to be blocked while the handler is "
8150 "executing.  In addition, the signal for which the handler is invoked is also "
8151 "blocked.  Attempts to block B<SIGKILL> or B<SIGSTOP> are silently ignored."
8152 msgstr ""
8153
8154 #. type: Plain text
8155 #: build/C/man3/sigvec.3:131
8156 msgid ""
8157 "If I<sv_handler> specifies the address of a signal handler, then the "
8158 "I<sv_flags> field specifies flags controlling what happens when the handler "
8159 "is called.  This field may contain zero or more of the following flags:"
8160 msgstr ""
8161
8162 #. type: TP
8163 #: build/C/man3/sigvec.3:131
8164 #, no-wrap
8165 msgid "B<SV_INTERRUPT>"
8166 msgstr ""
8167
8168 #. type: Plain text
8169 #: build/C/man3/sigvec.3:139
8170 msgid ""
8171 "If the signal handler interrupts a blocking system call, then upon return "
8172 "from the handler the system call will not be restarted: instead it will fail "
8173 "with the error B<EINTR>.  If this flag is not specified, then system calls "
8174 "are restarted by default."
8175 msgstr ""
8176
8177 #. type: TP
8178 #: build/C/man3/sigvec.3:139
8179 #, no-wrap
8180 msgid "B<SV_RESETHAND>"
8181 msgstr ""
8182
8183 #. type: Plain text
8184 #: build/C/man3/sigvec.3:148
8185 msgid ""
8186 "Reset the disposition of the signal to the default before calling the signal "
8187 "handler.  If this flag is not specified, then the handler remains "
8188 "established until explicitly removed by a later call to B<sigvec>()  or "
8189 "until the process performs an B<execve>(2)."
8190 msgstr ""
8191
8192 #. type: TP
8193 #: build/C/man3/sigvec.3:148
8194 #, no-wrap
8195 msgid "B<SV_ONSTACK>"
8196 msgstr ""
8197
8198 #. type: Plain text
8199 #: build/C/man3/sigvec.3:155
8200 msgid ""
8201 "Handle the signal on the alternate signal stack (historically established "
8202 "under BSD using the obsolete B<sigstack>()  function; the POSIX replacement "
8203 "is B<sigaltstack>(2))."
8204 msgstr ""
8205
8206 #. type: Plain text
8207 #: build/C/man3/sigvec.3:165
8208 msgid ""
8209 "The B<sigmask>()  function constructs and returns a \"signal mask\" for "
8210 "I<signum>.  For example, we can initialize the I<vec.sv_mask> field given to "
8211 "B<sigvec>()  using code such as the following:"
8212 msgstr ""
8213
8214 #. type: Plain text
8215 #: build/C/man3/sigvec.3:170
8216 #, no-wrap
8217 msgid ""
8218 "    vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT);\n"
8219 "                /* Block SIGQUIT and SIGABRT during\n"
8220 "                   handler execution */\n"
8221 msgstr ""
8222
8223 #. type: Plain text
8224 #: build/C/man3/sigvec.3:185
8225 msgid ""
8226 "The B<sigblock>()  function adds the signals in I<mask> to the process's "
8227 "signal mask (like POSIX I<sigprocmask(SIG_BLOCK)>), and returns the "
8228 "process's previous signal mask.  Attempts to block B<SIGKILL> or B<SIGSTOP> "
8229 "are silently ignored."
8230 msgstr ""
8231
8232 #. type: Plain text
8233 #: build/C/man3/sigvec.3:193
8234 msgid ""
8235 "The B<sigsetmask>()  function sets the process's signal mask to the value "
8236 "given in I<mask> (like POSIX I<sigprocmask(SIG_SETMASK)>), and returns the "
8237 "process's previous signal mask."
8238 msgstr ""
8239
8240 #. type: Plain text
8241 #: build/C/man3/sigvec.3:199
8242 msgid ""
8243 "The B<siggetmask>()  function returns the process's current signal mask.  "
8244 "This call is equivalent to I<sigblock(0)>."
8245 msgstr ""
8246
8247 #. type: Plain text
8248 #: build/C/man3/sigvec.3:205
8249 msgid ""
8250 "The B<sigvec>()  function returns 0 on success; on error, it returns -1 and "
8251 "sets I<errno> to indicate the error."
8252 msgstr ""
8253
8254 #. type: Plain text
8255 #: build/C/man3/sigvec.3:211
8256 msgid ""
8257 "The B<sigblock>()  and B<sigsetmask>()  functions return the previous signal "
8258 "mask."
8259 msgstr ""
8260
8261 #. type: Plain text
8262 #: build/C/man3/sigvec.3:216
8263 msgid "The B<sigmask>()  function returns the signal mask for I<signum>."
8264 msgstr ""
8265
8266 #. type: Plain text
8267 #: build/C/man3/sigvec.3:221
8268 msgid "See the ERRORS under B<sigaction>(2)  and B<sigprocmask>(2)."
8269 msgstr ""
8270
8271 #. type: Plain text
8272 #: build/C/man3/sigvec.3:227
8273 msgid ""
8274 "All of these functions were in 4.3BSD, except B<siggetmask>(), whose origin "
8275 "is unclear.  These functions are obsolete: do not use them in new programs."
8276 msgstr ""
8277
8278 #. type: Plain text
8279 #: build/C/man3/sigvec.3:244
8280 msgid ""
8281 "On 4.3BSD, the B<signal>()  function provided reliable semantics (as when "
8282 "calling B<sigvec>()  with I<vec.sv_mask> equal to 0).  On System V, "
8283 "B<signal>()  provides unreliable semantics.  POSIX.1-2001 leaves these "
8284 "aspects of B<signal>()  unspecified.  See B<signal>(2)  for further details."
8285 msgstr ""
8286
8287 #. type: Plain text
8288 #: build/C/man3/sigvec.3:262
8289 msgid ""
8290 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
8291 "B<raise>(3), B<sigpause>(3), B<sigset>(3), B<signal>(7)"
8292 msgstr ""
8293
8294 #. type: TH
8295 #: build/C/man3/sigwait.3:26
8296 #, no-wrap
8297 msgid "SIGWAIT"
8298 msgstr ""
8299
8300 #. type: TH
8301 #: build/C/man3/sigwait.3:26
8302 #, no-wrap
8303 msgid "2012-07-21"
8304 msgstr ""
8305
8306 #. type: Plain text
8307 #: build/C/man3/sigwait.3:29
8308 msgid "sigwait - wait for a signal"
8309 msgstr ""
8310
8311 #. type: Plain text
8312 #: build/C/man3/sigwait.3:34
8313 #, no-wrap
8314 msgid "B< int sigwait(const sigset_t *>I<set>B<, int *>I<sig>B<);>\n"
8315 msgstr ""
8316
8317 #. type: Plain text
8318 #: build/C/man3/sigwait.3:44
8319 msgid "B<sigwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
8320 msgstr ""
8321
8322 #. type: Plain text
8323 #: build/C/man3/sigwait.3:56
8324 msgid ""
8325 "The B<sigwait>()  function suspends execution of the calling thread until "
8326 "one of the signals specified in the signal set I<set> becomes pending.  The "
8327 "function accepts the signal (removes it from the pending list of signals), "
8328 "and returns the signal number in I<sig>."
8329 msgstr ""
8330
8331 #. type: Plain text
8332 #: build/C/man3/sigwait.3:62
8333 msgid ""
8334 "The operation of B<sigwait>()  is the same as B<sigwaitinfo>(2), except "
8335 "that:"
8336 msgstr ""
8337
8338 #. type: Plain text
8339 #: build/C/man3/sigwait.3:67
8340 msgid ""
8341 "B<sigwait>()  returns only the signal number, rather than a I<siginfo_t> "
8342 "structure describing the signal."
8343 msgstr ""
8344
8345 #. type: Plain text
8346 #: build/C/man3/sigwait.3:69
8347 msgid "The return values of the two functions are different."
8348 msgstr ""
8349
8350 #. type: Plain text
8351 #: build/C/man3/sigwait.3:74
8352 msgid ""
8353 "On success, B<sigwait>()  returns 0.  On error, it returns a positive error "
8354 "number (listed in ERRORS)."
8355 msgstr ""
8356
8357 #.  Does not occur for glibc.
8358 #. type: Plain text
8359 #: build/C/man3/sigwait.3:80
8360 msgid "I<set> contains an invalid signal number."
8361 msgstr ""
8362
8363 #. type: Plain text
8364 #: build/C/man3/sigwait.3:86
8365 msgid "B<sigwait>()  is implemented using B<sigtimedwait>(2)."
8366 msgstr ""
8367
8368 #. type: Plain text
8369 #: build/C/man3/sigwait.3:89
8370 msgid "See B<pthread_sigmask>(3)."
8371 msgstr ""
8372
8373 #. type: Plain text
8374 #: build/C/man3/sigwait.3:97
8375 msgid ""
8376 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigsuspend>(2), "
8377 "B<sigwaitinfo>(2), B<sigsetops>(3), B<signal>(7)"
8378 msgstr ""
8379
8380 #. type: TH
8381 #: build/C/man2/sigwaitinfo.2:25
8382 #, no-wrap
8383 msgid "SIGWAITINFO"
8384 msgstr ""
8385
8386 #. type: TH
8387 #: build/C/man2/sigwaitinfo.2:25 build/C/man2/wait.2:49
8388 #, no-wrap
8389 msgid "2013-09-04"
8390 msgstr ""
8391
8392 #. type: Plain text
8393 #: build/C/man2/sigwaitinfo.2:28
8394 msgid "sigwaitinfo, sigtimedwait - synchronously wait for queued signals"
8395 msgstr ""
8396
8397 #. type: Plain text
8398 #: build/C/man2/sigwaitinfo.2:33
8399 #, no-wrap
8400 msgid "B<int sigwaitinfo(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<);>\n"
8401 msgstr ""
8402
8403 #. type: Plain text
8404 #: build/C/man2/sigwaitinfo.2:36
8405 #, no-wrap
8406 msgid ""
8407 "B<int sigtimedwait(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<, >\n"
8408 "B<                 const struct timespec *>I<timeout>B<);>\n"
8409 msgstr ""
8410
8411 #. type: Plain text
8412 #: build/C/man2/sigwaitinfo.2:46
8413 msgid "B<sigwaitinfo>(), B<sigtimedwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8414 msgstr ""
8415
8416 #. type: Plain text
8417 #: build/C/man2/sigwaitinfo.2:56
8418 msgid ""
8419 "B<sigwaitinfo>()  suspends execution of the calling thread until one of the "
8420 "signals in I<set> is pending (If one of the signals in I<set> is already "
8421 "pending for the calling thread, B<sigwaitinfo>()  will return immediately.)"
8422 msgstr ""
8423
8424 #. type: Plain text
8425 #: build/C/man2/sigwaitinfo.2:68
8426 msgid ""
8427 "B<sigwaitinfo>()  removes the signal from the set of pending signals and "
8428 "returns the signal number as its function result.  If the I<info> argument "
8429 "is not NULL, then the buffer that it points to is used to return a structure "
8430 "of type I<siginfo_t> (see B<sigaction>(2))  containing information about the "
8431 "signal."
8432 msgstr ""
8433
8434 #. type: Plain text
8435 #: build/C/man2/sigwaitinfo.2:76
8436 msgid ""
8437 "If multiple signals in I<set> are pending for the caller, the signal that is "
8438 "retrieved by B<sigwaitinfo>()  is determined according to the usual ordering "
8439 "rules; see B<signal>(7)  for further details."
8440 msgstr ""
8441
8442 #. type: Plain text
8443 #: build/C/man2/sigwaitinfo.2:88
8444 msgid ""
8445 "B<sigtimedwait>()  operates in exactly the same way as B<sigwaitinfo>()  "
8446 "except that it has an additional argument, I<timeout>, which specifies the "
8447 "interval for which the thread is suspended waiting for a signal.  (This "
8448 "interval will be rounded up to the system clock granularity, and kernel "
8449 "scheduling delays mean that the interval may overrun by a small amount.)  "
8450 "This argument is of the following type:"
8451 msgstr ""
8452
8453 #. type: Plain text
8454 #: build/C/man2/sigwaitinfo.2:95
8455 #, no-wrap
8456 msgid ""
8457 "struct timespec {\n"
8458 "    long    tv_sec;         /* seconds */\n"
8459 "    long    tv_nsec;        /* nanoseconds */\n"
8460 "}\n"
8461 msgstr ""
8462
8463 #. type: Plain text
8464 #: build/C/man2/sigwaitinfo.2:105
8465 msgid ""
8466 "If both fields of this structure are specified as 0, a poll is performed: "
8467 "B<sigtimedwait>()  returns immediately, either with information about a "
8468 "signal that was pending for the caller, or with an error if none of the "
8469 "signals in I<set> was pending."
8470 msgstr ""
8471
8472 #. type: Plain text
8473 #: build/C/man2/sigwaitinfo.2:114
8474 msgid ""
8475 "On success, both B<sigwaitinfo>()  and B<sigtimedwait>()  return a signal "
8476 "number (i.e., a value greater than zero).  On failure both calls return -1, "
8477 "with I<errno> set to indicate the error."
8478 msgstr ""
8479
8480 #. type: Plain text
8481 #: build/C/man2/sigwaitinfo.2:123
8482 msgid ""
8483 "No signal in I<set> was became pending within the I<timeout> period "
8484 "specified to B<sigtimedwait>()."
8485 msgstr ""
8486
8487 #. type: Plain text
8488 #: build/C/man2/sigwaitinfo.2:129
8489 msgid ""
8490 "The wait was interrupted by a signal handler; see B<signal>(7).  (This "
8491 "handler was for a signal other than one of those in I<set>.)"
8492 msgstr ""
8493
8494 #. type: Plain text
8495 #: build/C/man2/sigwaitinfo.2:133
8496 msgid "I<timeout> was invalid."
8497 msgstr ""
8498
8499 #. type: Plain text
8500 #: build/C/man2/sigwaitinfo.2:153
8501 msgid ""
8502 "In normal usage, the calling program blocks the signals in I<set> via a "
8503 "prior call to B<sigprocmask>(2)  (so that the default disposition for these "
8504 "signals does not occur if they become pending between successive calls to "
8505 "B<sigwaitinfo>()  or B<sigtimedwait>())  and does not establish handlers for "
8506 "these signals.  In a multithreaded program, the signal should be blocked in "
8507 "all threads, in order to prevent the signal being treated according to its "
8508 "default disposition in a thread other than the one calling B<sigwaitinfo>()  "
8509 "or B<sigtimedwait>())."
8510 msgstr ""
8511
8512 #. type: Plain text
8513 #: build/C/man2/sigwaitinfo.2:158
8514 msgid ""
8515 "The set of signals that is pending for a given thread is the union of the "
8516 "set of signals that is pending specifically for that thread and the set of "
8517 "signals that is pending for the process as a whole (see B<signal>(7))."
8518 msgstr ""
8519
8520 #. type: Plain text
8521 #: build/C/man2/sigwaitinfo.2:164
8522 msgid "Attempts to wait for B<SIGKILL> and B<SIGSTOP> are silently ignored."
8523 msgstr ""
8524
8525 #. type: Plain text
8526 #: build/C/man2/sigwaitinfo.2:173
8527 msgid ""
8528 "If multiple threads of a process are blocked waiting for the same signal(s) "
8529 "in B<sigwaitinfo>()  or B<sigtimedwait>(), then exactly one of the threads "
8530 "will actually receive the signal if it becomes pending for the process as a "
8531 "whole; which of the threads receives the signal is indeterminate."
8532 msgstr ""
8533
8534 #. type: Plain text
8535 #: build/C/man2/sigwaitinfo.2:182
8536 msgid ""
8537 "POSIX leaves the meaning of a NULL value for the I<timeout> argument of "
8538 "B<sigtimedwait>()  unspecified, permitting the possibility that this has the "
8539 "same meaning as a call to B<sigwaitinfo>(), and indeed this is what is done "
8540 "on Linux."
8541 msgstr ""
8542
8543 #. type: Plain text
8544 #: build/C/man2/sigwaitinfo.2:187
8545 msgid ""
8546 "On Linux, B<sigwaitinfo>()  is a library function implemented on top of "
8547 "B<sigtimedwait>()."
8548 msgstr ""
8549
8550 #. type: Plain text
8551 #: build/C/man2/sigwaitinfo.2:199
8552 msgid ""
8553 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<signalfd>(2), B<sigpending>(2), "
8554 "B<sigprocmask>(2), B<sigqueue>(3), B<sigsetops>(3), B<sigwait>(3), "
8555 "B<signal>(7), B<time>(7)"
8556 msgstr ""
8557
8558 #. type: TH
8559 #: build/C/man3/sysv_signal.3:25
8560 #, no-wrap
8561 msgid "SYSV_SIGNAL"
8562 msgstr ""
8563
8564 #. type: TH
8565 #: build/C/man3/sysv_signal.3:25
8566 #, no-wrap
8567 msgid "2007-05-04"
8568 msgstr ""
8569
8570 #. type: Plain text
8571 #: build/C/man3/sysv_signal.3:28
8572 msgid "sysv_signal - signal handling with System V semantics"
8573 msgstr ""
8574
8575 #. type: Plain text
8576 #: build/C/man3/sysv_signal.3:30
8577 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
8578 msgstr ""
8579
8580 #. type: Plain text
8581 #: build/C/man3/sysv_signal.3:36
8582 msgid "B<sighandler_t sysv_signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
8583 msgstr ""
8584
8585 #. type: Plain text
8586 #: build/C/man3/sysv_signal.3:41
8587 msgid ""
8588 "The B<sysv_signal>()  function takes the same arguments, and performs the "
8589 "same task, as B<signal>(2)."
8590 msgstr ""
8591
8592 #. type: Plain text
8593 #: build/C/man3/sysv_signal.3:51
8594 msgid ""
8595 "However B<sysv_signal>()  provides the System V unreliable signal semantics, "
8596 "that is: a) the disposition of the signal is reset to the default when the "
8597 "handler is invoked; b) delivery of further instances of the signal is not "
8598 "blocked while the signal handler is executing; and c) if the handler "
8599 "interrupts (certain) blocking system calls, then the system call is not "
8600 "automatically restarted."
8601 msgstr ""
8602
8603 #. type: Plain text
8604 #: build/C/man3/sysv_signal.3:57
8605 msgid ""
8606 "The B<sysv_signal>()  function returns the previous value of the signal "
8607 "handler, or B<SIG_ERR> on error."
8608 msgstr ""
8609
8610 #. type: Plain text
8611 #: build/C/man3/sysv_signal.3:62
8612 msgid "This function is nonstandard."
8613 msgstr ""
8614
8615 #. type: Plain text
8616 #: build/C/man3/sysv_signal.3:68
8617 msgid "Use of B<sysv_signal>()  should be avoided; use B<sigaction>(2)  instead."
8618 msgstr ""
8619
8620 #. type: Plain text
8621 #: build/C/man3/sysv_signal.3:79
8622 msgid ""
8623 "On older Linux systems, B<sysv_signal>()  and B<signal>(2)  were "
8624 "equivalent.  But on newer systems, B<signal>(2)  provides reliable signal "
8625 "semantics; see B<signal>(2)  for details."
8626 msgstr ""
8627
8628 #. type: Plain text
8629 #: build/C/man3/sysv_signal.3:92
8630 msgid "B<sigaction>(2), B<signal>(2), B<bsd_signal>(3), B<signal>(7)"
8631 msgstr ""
8632
8633 #. type: TH
8634 #: build/C/man2/timer_create.2:31
8635 #, no-wrap
8636 msgid "TIMER_CREATE"
8637 msgstr ""
8638
8639 #. type: TH
8640 #: build/C/man2/timer_create.2:31
8641 #, no-wrap
8642 msgid "2010-09-27"
8643 msgstr ""
8644
8645 #. type: Plain text
8646 #: build/C/man2/timer_create.2:34
8647 msgid "timer_create - create a POSIX per-process timer"
8648 msgstr ""
8649
8650 #. type: Plain text
8651 #: build/C/man2/timer_create.2:38
8652 #, no-wrap
8653 msgid ""
8654 "B<#include E<lt>signal.hE<gt>>\n"
8655 "B<#include E<lt>time.hE<gt>>\n"
8656 msgstr ""
8657
8658 #. type: Plain text
8659 #: build/C/man2/timer_create.2:41
8660 #, no-wrap
8661 msgid ""
8662 "B<int timer_create(clockid_t >I<clockid>B<, struct sigevent *>I<sevp>B<,>\n"
8663 "B<                 timer_t *>I<timerid>B<);>\n"
8664 msgstr ""
8665
8666 #. type: Plain text
8667 #: build/C/man2/timer_create.2:44 build/C/man2/timer_delete.2:37 build/C/man2/timer_getoverrun.2:37 build/C/man2/timer_settime.2:41
8668 msgid "Link with I<-lrt>."
8669 msgstr ""
8670
8671 #. type: Plain text
8672 #: build/C/man2/timer_create.2:52
8673 msgid "B<timer_create>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8674 msgstr ""
8675
8676 #. type: Plain text
8677 #: build/C/man2/timer_create.2:60
8678 msgid ""
8679 "B<timer_create>()  creates a new per-process interval timer.  The ID of the "
8680 "new timer is returned in the buffer pointed to by I<timerid>, which must be "
8681 "a non-NULL pointer.  This ID is unique within the process, until the timer "
8682 "is deleted.  The new timer is initially disarmed."
8683 msgstr ""
8684
8685 #. type: Plain text
8686 #: build/C/man2/timer_create.2:65
8687 msgid ""
8688 "The I<clockid> argument specifies the clock that the new timer uses to "
8689 "measure time.  It can be specified as one of the following values:"
8690 msgstr ""
8691
8692 #. type: TP
8693 #: build/C/man2/timer_create.2:65
8694 #, no-wrap
8695 msgid "B<CLOCK_REALTIME>"
8696 msgstr ""
8697
8698 #. type: Plain text
8699 #: build/C/man2/timer_create.2:68
8700 msgid "A settable system-wide real-time clock."
8701 msgstr ""
8702
8703 #. type: TP
8704 #: build/C/man2/timer_create.2:68
8705 #, no-wrap
8706 msgid "B<CLOCK_MONOTONIC>"
8707 msgstr ""
8708
8709 #.  Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime()
8710 #.  in 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009
8711 #. type: Plain text
8712 #: build/C/man2/timer_create.2:75
8713 msgid ""
8714 "A nonsettable monotonically increasing clock that measures time from some "
8715 "unspecified point in the past that does not change after system startup."
8716 msgstr ""
8717
8718 #. type: TP
8719 #: build/C/man2/timer_create.2:75
8720 #, no-wrap
8721 msgid "B<CLOCK_PROCESS_CPUTIME_ID> (since Linux 2.6.12)"
8722 msgstr ""
8723
8724 #. type: Plain text
8725 #: build/C/man2/timer_create.2:79
8726 msgid ""
8727 "A clock that measures (user and system) CPU time consumed by (all of the "
8728 "threads in) the calling process."
8729 msgstr ""
8730
8731 #. type: TP
8732 #: build/C/man2/timer_create.2:79
8733 #, no-wrap
8734 msgid "B<CLOCK_THREAD_CPUTIME_ID> (since Linux 2.6.12)"
8735 msgstr ""
8736
8737 #.  The CLOCK_MONOTONIC_RAW that was added in 2.6.28 can't be used
8738 #.  to create a timer -- mtk, Feb 2009
8739 #. type: Plain text
8740 #: build/C/man2/timer_create.2:85
8741 msgid ""
8742 "A clock that measures (user and system) CPU time consumed by the calling "
8743 "thread."
8744 msgstr ""
8745
8746 #. type: Plain text
8747 #: build/C/man2/timer_create.2:94
8748 msgid ""
8749 "As well as the above values, I<clockid> can be specified as the I<clockid> "
8750 "returned by a call to B<clock_getcpuclockid>(3)  or "
8751 "B<pthread_getcpuclockid>(3)."
8752 msgstr ""
8753
8754 #. type: Plain text
8755 #: build/C/man2/timer_create.2:103
8756 msgid ""
8757 "The I<sevp> argument points to a I<sigevent> structure that specifies how "
8758 "the caller should be notified when the timer expires.  For the definition "
8759 "and general details of this structure, see B<sigevent>(7)."
8760 msgstr ""
8761
8762 #. type: Plain text
8763 #: build/C/man2/timer_create.2:107
8764 msgid "The I<sevp.sigev_notify> field can have the following values:"
8765 msgstr ""
8766
8767 #. type: Plain text
8768 #: build/C/man2/timer_create.2:112
8769 msgid ""
8770 "Don't asynchronously notify when the timer expires.  Progress of the timer "
8771 "can be monitored using B<timer_gettime>(2)."
8772 msgstr ""
8773
8774 #. type: Plain text
8775 #: build/C/man2/timer_create.2:130
8776 msgid ""
8777 "Upon timer expiration, generate the signal I<sigev_signo> for the process.  "
8778 "See B<sigevent>(7)  for general details.  The I<si_code> field of the "
8779 "I<siginfo_t> structure will be set to B<SI_TIMER>.  At any point in time, at "
8780 "most one signal is queued to the process for a given timer; see "
8781 "B<timer_getoverrun>(2)  for more details."
8782 msgstr ""
8783
8784 #. type: Plain text
8785 #: build/C/man2/timer_create.2:138
8786 msgid ""
8787 "Upon timer expiration, invoke I<sigev_notify_function> as if it were the "
8788 "start function of a new thread.  See B<sigevent>(7)  for details."
8789 msgstr ""
8790
8791 #. type: Plain text
8792 #: build/C/man2/timer_create.2:152
8793 msgid ""
8794 "As for B<SIGEV_SIGNAL>, but the signal is targeted at the thread whose ID is "
8795 "given in I<sigev_notify_thread_id>, which must be a thread in the same "
8796 "process as the caller.  The I<sigev_notify_thread_id> field specifies a "
8797 "kernel thread ID, that is, the value returned by B<clone>(2)  or "
8798 "B<gettid>(2).  This flag is intended only for use by threading libraries."
8799 msgstr ""
8800
8801 #. type: Plain text
8802 #: build/C/man2/timer_create.2:167
8803 msgid ""
8804 "Specifying I<sevp> as NULL is equivalent to specifying a pointer to a "
8805 "I<sigevent> structure in which I<sigev_notify> is B<SIGEV_SIGNAL>, "
8806 "I<sigev_signo> is B<SIGALRM>, and I<sigev_value.sival_int> is the timer ID."
8807 msgstr ""
8808
8809 #. type: Plain text
8810 #: build/C/man2/timer_create.2:175
8811 msgid ""
8812 "On success, B<timer_create>()  returns 0, and the ID of the new timer is "
8813 "placed in I<*timerid>.  On failure, -1 is returned, and I<errno> is set to "
8814 "indicate the error."
8815 msgstr ""
8816
8817 #. type: Plain text
8818 #: build/C/man2/timer_create.2:179
8819 msgid "Temporary error during kernel allocation of timer structures."
8820 msgstr ""
8821
8822 #. type: Plain text
8823 #: build/C/man2/timer_create.2:187
8824 msgid ""
8825 "Clock ID, I<sigev_notify>, I<sigev_signo>, or I<sigev_notify_thread_id> is "
8826 "invalid."
8827 msgstr ""
8828
8829 #.  glibc layer: malloc()
8830 #. type: Plain text
8831 #: build/C/man2/timer_create.2:191
8832 msgid "Could not allocate memory."
8833 msgstr ""
8834
8835 #. type: Plain text
8836 #: build/C/man2/timer_create.2:193 build/C/man2/timer_delete.2:67 build/C/man2/timer_getoverrun.2:97
8837 msgid "This system call is available since Linux 2.6."
8838 msgstr ""
8839
8840 #. type: Plain text
8841 #: build/C/man2/timer_create.2:198
8842 msgid "A program may create multiple interval timers using B<timer_create>()."
8843 msgstr ""
8844
8845 #. type: Plain text
8846 #: build/C/man2/timer_create.2:203
8847 msgid ""
8848 "Timers are not inherited by the child of a B<fork>(2), and are disarmed and "
8849 "deleted during an B<execve>(2)."
8850 msgstr ""
8851
8852 #. type: Plain text
8853 #: build/C/man2/timer_create.2:211
8854 msgid ""
8855 "The kernel preallocates a \"queued real-time signal\" for each timer created "
8856 "using B<timer_create>().  Consequently, the number of timers is limited by "
8857 "the B<RLIMIT_SIGPENDING> resource limit (see B<setrlimit>(2))."
8858 msgstr ""
8859
8860 #. type: Plain text
8861 #: build/C/man2/timer_create.2:216
8862 msgid ""
8863 "The timers created by B<timer_create>()  are commonly known as \"POSIX "
8864 "(interval) timers\".  The POSIX timers API consists of the following "
8865 "interfaces:"
8866 msgstr ""
8867
8868 #. type: Plain text
8869 #: build/C/man2/timer_create.2:219
8870 msgid "B<timer_create>(): Create a timer."
8871 msgstr ""
8872
8873 #. type: Plain text
8874 #: build/C/man2/timer_create.2:222
8875 msgid "B<timer_settime>(2): Arm (start) or disarm (stop) a timer."
8876 msgstr ""
8877
8878 #. type: Plain text
8879 #: build/C/man2/timer_create.2:226
8880 msgid ""
8881 "B<timer_gettime>(2): Fetch the time remaining until the next expiration of a "
8882 "timer, along with the interval setting of the timer."
8883 msgstr ""
8884
8885 #. type: Plain text
8886 #: build/C/man2/timer_create.2:229
8887 msgid ""
8888 "B<timer_getoverrun>(2): Return the overrun count for the last timer "
8889 "expiration."
8890 msgstr ""
8891
8892 #. type: Plain text
8893 #: build/C/man2/timer_create.2:232
8894 msgid "B<timer_delete>(2): Disarm and delete a timer."
8895 msgstr ""
8896
8897 #. type: Plain text
8898 #: build/C/man2/timer_create.2:235
8899 msgid ""
8900 "Part of the implementation of the POSIX timers API is provided by glibc.  In "
8901 "particular:"
8902 msgstr ""
8903
8904 #. type: Plain text
8905 #: build/C/man2/timer_create.2:239
8906 msgid ""
8907 "The functionality for B<SIGEV_THREAD> is implemented within glibc, rather "
8908 "than the kernel."
8909 msgstr ""
8910
8911 #.  See the glibc source file kernel-posix-timers.h for the structure
8912 #.  that glibc uses to map user-space timer IDs to kernel timer IDs
8913 #.  The kernel-level timer ID is exposed via siginfo.si_tid.
8914 #. type: Plain text
8915 #: build/C/man2/timer_create.2:245
8916 msgid ""
8917 "The timer IDs presented at user level are maintained by glibc, which maps "
8918 "these IDs to the timer IDs employed by the kernel."
8919 msgstr ""
8920
8921 #. type: Plain text
8922 #: build/C/man2/timer_create.2:253
8923 msgid ""
8924 "The POSIX timers system calls first appeared in Linux 2.6.  Prior to this, "
8925 "glibc provided an incomplete user-space implementation (B<CLOCK_REALTIME> "
8926 "timers only) using POSIX threads, and current glibc falls back to this "
8927 "implementation on systems running pre-2.6 Linux kernels."
8928 msgstr ""
8929
8930 #. type: Plain text
8931 #: build/C/man2/timer_create.2:265
8932 msgid ""
8933 "The program below takes two arguments: a sleep period in seconds, and a "
8934 "timer frequency in nanoseconds.  The program establishes a handler for the "
8935 "signal it uses for the timer, blocks that signal, creates and arms a timer "
8936 "that expires with the given frequency, sleeps for the specified number of "
8937 "seconds, and then unblocks the timer signal.  Assuming that the timer "
8938 "expired at least once while the program slept, the signal handler will be "
8939 "invoked, and the handler displays some information about the timer "
8940 "notification.  The program terminates after one invocation of the signal "
8941 "handler."
8942 msgstr ""
8943
8944 #. type: Plain text
8945 #: build/C/man2/timer_create.2:270
8946 msgid ""
8947 "In the following example run, the program sleeps for 1 second, after "
8948 "creating a timer that has a frequency of 100 nanoseconds.  By the time the "
8949 "signal is unblocked and delivered, there have been around ten million "
8950 "overruns."
8951 msgstr ""
8952
8953 #. type: Plain text
8954 #: build/C/man2/timer_create.2:282
8955 #, no-wrap
8956 msgid ""
8957 "$ B<./a.out 1 100>\n"
8958 "Establishing handler for signal 34\n"
8959 "Blocking signal 34\n"
8960 "timer ID is 0x804c008\n"
8961 "Sleeping for 1 seconds\n"
8962 "Unblocking signal 34\n"
8963 "Caught signal 34\n"
8964 "    sival_ptr = 0xbfb174f4;     *sival_ptr = 0x804c008\n"
8965 "    overrun count = 10004886\n"
8966 msgstr ""
8967
8968 #. type: Plain text
8969 #: build/C/man2/timer_create.2:292
8970 #, no-wrap
8971 msgid ""
8972 "#include E<lt>stdlib.hE<gt>\n"
8973 "#include E<lt>unistd.hE<gt>\n"
8974 "#include E<lt>stdio.hE<gt>\n"
8975 "#include E<lt>signal.hE<gt>\n"
8976 "#include E<lt>time.hE<gt>\n"
8977 msgstr ""
8978
8979 #. type: Plain text
8980 #: build/C/man2/timer_create.2:295
8981 #, no-wrap
8982 msgid ""
8983 "#define CLOCKID CLOCK_REALTIME\n"
8984 "#define SIG SIGRTMIN\n"
8985 msgstr ""
8986
8987 #. type: Plain text
8988 #: build/C/man2/timer_create.2:298
8989 #, no-wrap
8990 msgid ""
8991 "#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\e\n"
8992 "                        } while (0)\n"
8993 msgstr ""
8994
8995 #. type: Plain text
8996 #: build/C/man2/timer_create.2:304
8997 #, no-wrap
8998 msgid ""
8999 "static void\n"
9000 "print_siginfo(siginfo_t *si)\n"
9001 "{\n"
9002 "    timer_t *tidp;\n"
9003 "    int or;\n"
9004 msgstr ""
9005
9006 #. type: Plain text
9007 #: build/C/man2/timer_create.2:306
9008 #, no-wrap
9009 msgid "    tidp = si-E<gt>si_value.sival_ptr;\n"
9010 msgstr ""
9011
9012 #. type: Plain text
9013 #: build/C/man2/timer_create.2:309
9014 #, no-wrap
9015 msgid ""
9016 "    printf(\"    sival_ptr = %p; \", si-E<gt>si_value.sival_ptr);\n"
9017 "    printf(\"    *sival_ptr = 0x%lx\\en\", (long) *tidp);\n"
9018 msgstr ""
9019
9020 #. type: Plain text
9021 #: build/C/man2/timer_create.2:316
9022 #, no-wrap
9023 msgid ""
9024 "    or = timer_getoverrun(*tidp);\n"
9025 "    if (or == -1)\n"
9026 "        errExit(\"timer_getoverrun\");\n"
9027 "    else\n"
9028 "        printf(\"    overrun count = %d\\en\", or);\n"
9029 "}\n"
9030 msgstr ""
9031
9032 #. type: Plain text
9033 #: build/C/man2/timer_create.2:323
9034 #, no-wrap
9035 msgid ""
9036 "static void\n"
9037 "handler(int sig, siginfo_t *si, void *uc)\n"
9038 "{\n"
9039 "    /* Note: calling printf() from a signal handler is not\n"
9040 "       strictly correct, since printf() is not async-signal-safe;\n"
9041 "       see signal(7) */\n"
9042 msgstr ""
9043
9044 #. type: Plain text
9045 #: build/C/man2/timer_create.2:328
9046 #, no-wrap
9047 msgid ""
9048 "    printf(\"Caught signal %d\\en\", sig);\n"
9049 "    print_siginfo(si);\n"
9050 "    signal(sig, SIG_IGN);\n"
9051 "}\n"
9052 msgstr ""
9053
9054 #. type: Plain text
9055 #: build/C/man2/timer_create.2:338
9056 #, no-wrap
9057 msgid ""
9058 "int\n"
9059 "main(int argc, char *argv[])\n"
9060 "{\n"
9061 "    timer_t timerid;\n"
9062 "    struct sigevent sev;\n"
9063 "    struct itimerspec its;\n"
9064 "    long long freq_nanosecs;\n"
9065 "    sigset_t mask;\n"
9066 "    struct sigaction sa;\n"
9067 msgstr ""
9068
9069 #. type: Plain text
9070 #: build/C/man2/timer_create.2:344
9071 #, no-wrap
9072 msgid ""
9073 "    if (argc != 3) {\n"
9074 "        fprintf(stderr, \"Usage: %s E<lt>sleep-secsE<gt> "
9075 "E<lt>freq-nanosecsE<gt>\\en\",\n"
9076 "                argv[0]);\n"
9077 "        exit(EXIT_FAILURE);\n"
9078 "    }\n"
9079 msgstr ""
9080
9081 #. type: Plain text
9082 #: build/C/man2/timer_create.2:346
9083 #, no-wrap
9084 msgid "    /* Establish handler for timer signal */\n"
9085 msgstr ""
9086
9087 #. type: Plain text
9088 #: build/C/man2/timer_create.2:353
9089 #, no-wrap
9090 msgid ""
9091 "    printf(\"Establishing handler for signal %d\\en\", SIG);\n"
9092 "    sa.sa_flags = SA_SIGINFO;\n"
9093 "    sa.sa_sigaction = handler;\n"
9094 "    sigemptyset(&sa.sa_mask);\n"
9095 "    if (sigaction(SIG, &sa, NULL) == -1)\n"
9096 "        errExit(\"sigaction\");\n"
9097 msgstr ""
9098
9099 #. type: Plain text
9100 #: build/C/man2/timer_create.2:355
9101 #, no-wrap
9102 msgid "    /* Block timer signal temporarily */\n"
9103 msgstr ""
9104
9105 #. type: Plain text
9106 #: build/C/man2/timer_create.2:361
9107 #, no-wrap
9108 msgid ""
9109 "    printf(\"Blocking signal %d\\en\", SIG);\n"
9110 "    sigemptyset(&mask);\n"
9111 "    sigaddset(&mask, SIG);\n"
9112 "    if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)\n"
9113 "        errExit(\"sigprocmask\");\n"
9114 msgstr ""
9115
9116 #. type: Plain text
9117 #: build/C/man2/timer_create.2:363
9118 #, no-wrap
9119 msgid "    /* Create the timer */\n"
9120 msgstr ""
9121
9122 #. type: Plain text
9123 #: build/C/man2/timer_create.2:369
9124 #, no-wrap
9125 msgid ""
9126 "    sev.sigev_notify = SIGEV_SIGNAL;\n"
9127 "    sev.sigev_signo = SIG;\n"
9128 "    sev.sigev_value.sival_ptr = &timerid;\n"
9129 "    if (timer_create(CLOCKID, &sev, &timerid) == -1)\n"
9130 "        errExit(\"timer_create\");\n"
9131 msgstr ""
9132
9133 #. type: Plain text
9134 #: build/C/man2/timer_create.2:371
9135 #, no-wrap
9136 msgid "    printf(\"timer ID is 0x%lx\\en\", (long) timerid);\n"
9137 msgstr ""
9138
9139 #. type: Plain text
9140 #: build/C/man2/timer_create.2:373
9141 #, no-wrap
9142 msgid "    /* Start the timer */\n"
9143 msgstr ""
9144
9145 #. type: Plain text
9146 #: build/C/man2/timer_create.2:379
9147 #, no-wrap
9148 msgid ""
9149 "    freq_nanosecs = atoll(argv[2]);\n"
9150 "    its.it_value.tv_sec = freq_nanosecs / 1000000000;\n"
9151 "    its.it_value.tv_nsec = freq_nanosecs % 1000000000;\n"
9152 "    its.it_interval.tv_sec = its.it_value.tv_sec;\n"
9153 "    its.it_interval.tv_nsec = its.it_value.tv_nsec;\n"
9154 msgstr ""
9155
9156 #. type: Plain text
9157 #: build/C/man2/timer_create.2:382
9158 #, no-wrap
9159 msgid ""
9160 "    if (timer_settime(timerid, 0, &its, NULL) == -1)\n"
9161 "         errExit(\"timer_settime\");\n"
9162 msgstr ""
9163
9164 #. type: Plain text
9165 #: build/C/man2/timer_create.2:385
9166 #, no-wrap
9167 msgid ""
9168 "    /* Sleep for a while; meanwhile, the timer may expire\n"
9169 "       multiple times */\n"
9170 msgstr ""
9171
9172 #. type: Plain text
9173 #: build/C/man2/timer_create.2:388
9174 #, no-wrap
9175 msgid ""
9176 "    printf(\"Sleeping for %d seconds\\en\", atoi(argv[1]));\n"
9177 "    sleep(atoi(argv[1]));\n"
9178 msgstr ""
9179
9180 #. type: Plain text
9181 #: build/C/man2/timer_create.2:391
9182 #, no-wrap
9183 msgid ""
9184 "    /* Unlock the timer signal, so that timer notification\n"
9185 "       can be delivered */\n"
9186 msgstr ""
9187
9188 #. type: Plain text
9189 #: build/C/man2/timer_create.2:395
9190 #, no-wrap
9191 msgid ""
9192 "    printf(\"Unblocking signal %d\\en\", SIG);\n"
9193 "    if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)\n"
9194 "        errExit(\"sigprocmask\");\n"
9195 msgstr ""
9196
9197 #. type: Plain text
9198 #: build/C/man2/timer_create.2:398 build/C/man2/timerfd_create.2:540
9199 #, no-wrap
9200 msgid ""
9201 "    exit(EXIT_SUCCESS);\n"
9202 "}\n"
9203 msgstr ""
9204
9205 #. type: Plain text
9206 #: build/C/man2/timer_create.2:414
9207 msgid ""
9208 "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
9209 "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
9210 "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
9211 "B<sigevent>(7), B<signal>(7), B<time>(7)"
9212 msgstr ""
9213
9214 #. type: TH
9215 #: build/C/man2/timer_delete.2:26
9216 #, no-wrap
9217 msgid "TIMER_DELETE"
9218 msgstr ""
9219
9220 #. type: TH
9221 #: build/C/man2/timer_delete.2:26 build/C/man2/timer_getoverrun.2:26
9222 #, no-wrap
9223 msgid "2009-02-20"
9224 msgstr ""
9225
9226 #. type: Plain text
9227 #: build/C/man2/timer_delete.2:29
9228 msgid "timer_delete - delete a POSIX per-process timer"
9229 msgstr ""
9230
9231 #. type: Plain text
9232 #: build/C/man2/timer_delete.2:32 build/C/man2/timer_getoverrun.2:32 build/C/man2/timer_settime.2:33
9233 #, no-wrap
9234 msgid "B<#include E<lt>time.hE<gt>>\n"
9235 msgstr ""
9236
9237 #. type: Plain text
9238 #: build/C/man2/timer_delete.2:34
9239 #, no-wrap
9240 msgid "B<int timer_delete(timer_t >I<timerid>B<);>\n"
9241 msgstr ""
9242
9243 #. type: Plain text
9244 #: build/C/man2/timer_delete.2:45
9245 msgid "B<timer_delete>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9246 msgstr ""
9247
9248 #. type: Plain text
9249 #: build/C/man2/timer_delete.2:53
9250 msgid ""
9251 "B<timer_delete>()  deletes the timer whose ID is given in I<timerid>.  If "
9252 "the timer was armed at the time of this call, it is disarmed before being "
9253 "deleted.  The treatment of any pending signal generated by the deleted timer "
9254 "is unspecified."
9255 msgstr ""
9256
9257 #. type: Plain text
9258 #: build/C/man2/timer_delete.2:60
9259 msgid ""
9260 "On success, B<timer_delete>()  returns 0.  On failure, -1 is returned, and "
9261 "I<errno> is set to indicate the error."
9262 msgstr ""
9263
9264 #. type: Plain text
9265 #: build/C/man2/timer_delete.2:65 build/C/man2/timer_getoverrun.2:95
9266 msgid "I<timerid> is not a valid timer ID."
9267 msgstr ""
9268
9269 #. type: Plain text
9270 #: build/C/man2/timer_delete.2:75
9271 msgid ""
9272 "B<clock_gettime>(2), B<timer_create>(2), B<timer_getoverrun>(2), "
9273 "B<timer_settime>(2), B<time>(7)"
9274 msgstr ""
9275
9276 #. type: TH
9277 #: build/C/man2/timer_getoverrun.2:26
9278 #, no-wrap
9279 msgid "TIMER_GETOVERRUN"
9280 msgstr ""
9281
9282 #. type: Plain text
9283 #: build/C/man2/timer_getoverrun.2:29
9284 msgid "timer_getoverrun - get overrun count for a POSIX per-process timer"
9285 msgstr ""
9286
9287 #. type: Plain text
9288 #: build/C/man2/timer_getoverrun.2:34
9289 #, no-wrap
9290 msgid "B<int timer_getoverrun(timer_t >I<timerid>B<);>\n"
9291 msgstr ""
9292
9293 #. type: Plain text
9294 #: build/C/man2/timer_getoverrun.2:45
9295 msgid "B<timer_getoverrun>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9296 msgstr ""
9297
9298 #. type: Plain text
9299 #: build/C/man2/timer_getoverrun.2:56
9300 msgid ""
9301 "B<timer_getoverrun>()  returns the \"overrun count\" for the timer referred "
9302 "to by I<timerid>.  An application can use the overrun count to accurately "
9303 "calculate the number of timer expirations that would have occurred over a "
9304 "given time interval.  Timer overruns can occur both when receiving "
9305 "expiration notifications via signals (B<SIGEV_SIGNAL>), and via threads "
9306 "(B<SIGEV_THREAD>)."
9307 msgstr ""
9308
9309 #. type: Plain text
9310 #: build/C/man2/timer_getoverrun.2:76
9311 msgid ""
9312 "When expiration notifications are delivered via a signal, overruns can occur "
9313 "as follows.  Regardless of whether or not a real-time signal is used for "
9314 "timer notifications, the system queues at most one signal per timer.  (This "
9315 "is the behavior specified by POSIX.1-2001.  The alternative, queuing one "
9316 "signal for each timer expiration, could easily result in overflowing the "
9317 "allowed limits for queued signals on the system.)  Because of system "
9318 "scheduling delays, or because the signal may be temporarily blocked, there "
9319 "can be a delay between the time when the notification signal is generated "
9320 "and the time when it is delivered (e.g., caught by a signal handler) or "
9321 "accepted (e.g., using B<sigwaitinfo>(2)).  In this interval, further timer "
9322 "expirations may occur.  The timer overrun count is the number of additional "
9323 "timer expirations that occurred between the time when the signal was "
9324 "generated and when it was delivered or accepted."
9325 msgstr ""
9326
9327 #. type: Plain text
9328 #: build/C/man2/timer_getoverrun.2:82
9329 msgid ""
9330 "Timer overruns can also occur when expiration notifications are delivered "
9331 "via invocation of a thread, since there may be an arbitrary delay between an "
9332 "expiration of the timer and the invocation of the notification thread, and "
9333 "in that delay interval, additional timer expirations may occur"
9334 msgstr ""
9335
9336 #. type: Plain text
9337 #: build/C/man2/timer_getoverrun.2:90
9338 msgid ""
9339 "On success, B<timer_getoverrun>()  returns the overrun count of the "
9340 "specified timer; this count may be 0 if no overruns have occurred.  On "
9341 "failure, -1 is returned, and I<errno> is set to indicate the error."
9342 msgstr ""
9343
9344 #. type: Plain text
9345 #: build/C/man2/timer_getoverrun.2:111
9346 msgid ""
9347 "When timer notifications are delivered via signals (B<SIGEV_SIGNAL>), on "
9348 "Linux it is also possible to obtain the overrun count via the I<si_overrun> "
9349 "field of the I<siginfo_t> structure (see B<sigaction>(2)).  This allows an "
9350 "application to avoid the overhead of making a system call to obtain the "
9351 "overrun count, but is a nonportable extension to POSIX.1-2001."
9352 msgstr ""
9353
9354 #.  FIXME . Austin bug filed, 11 Feb 09
9355 #. type: Plain text
9356 #: build/C/man2/timer_getoverrun.2:115
9357 msgid ""
9358 "POSIX.1-2001 discusses timer overruns only in the context of timer "
9359 "notifications using signals."
9360 msgstr ""
9361
9362 #.  Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665
9363 #.  http://thread.gmane.org/gmane.linux.kernel/113276/
9364 #. type: Plain text
9365 #: build/C/man2/timer_getoverrun.2:128
9366 msgid ""
9367 "POSIX.1-2001 specifies that if the timer overrun count is equal to or "
9368 "greater than an implementation-defined maximum, B<DELAYTIMER_MAX>, then "
9369 "B<timer_getoverrun>()  should return B<DELAYTIMER_MAX>.  However, Linux does "
9370 "not implement this feature: instead, if the timer overrun value exceeds the "
9371 "maximum representable integer, the counter cycles, starting once more from "
9372 "low values."
9373 msgstr ""
9374
9375 #. type: Plain text
9376 #: build/C/man2/timer_getoverrun.2:131 build/C/man2/timer_settime.2:212
9377 msgid "See B<timer_create>(2)."
9378 msgstr ""
9379
9380 #. type: Plain text
9381 #: build/C/man2/timer_getoverrun.2:141
9382 msgid ""
9383 "B<clock_gettime>(2), B<sigaction>(2), B<signalfd>(2), B<sigwaitinfo>(2), "
9384 "B<timer_create>(2), B<timer_delete>(2), B<timer_settime>(2), B<signal>(7), "
9385 "B<time>(7)"
9386 msgstr ""
9387
9388 #. type: TH
9389 #: build/C/man2/timer_settime.2:26
9390 #, no-wrap
9391 msgid "TIMER_SETTIME"
9392 msgstr ""
9393
9394 #. type: TH
9395 #: build/C/man2/timer_settime.2:26
9396 #, no-wrap
9397 msgid "2012-10-15"
9398 msgstr ""
9399
9400 #. type: Plain text
9401 #: build/C/man2/timer_settime.2:30
9402 msgid ""
9403 "timer_settime, timer_gettime - arm/disarm and fetch state of POSIX "
9404 "per-process timer"
9405 msgstr ""
9406
9407 #. type: Plain text
9408 #: build/C/man2/timer_settime.2:38
9409 #, no-wrap
9410 msgid ""
9411 "B<int timer_settime(timer_t >I<timerid>B<, int >I<flags>B<,>\n"
9412 "B<                  const struct itimerspec *>I<new_value>B<,>\n"
9413 "B<                  struct itimerspec * >I<old_value>B<);>\n"
9414 "B<int timer_gettime(timer_t >I<timerid>B<, struct itimerspec "
9415 "*>I<curr_value>B<);>\n"
9416 msgstr ""
9417
9418 #. type: Plain text
9419 #: build/C/man2/timer_settime.2:50
9420 msgid "B<timer_settime>(), B<timer_gettime>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9421 msgstr ""
9422
9423 #. type: Plain text
9424 #: build/C/man2/timer_settime.2:63
9425 msgid ""
9426 "B<timer_settime>()  arms or disarms the timer identified by I<timerid>.  The "
9427 "I<new_value> argument is pointer to an I<itimerspec> structure that "
9428 "specifies the new initial value and the new interval for the timer.  The "
9429 "I<itimerspec> structure is defined as follows:"
9430 msgstr ""
9431
9432 #. type: Plain text
9433 #: build/C/man2/timer_settime.2:70 build/C/man2/timerfd_create.2:128
9434 #, no-wrap
9435 msgid ""
9436 "struct timespec {\n"
9437 "    time_t tv_sec;                /* Seconds */\n"
9438 "    long   tv_nsec;               /* Nanoseconds */\n"
9439 "};\n"
9440 msgstr ""
9441
9442 #. type: Plain text
9443 #: build/C/man2/timer_settime.2:75
9444 #, no-wrap
9445 msgid ""
9446 "struct itimerspec {\n"
9447 "    struct timespec it_interval;  /* Timer interval */\n"
9448 "    struct timespec it_value;     /* Initial expiration */\n"
9449 "};\n"
9450 msgstr ""
9451
9452 #. type: Plain text
9453 #: build/C/man2/timer_settime.2:87
9454 msgid ""
9455 "Each of the substructures of the I<itimerspec> structure is a I<timespec> "
9456 "structure that allows a time value to be specified in seconds and "
9457 "nanoseconds.  These time values are measured according to the clock that was "
9458 "specified when the timer was created by B<timer_create>(2)"
9459 msgstr ""
9460
9461 #. type: Plain text
9462 #: build/C/man2/timer_settime.2:101
9463 msgid ""
9464 "If I<new_value-E<gt>it_value> specifies a nonzero value (i.e., either "
9465 "subfield is nonzero), then B<timer_settime>()  arms (starts) the timer, "
9466 "setting it to initially expire at the given time.  (If the timer was already "
9467 "armed, then the previous settings are overwritten.)  If "
9468 "I<new_value-E<gt>it_value> specifies a zero value (i.e., both subfields are "
9469 "zero), then the timer is disarmed."
9470 msgstr ""
9471
9472 #. type: Plain text
9473 #: build/C/man2/timer_settime.2:113
9474 msgid ""
9475 "The I<new_value-E<gt>it_interval> field specifies the period of the timer, "
9476 "in seconds and nanoseconds.  If this field is nonzero, then each time that "
9477 "an armed timer expires, the timer is reloaded from the value specified in "
9478 "I<new_value-E<gt>it_interval>.  If I<new_value-E<gt>it_interval> specifies a "
9479 "zero value then the timer expires just once, at the time specified by "
9480 "I<it_value>."
9481 msgstr ""
9482
9483 #.  By experiment: the overrun count is set correctly, for CLOCK_REALTIME.
9484 #. type: Plain text
9485 #: build/C/man2/timer_settime.2:134
9486 msgid ""
9487 "By default, the initial expiration time specified in "
9488 "I<new_value-E<gt>it_value> is interpreted relative to the current time on "
9489 "the timer's clock at the time of the call.  This can be modified by "
9490 "specifying B<TIMER_ABSTIME> in I<flags>, in which case "
9491 "I<new_value-E<gt>it_value> is interpreted as an absolute value as measured "
9492 "on the timer's clock; that is, the timer will expire when the clock value "
9493 "reaches the value specified by I<new_value-E<gt>it_value>.  If the specified "
9494 "absolute time has already passed, then the timer expires immediately, and "
9495 "the overrun count (see B<timer_getoverrun>(2))  will be set correctly."
9496 msgstr ""
9497
9498 #.  Similar remarks might apply with respect to process and thread CPU time
9499 #.  clocks, but these clocks are not currently (2.6.28) settable on Linux.
9500 #. type: Plain text
9501 #: build/C/man2/timer_settime.2:144
9502 msgid ""
9503 "If the value of the B<CLOCK_REALTIME> clock is adjusted while an absolute "
9504 "timer based on that clock is armed, then the expiration of the timer will be "
9505 "appropriately adjusted.  Adjustments to the B<CLOCK_REALTIME> clock have no "
9506 "effect on relative timers based on that clock."
9507 msgstr ""
9508
9509 #. type: Plain text
9510 #: build/C/man2/timer_settime.2:153
9511 msgid ""
9512 "If I<old_value> is not NULL, then it points to a buffer that is used to "
9513 "return the previous interval of the timer (in I<old_value-E<gt>it_interval>)  "
9514 "and the amount of time until the timer would previously have next expired "
9515 "(in I<old_value-E<gt>it_value>)."
9516 msgstr ""
9517
9518 #. type: Plain text
9519 #: build/C/man2/timer_settime.2:173
9520 msgid ""
9521 "B<timer_gettime>()  returns the time until next expiration, and the "
9522 "interval, for the timer specified by I<timerid>, in the buffer pointed to by "
9523 "I<curr_value>.  The time remaining until the next timer expiration is "
9524 "returned in I<curr_value-E<gt>it_value>; this is always a relative value, "
9525 "regardless of whether the B<TIMER_ABSTIME> flag was used when arming the "
9526 "timer.  If the value returned in I<curr_value-E<gt>it_value> is zero, then "
9527 "the timer is currently disarmed.  The timer interval is returned in "
9528 "I<curr_value-E<gt>it_interval>.  If the value returned in "
9529 "I<curr_value-E<gt>it_interval> is zero, then this is a \"one-shot\" timer."
9530 msgstr ""
9531
9532 #. type: Plain text
9533 #: build/C/man2/timer_settime.2:182
9534 msgid ""
9535 "On success, B<timer_settime>()  and B<timer_gettime>()  return 0.  On error, "
9536 "-1 is returned, and I<errno> is set to indicate the error."
9537 msgstr ""
9538
9539 #. type: Plain text
9540 #: build/C/man2/timer_settime.2:184
9541 msgid "These functions may fail with the following errors:"
9542 msgstr ""
9543
9544 #. type: Plain text
9545 #: build/C/man2/timer_settime.2:191
9546 msgid "I<new_value>, I<old_value>, or I<curr_value> is not a valid pointer."
9547 msgstr ""
9548
9549 #.  FIXME . eventually: invalid value in flags
9550 #. type: Plain text
9551 #: build/C/man2/timer_settime.2:196
9552 msgid "I<timerid> is invalid."
9553 msgstr ""
9554
9555 #. type: Plain text
9556 #: build/C/man2/timer_settime.2:199
9557 msgid "B<timer_settime>()  may fail with the following errors:"
9558 msgstr ""
9559
9560 #. type: Plain text
9561 #: build/C/man2/timer_settime.2:205
9562 msgid ""
9563 "I<new_value.it_value> is negative; or I<new_value.it_value.tv_nsec> is "
9564 "negative or greater than 999,999,999."
9565 msgstr ""
9566
9567 #. type: Plain text
9568 #: build/C/man2/timer_settime.2:207
9569 msgid "These system calls are available since Linux 2.6."
9570 msgstr ""
9571
9572 #. type: Plain text
9573 #: build/C/man2/timer_settime.2:216
9574 msgid "B<timer_create>(2), B<timer_getoverrun>(2), B<time>(7)"
9575 msgstr ""
9576
9577 #. type: TH
9578 #: build/C/man2/timerfd_create.2:21
9579 #, no-wrap
9580 msgid "TIMERFD_CREATE"
9581 msgstr ""
9582
9583 #. type: TH
9584 #: build/C/man2/timerfd_create.2:21
9585 #, no-wrap
9586 msgid "2011-09-14"
9587 msgstr ""
9588
9589 #. type: Plain text
9590 #: build/C/man2/timerfd_create.2:25
9591 msgid ""
9592 "timerfd_create, timerfd_settime, timerfd_gettime - timers that notify via "
9593 "file descriptors"
9594 msgstr ""
9595
9596 #. type: Plain text
9597 #: build/C/man2/timerfd_create.2:28
9598 #, no-wrap
9599 msgid "B<#include E<lt>sys/timerfd.hE<gt>>\n"
9600 msgstr ""
9601
9602 #. type: Plain text
9603 #: build/C/man2/timerfd_create.2:30
9604 #, no-wrap
9605 msgid "B<int timerfd_create(int >I<clockid>B<, int >I<flags>B<);>\n"
9606 msgstr ""
9607
9608 #. type: Plain text
9609 #: build/C/man2/timerfd_create.2:34
9610 #, no-wrap
9611 msgid ""
9612 "B<int timerfd_settime(int >I<fd>B<, int >I<flags>B<,>\n"
9613 "B<                    const struct itimerspec *>I<new_value>B<,>\n"
9614 "B<                    struct itimerspec *>I<old_value>B<);>\n"
9615 msgstr ""
9616
9617 #. type: Plain text
9618 #: build/C/man2/timerfd_create.2:36
9619 #, no-wrap
9620 msgid "B<int timerfd_gettime(int >I<fd>B<, struct itimerspec *>I<curr_value>B<);>\n"
9621 msgstr ""
9622
9623 #. type: Plain text
9624 #: build/C/man2/timerfd_create.2:49
9625 msgid ""
9626 "These system calls create and operate on a timer that delivers timer "
9627 "expiration notifications via a file descriptor.  They provide an alternative "
9628 "to the use of B<setitimer>(2)  or B<timer_create>(2), with the advantage "
9629 "that the file descriptor may be monitored by B<select>(2), B<poll>(2), and "
9630 "B<epoll>(7)."
9631 msgstr ""
9632
9633 #. type: Plain text
9634 #: build/C/man2/timerfd_create.2:61
9635 msgid ""
9636 "The use of these three system calls is analogous to the use of "
9637 "B<timer_create>(2), B<timer_settime>(2), and B<timer_gettime>(2).  (There is "
9638 "no analog of B<timer_getoverrun>(2), since that functionality is provided by "
9639 "B<read>(2), as described below.)"
9640 msgstr ""
9641
9642 #. type: SS
9643 #: build/C/man2/timerfd_create.2:61
9644 #, no-wrap
9645 msgid "timerfd_create()"
9646 msgstr ""
9647
9648 #. type: Plain text
9649 #: build/C/man2/timerfd_create.2:80
9650 msgid ""
9651 "B<timerfd_create>()  creates a new timer object, and returns a file "
9652 "descriptor that refers to that timer.  The I<clockid> argument specifies the "
9653 "clock that is used to mark the progress of the timer, and must be either "
9654 "B<CLOCK_REALTIME> or B<CLOCK_MONOTONIC>.  B<CLOCK_REALTIME> is a settable "
9655 "system-wide clock.  B<CLOCK_MONOTONIC> is a nonsettable clock that is not "
9656 "affected by discontinuous changes in the system clock (e.g., manual changes "
9657 "to system time).  The current value of each of these clocks can be retrieved "
9658 "using B<clock_gettime>(2)."
9659 msgstr ""
9660
9661 #. type: Plain text
9662 #: build/C/man2/timerfd_create.2:85
9663 msgid ""
9664 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
9665 "I<flags> to change the behavior of B<timerfd_create>():"
9666 msgstr ""
9667
9668 #. type: TP
9669 #: build/C/man2/timerfd_create.2:85
9670 #, no-wrap
9671 msgid "B<TFD_NONBLOCK>"
9672 msgstr ""
9673
9674 #. type: TP
9675 #: build/C/man2/timerfd_create.2:93
9676 #, no-wrap
9677 msgid "B<TFD_CLOEXEC>"
9678 msgstr ""
9679
9680 #. type: Plain text
9681 #: build/C/man2/timerfd_create.2:107
9682 msgid ""
9683 "In Linux versions up to and including 2.6.26, I<flags> must be specified as "
9684 "zero."
9685 msgstr ""
9686
9687 #. type: SS
9688 #: build/C/man2/timerfd_create.2:107
9689 #, no-wrap
9690 msgid "timerfd_settime()"
9691 msgstr ""
9692
9693 #. type: Plain text
9694 #: build/C/man2/timerfd_create.2:112
9695 msgid ""
9696 "B<timerfd_settime>()  arms (starts) or disarms (stops)  the timer referred "
9697 "to by the file descriptor I<fd>."
9698 msgstr ""
9699
9700 #. type: Plain text
9701 #: build/C/man2/timerfd_create.2:121
9702 msgid ""
9703 "The I<new_value> argument specifies the initial expiration and interval for "
9704 "the timer.  The I<itimer> structure used for this argument contains two "
9705 "fields, each of which is in turn a structure of type I<timespec>:"
9706 msgstr ""
9707
9708 #. type: Plain text
9709 #: build/C/man2/timerfd_create.2:133
9710 #, no-wrap
9711 msgid ""
9712 "struct itimerspec {\n"
9713 "    struct timespec it_interval;  /* Interval for periodic timer */\n"
9714 "    struct timespec it_value;     /* Initial expiration */\n"
9715 "};\n"
9716 msgstr ""
9717
9718 #. type: Plain text
9719 #: build/C/man2/timerfd_create.2:145
9720 msgid ""
9721 "I<new_value.it_value> specifies the initial expiration of the timer, in "
9722 "seconds and nanoseconds.  Setting either field of I<new_value.it_value> to a "
9723 "nonzero value arms the timer.  Setting both fields of I<new_value.it_value> "
9724 "to zero disarms the timer."
9725 msgstr ""
9726
9727 #. type: Plain text
9728 #: build/C/man2/timerfd_create.2:154
9729 msgid ""
9730 "Setting one or both fields of I<new_value.it_interval> to nonzero values "
9731 "specifies the period, in seconds and nanoseconds, for repeated timer "
9732 "expirations after the initial expiration.  If both fields of "
9733 "I<new_value.it_interval> are zero, the timer expires just once, at the time "
9734 "specified by I<new_value.it_value>."
9735 msgstr ""
9736
9737 #. type: Plain text
9738 #: build/C/man2/timerfd_create.2:170
9739 msgid ""
9740 "The I<flags> argument is either 0, to start a relative timer "
9741 "(I<new_value.it_value> specifies a time relative to the current value of the "
9742 "clock specified by I<clockid>), or B<TFD_TIMER_ABSTIME>, to start an "
9743 "absolute timer (I<new_value.it_value> specifies an absolute time for the "
9744 "clock specified by I<clockid>; that is, the timer will expire when the value "
9745 "of that clock reaches the value specified in I<new_value.it_value>)."
9746 msgstr ""
9747
9748 #. type: Plain text
9749 #: build/C/man2/timerfd_create.2:181
9750 msgid ""
9751 "If the I<old_value> argument is not NULL, then the I<itimerspec> structure "
9752 "that it points to is used to return the setting of the timer that was "
9753 "current at the time of the call; see the description of B<timerfd_gettime>()  "
9754 "following."
9755 msgstr ""
9756
9757 #. type: SS
9758 #: build/C/man2/timerfd_create.2:181
9759 #, no-wrap
9760 msgid "timerfd_gettime()"
9761 msgstr ""
9762
9763 #. type: Plain text
9764 #: build/C/man2/timerfd_create.2:190
9765 msgid ""
9766 "B<timerfd_gettime>()  returns, in I<curr_value>, an I<itimerspec> structure "
9767 "that contains the current setting of the timer referred to by the file "
9768 "descriptor I<fd>."
9769 msgstr ""
9770
9771 #. type: Plain text
9772 #: build/C/man2/timerfd_create.2:200
9773 msgid ""
9774 "The I<it_value> field returns the amount of time until the timer will next "
9775 "expire.  If both fields of this structure are zero, then the timer is "
9776 "currently disarmed.  This field always contains a relative value, regardless "
9777 "of whether the B<TFD_TIMER_ABSTIME> flag was specified when setting the "
9778 "timer."
9779 msgstr ""
9780
9781 #. type: Plain text
9782 #: build/C/man2/timerfd_create.2:207
9783 msgid ""
9784 "The I<it_interval> field returns the interval of the timer.  If both fields "
9785 "of this structure are zero, then the timer is set to expire just once, at "
9786 "the time specified by I<curr_value.it_value>."
9787 msgstr ""
9788
9789 #. type: SS
9790 #: build/C/man2/timerfd_create.2:207
9791 #, no-wrap
9792 msgid "Operating on a timer file descriptor"
9793 msgstr ""
9794
9795 #. type: Plain text
9796 #: build/C/man2/timerfd_create.2:211
9797 msgid ""
9798 "The file descriptor returned by B<timerfd_create>()  supports the following "
9799 "operations:"
9800 msgstr ""
9801
9802 #. type: Plain text
9803 #: build/C/man2/timerfd_create.2:225
9804 msgid ""
9805 "If the timer has already expired one or more times since its settings were "
9806 "last modified using B<timerfd_settime>(), or since the last successful "
9807 "B<read>(2), then the buffer given to B<read>(2)  returns an unsigned 8-byte "
9808 "integer (I<uint64_t>)  containing the number of expirations that have "
9809 "occurred.  (The returned value is in host byte order, i.e., the native byte "
9810 "order for integers on the host machine.)"
9811 msgstr ""
9812
9813 #. type: Plain text
9814 #: build/C/man2/timerfd_create.2:238
9815 msgid ""
9816 "If no timer expirations have occurred at the time of the B<read>(2), then "
9817 "the call either blocks until the next timer expiration, or fails with the "
9818 "error B<EAGAIN> if the file descriptor has been made nonblocking (via the "
9819 "use of the B<fcntl>(2)  B<F_SETFL> operation to set the B<O_NONBLOCK> flag)."
9820 msgstr ""
9821
9822 #. type: Plain text
9823 #: build/C/man2/timerfd_create.2:244
9824 msgid ""
9825 "A B<read>(2)  will fail with the error B<EINVAL> if the size of the supplied "
9826 "buffer is less than 8 bytes."
9827 msgstr ""
9828
9829 #. type: Plain text
9830 #: build/C/man2/timerfd_create.2:255
9831 msgid ""
9832 "The file descriptor is readable (the B<select>(2)  I<readfds> argument; the "
9833 "B<poll>(2)  B<POLLIN> flag)  if one or more timer expirations have occurred."
9834 msgstr ""
9835
9836 #. type: Plain text
9837 #: build/C/man2/timerfd_create.2:262
9838 msgid ""
9839 "The file descriptor also supports the other file-descriptor multiplexing "
9840 "APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
9841 msgstr ""
9842
9843 #. type: Plain text
9844 #: build/C/man2/timerfd_create.2:269
9845 msgid ""
9846 "When the file descriptor is no longer required it should be closed.  When "
9847 "all file descriptors associated with the same timer object have been closed, "
9848 "the timer is disarmed and its resources are freed by the kernel."
9849 msgstr ""
9850
9851 #. type: Plain text
9852 #: build/C/man2/timerfd_create.2:281
9853 msgid ""
9854 "After a B<fork>(2), the child inherits a copy of the file descriptor created "
9855 "by B<timerfd_create>().  The file descriptor refers to the same underlying "
9856 "timer object as the corresponding file descriptor in the parent, and "
9857 "B<read>(2)s in the child will return information about expirations of the "
9858 "timer."
9859 msgstr ""
9860
9861 #. type: Plain text
9862 #: build/C/man2/timerfd_create.2:287
9863 msgid ""
9864 "A file descriptor created by B<timerfd_create>()  is preserved across "
9865 "B<execve>(2), and continues to generate timer expirations if the timer was "
9866 "armed."
9867 msgstr ""
9868
9869 #. type: Plain text
9870 #: build/C/man2/timerfd_create.2:294
9871 msgid ""
9872 "On success, B<timerfd_create>()  returns a new file descriptor.  On error, "
9873 "-1 is returned and I<errno> is set to indicate the error."
9874 msgstr ""
9875
9876 #. type: Plain text
9877 #: build/C/man2/timerfd_create.2:302
9878 msgid ""
9879 "B<timerfd_settime>()  and B<timerfd_gettime>()  return 0 on success; on "
9880 "error they return -1, and set I<errno> to indicate the error."
9881 msgstr ""
9882
9883 #. type: Plain text
9884 #: build/C/man2/timerfd_create.2:305
9885 msgid "B<timerfd_create>()  can fail with the following errors:"
9886 msgstr ""
9887
9888 #. type: Plain text
9889 #: build/C/man2/timerfd_create.2:313
9890 msgid "The I<clockid> argument is neither B<CLOCK_MONOTONIC> nor B<CLOCK_REALTIME>;"
9891 msgstr ""
9892
9893 #. type: Plain text
9894 #: build/C/man2/timerfd_create.2:333
9895 msgid "There was insufficient kernel memory to create the timer."
9896 msgstr ""
9897
9898 #. type: Plain text
9899 #: build/C/man2/timerfd_create.2:338
9900 msgid ""
9901 "B<timerfd_settime>()  and B<timerfd_gettime>()  can fail with the following "
9902 "errors:"
9903 msgstr ""
9904
9905 #. type: Plain text
9906 #: build/C/man2/timerfd_create.2:342
9907 msgid "I<fd> is not a valid file descriptor."
9908 msgstr ""
9909
9910 #. type: Plain text
9911 #: build/C/man2/timerfd_create.2:353
9912 msgid "I<fd> is not a valid timerfd file descriptor."
9913 msgstr ""
9914
9915 #. type: Plain text
9916 #: build/C/man2/timerfd_create.2:356
9917 msgid "B<timerfd_settime>()  can also fail with the following errors:"
9918 msgstr ""
9919
9920 #. type: Plain text
9921 #: build/C/man2/timerfd_create.2:362
9922 msgid ""
9923 "I<new_value> is not properly initialized (one of the I<tv_nsec> falls "
9924 "outside the range zero to 999,999,999)."
9925 msgstr ""
9926
9927 #.  This case only checked since 2.6.29, and 2.2.2[78].some-stable-version.
9928 #.  In older kernel versions, no check was made for invalid flags.
9929 #. type: Plain text
9930 #: build/C/man2/timerfd_create.2:368
9931 msgid "I<flags> is invalid."
9932 msgstr ""
9933
9934 #. type: Plain text
9935 #: build/C/man2/timerfd_create.2:371
9936 msgid ""
9937 "These system calls are available on Linux since kernel 2.6.25.  Library "
9938 "support is provided by glibc since version 2.8."
9939 msgstr ""
9940
9941 #.  2.6.29
9942 #. type: Plain text
9943 #: build/C/man2/timerfd_create.2:379
9944 msgid ""
9945 "Currently, B<timerfd_create>()  supports fewer types of clock IDs than "
9946 "B<timer_create>(2)."
9947 msgstr ""
9948
9949 #. type: Plain text
9950 #: build/C/man2/timerfd_create.2:388
9951 msgid ""
9952 "The following program creates a timer and then monitors its progress.  The "
9953 "program accepts up to three command-line arguments.  The first argument "
9954 "specifies the number of seconds for the initial expiration of the timer.  "
9955 "The second argument specifies the interval for the timer, in seconds.  The "
9956 "third argument specifies the number of times the program should allow the "
9957 "timer to expire before terminating.  The second and third command-line "
9958 "arguments are optional."
9959 msgstr ""
9960
9961 #. type: Plain text
9962 #: build/C/man2/timerfd_create.2:390 build/C/man2/wait.2:569
9963 msgid "The following shell session demonstrates the use of the program:"
9964 msgstr ""
9965
9966 #. type: Plain text
9967 #: build/C/man2/timerfd_create.2:405
9968 #, no-wrap
9969 msgid ""
9970 "$B< a.out 3 1 100>\n"
9971 "0.000: timer started\n"
9972 "3.000: read: 1; total=1\n"
9973 "4.000: read: 1; total=2\n"
9974 "B<^Z >                 # type control-Z to suspend the program\n"
9975 "[1]+  Stopped                 ./timerfd3_demo 3 1 100\n"
9976 "$ B<fg>                # Resume execution after a few seconds\n"
9977 "a.out 3 1 100\n"
9978 "9.660: read: 5; total=7\n"
9979 "10.000: read: 1; total=8\n"
9980 "11.000: read: 1; total=9\n"
9981 "B<^C >                 # type control-C to suspend the program\n"
9982 msgstr ""
9983
9984 #.  The commented out code here is what we currently need until
9985 #.  the required stuff is in glibc
9986 #
9987 #
9988 #. /* Link with -lrt */
9989 #. #define _GNU_SOURCE
9990 #. #include <sys/syscall.h>
9991 #. #include <unistd.h>
9992 #. #include <time.h>
9993 #. #if defined(__i386__)
9994 #. #define __NR_timerfd_create 322
9995 #. #define __NR_timerfd_settime 325
9996 #. #define __NR_timerfd_gettime 326
9997 #. #endif
9998 #
9999 #. static int
10000 #. timerfd_create(int clockid, int flags)
10001 #. {
10002 #.     return syscall(__NR_timerfd_create, clockid, flags);
10003 #. }
10004 #
10005 #. static int
10006 #. timerfd_settime(int fd, int flags, struct itimerspec *new_value,
10007 #.         struct itimerspec *curr_value)
10008 #. {
10009 #.     return syscall(__NR_timerfd_settime, fd, flags, new_value,
10010 #.                    curr_value);
10011 #. }
10012 #
10013 #. static int
10014 #. timerfd_gettime(int fd, struct itimerspec *curr_value)
10015 #. {
10016 #.     return syscall(__NR_timerfd_gettime, fd, curr_value);
10017 #. }
10018 #
10019 #. #define TFD_TIMER_ABSTIME (1 << 0)
10020 #
10021 #. ////////////////////////////////////////////////////////////
10022 #. type: Plain text
10023 #: build/C/man2/timerfd_create.2:454
10024 #, no-wrap
10025 msgid ""
10026 "#include E<lt>sys/timerfd.hE<gt>\n"
10027 "#include E<lt>time.hE<gt>\n"
10028 "#include E<lt>unistd.hE<gt>\n"
10029 "#include E<lt>stdlib.hE<gt>\n"
10030 "#include E<lt>stdio.hE<gt>\n"
10031 "#include E<lt>stdint.hE<gt>        /* Definition of uint64_t */\n"
10032 msgstr ""
10033
10034 #. type: Plain text
10035 #: build/C/man2/timerfd_create.2:457
10036 #, no-wrap
10037 msgid ""
10038 "#define handle_error(msg) \\e\n"
10039 "        do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
10040 msgstr ""
10041
10042 #. type: Plain text
10043 #: build/C/man2/timerfd_create.2:465
10044 #, no-wrap
10045 msgid ""
10046 "static void\n"
10047 "print_elapsed_time(void)\n"
10048 "{\n"
10049 "    static struct timespec start;\n"
10050 "    struct timespec curr;\n"
10051 "    static int first_call = 1;\n"
10052 "    int secs, nsecs;\n"
10053 msgstr ""
10054
10055 #. type: Plain text
10056 #: build/C/man2/timerfd_create.2:471
10057 #, no-wrap
10058 msgid ""
10059 "    if (first_call) {\n"
10060 "        first_call = 0;\n"
10061 "        if (clock_gettime(CLOCK_MONOTONIC, &start) == -1)\n"
10062 "            handle_error(\"clock_gettime\");\n"
10063 "    }\n"
10064 msgstr ""
10065
10066 #. type: Plain text
10067 #: build/C/man2/timerfd_create.2:474
10068 #, no-wrap
10069 msgid ""
10070 "    if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1)\n"
10071 "        handle_error(\"clock_gettime\");\n"
10072 msgstr ""
10073
10074 #. type: Plain text
10075 #: build/C/man2/timerfd_create.2:483
10076 #, no-wrap
10077 msgid ""
10078 "    secs = curr.tv_sec - start.tv_sec;\n"
10079 "    nsecs = curr.tv_nsec - start.tv_nsec;\n"
10080 "    if (nsecs E<lt> 0) {\n"
10081 "        secs--;\n"
10082 "        nsecs += 1000000000;\n"
10083 "    }\n"
10084 "    printf(\"%d.%03d: \", secs, (nsecs + 500000) / 1000000);\n"
10085 "}\n"
10086 msgstr ""
10087
10088 #. type: Plain text
10089 #: build/C/man2/timerfd_create.2:492
10090 #, no-wrap
10091 msgid ""
10092 "int\n"
10093 "main(int argc, char *argv[])\n"
10094 "{\n"
10095 "    struct itimerspec new_value;\n"
10096 "    int max_exp, fd;\n"
10097 "    struct timespec now;\n"
10098 "    uint64_t exp, tot_exp;\n"
10099 "    ssize_t s;\n"
10100 msgstr ""
10101
10102 #. type: Plain text
10103 #: build/C/man2/timerfd_create.2:498
10104 #, no-wrap
10105 msgid ""
10106 "    if ((argc != 2) && (argc != 4)) {\n"
10107 "        fprintf(stderr, \"%s init-secs [interval-secs max-exp]\\en\",\n"
10108 "                argv[0]);\n"
10109 "        exit(EXIT_FAILURE);\n"
10110 "    }\n"
10111 msgstr ""
10112
10113 #. type: Plain text
10114 #: build/C/man2/timerfd_create.2:501
10115 #, no-wrap
10116 msgid ""
10117 "    if (clock_gettime(CLOCK_REALTIME, &now) == -1)\n"
10118 "        handle_error(\"clock_gettime\");\n"
10119 msgstr ""
10120
10121 #. type: Plain text
10122 #: build/C/man2/timerfd_create.2:504
10123 #, no-wrap
10124 msgid ""
10125 "    /* Create a CLOCK_REALTIME absolute timer with initial\n"
10126 "       expiration and interval as specified in command line */\n"
10127 msgstr ""
10128
10129 #. type: Plain text
10130 #: build/C/man2/timerfd_create.2:515
10131 #, no-wrap
10132 msgid ""
10133 "    new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]);\n"
10134 "    new_value.it_value.tv_nsec = now.tv_nsec;\n"
10135 "    if (argc == 2) {\n"
10136 "        new_value.it_interval.tv_sec = 0;\n"
10137 "        max_exp = 1;\n"
10138 "    } else {\n"
10139 "        new_value.it_interval.tv_sec = atoi(argv[2]);\n"
10140 "        max_exp = atoi(argv[3]);\n"
10141 "    }\n"
10142 "    new_value.it_interval.tv_nsec = 0;\n"
10143 msgstr ""
10144
10145 #. type: Plain text
10146 #: build/C/man2/timerfd_create.2:519
10147 #, no-wrap
10148 msgid ""
10149 "    fd = timerfd_create(CLOCK_REALTIME, 0);\n"
10150 "    if (fd == -1)\n"
10151 "        handle_error(\"timerfd_create\");\n"
10152 msgstr ""
10153
10154 #. type: Plain text
10155 #: build/C/man2/timerfd_create.2:522
10156 #, no-wrap
10157 msgid ""
10158 "    if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == -1)\n"
10159 "        handle_error(\"timerfd_settime\");\n"
10160 msgstr ""
10161
10162 #. type: Plain text
10163 #: build/C/man2/timerfd_create.2:525
10164 #, no-wrap
10165 msgid ""
10166 "    print_elapsed_time();\n"
10167 "    printf(\"timer started\\en\");\n"
10168 msgstr ""
10169
10170 #. type: Plain text
10171 #: build/C/man2/timerfd_create.2:530
10172 #, no-wrap
10173 msgid ""
10174 "    for (tot_exp = 0; tot_exp E<lt> max_exp;) {\n"
10175 "        s = read(fd, &exp, sizeof(uint64_t));\n"
10176 "        if (s != sizeof(uint64_t))\n"
10177 "            handle_error(\"read\");\n"
10178 msgstr ""
10179
10180 #. type: Plain text
10181 #: build/C/man2/timerfd_create.2:537
10182 #, no-wrap
10183 msgid ""
10184 "        tot_exp += exp;\n"
10185 "        print_elapsed_time();\n"
10186 "        printf(\"read: %llu; total=%llu\\en\",\n"
10187 "                (unsigned long long) exp,\n"
10188 "                (unsigned long long) tot_exp);\n"
10189 "    }\n"
10190 msgstr ""
10191
10192 #. type: Plain text
10193 #: build/C/man2/timerfd_create.2:553
10194 msgid ""
10195 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<setitimer>(2), "
10196 "B<signalfd>(2), B<timer_create>(2), B<timer_gettime>(2), "
10197 "B<timer_settime>(2), B<epoll>(7), B<time>(7)"
10198 msgstr ""
10199
10200 #. type: TH
10201 #: build/C/man2/tkill.2:29
10202 #, no-wrap
10203 msgid "TKILL"
10204 msgstr ""
10205
10206 #. type: Plain text
10207 #: build/C/man2/tkill.2:32
10208 msgid "tkill, tgkill - send a signal to a thread"
10209 msgstr ""
10210
10211 #. type: Plain text
10212 #: build/C/man2/tkill.2:35
10213 #, no-wrap
10214 msgid "B<int tkill(int >I<tid>B<, int >I<sig>B<);>\n"
10215 msgstr ""
10216
10217 #. type: Plain text
10218 #: build/C/man2/tkill.2:37
10219 #, no-wrap
10220 msgid "B<int tgkill(int >I<tgid>B<, int >I<tid>B<, int >I<sig>B<);>\n"
10221 msgstr ""
10222
10223 #. type: Plain text
10224 #: build/C/man2/tkill.2:54
10225 msgid ""
10226 "B<tgkill>()  sends the signal I<sig> to the thread with the thread ID I<tid> "
10227 "in the thread group I<tgid>.  (By contrast, B<kill>(2)  can be used to send "
10228 "a signal only to a process (i.e., thread group)  as a whole, and the signal "
10229 "will be delivered to an arbitrary thread within that process.)"
10230 msgstr ""
10231
10232 #.  FIXME: Maybe say something about the following:
10233 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=12889
10234 #.      Rich Felker <bugdal@aerifal.cx>
10235 #.      There is a race condition in pthread_kill: it is possible that,
10236 #.      between the time pthread_kill reads the pid/tid from the target
10237 #.      thread descriptor and the time it makes the tgkill syscall,
10238 #.      the target thread terminates and the same tid gets assigned
10239 #.      to a new thread in the same process.
10240 #
10241 #.      (The tgkill syscall was designed to eliminate a similar race
10242 #.      condition in tkill, but it only succeeded in eliminating races
10243 #.      where the tid gets reused in a different process, and does not
10244 #.      help if the same tid gets assigned to a new thread in the
10245 #.      same process.)
10246 #
10247 #.      The only solution I can see is to introduce a mutex that ensures
10248 #.      that a thread cannot exit while pthread_kill is being called on it.
10249 #
10250 #.      Note that in most real-world situations, like almost all race
10251 #.      conditions, this one will be extremely rare. To make it
10252 #.      measurable, one could exhaust all but 1-2 available pid values,
10253 #.      possibly by lowering the max pid parameter in /proc, forcing
10254 #.      the same tid to be reused rapidly.
10255 #. type: Plain text
10256 #: build/C/man2/tkill.2:85
10257 msgid ""
10258 "B<tkill>()  is an obsolete predecessor to B<tgkill>().  It allows only the "
10259 "target thread ID to be specified, which may result in the wrong thread being "
10260 "signaled if a thread terminates and its thread ID is recycled.  Avoid using "
10261 "this system call."
10262 msgstr ""
10263
10264 #. type: Plain text
10265 #: build/C/man2/tkill.2:92
10266 msgid "If I<tgid> is specified as -1, B<tgkill>()  is equivalent to B<tkill>()."
10267 msgstr ""
10268
10269 #. type: Plain text
10270 #: build/C/man2/tkill.2:95
10271 msgid ""
10272 "These are the raw system call interfaces, meant for internal thread library "
10273 "use."
10274 msgstr ""
10275
10276 #. type: Plain text
10277 #: build/C/man2/tkill.2:103
10278 msgid "An invalid thread ID, thread group ID, or signal was specified."
10279 msgstr ""
10280
10281 #. type: Plain text
10282 #: build/C/man2/tkill.2:108
10283 msgid "Permission denied.  For the required permissions, see B<kill>(2)."
10284 msgstr ""
10285
10286 #. type: Plain text
10287 #: build/C/man2/tkill.2:111
10288 msgid "No process with the specified thread ID (and thread group ID) exists."
10289 msgstr ""
10290
10291 #. type: Plain text
10292 #: build/C/man2/tkill.2:116
10293 msgid ""
10294 "B<tkill>()  is supported since Linux 2.4.19 / 2.5.4.  B<tgkill>()  was added "
10295 "in Linux 2.5.75."
10296 msgstr ""
10297
10298 #. type: Plain text
10299 #: build/C/man2/tkill.2:122
10300 msgid ""
10301 "B<tkill>()  and B<tgkill>()  are Linux-specific and should not be used in "
10302 "programs that are intended to be portable."
10303 msgstr ""
10304
10305 #. type: Plain text
10306 #: build/C/man2/tkill.2:128
10307 msgid ""
10308 "See the description of B<CLONE_THREAD> in B<clone>(2)  for an explanation of "
10309 "thread groups."
10310 msgstr ""
10311
10312 #. type: Plain text
10313 #: build/C/man2/tkill.2:131
10314 msgid ""
10315 "Glibc does not provide wrappers for these system calls; call them using "
10316 "B<syscall>(2)."
10317 msgstr ""
10318
10319 #. type: Plain text
10320 #: build/C/man2/tkill.2:136
10321 msgid "B<clone>(2), B<gettid>(2), B<kill>(2), B<rt_sigqueueinfo>(2)"
10322 msgstr ""
10323
10324 #. type: TH
10325 #: build/C/man2/wait.2:49
10326 #, no-wrap
10327 msgid "WAIT"
10328 msgstr ""
10329
10330 #. type: Plain text
10331 #: build/C/man2/wait.2:52
10332 msgid "wait, waitpid, waitid - wait for process to change state"
10333 msgstr ""
10334
10335 #. type: Plain text
10336 #: build/C/man2/wait.2:54
10337 msgid "B<#include E<lt>sys/types.hE<gt>>"
10338 msgstr ""
10339
10340 #. type: Plain text
10341 #: build/C/man2/wait.2:56
10342 msgid "B<#include E<lt>sys/wait.hE<gt>>"
10343 msgstr ""
10344
10345 #. type: Plain text
10346 #: build/C/man2/wait.2:58
10347 msgid "B<pid_t wait(int *>I<status>B<);>"
10348 msgstr ""
10349
10350 #. type: Plain text
10351 #: build/C/man2/wait.2:60
10352 msgid "B<pid_t waitpid(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<);>"
10353 msgstr ""
10354
10355 #. type: Plain text
10356 #: build/C/man2/wait.2:65
10357 #, no-wrap
10358 msgid ""
10359 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, "
10360 "int >I<options>B<);>\n"
10361 "                /* This is the glibc and POSIX interface; see\n"
10362 "                   NOTES for information on the raw system call. */\n"
10363 msgstr ""
10364
10365 #. type: Plain text
10366 #: build/C/man2/wait.2:74
10367 msgid "B<waitid>():"
10368 msgstr ""
10369
10370 #. type: Plain text
10371 #: build/C/man2/wait.2:78
10372 msgid ""
10373 "_SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
10374 "_XOPEN_SOURCE_EXTENDED"
10375 msgstr ""
10376
10377 #. type: Plain text
10378 #: build/C/man2/wait.2:93
10379 msgid ""
10380 "All of these system calls are used to wait for state changes in a child of "
10381 "the calling process, and obtain information about the child whose state has "
10382 "changed.  A state change is considered to be: the child terminated; the "
10383 "child was stopped by a signal; or the child was resumed by a signal.  In the "
10384 "case of a terminated child, performing a wait allows the system to release "
10385 "the resources associated with the child; if a wait is not performed, then "
10386 "the terminated child remains in a \"zombie\" state (see NOTES below)."
10387 msgstr ""
10388
10389 #. type: Plain text
10390 #: build/C/man2/wait.2:105
10391 msgid ""
10392 "If a child has already changed state, then these calls return immediately.  "
10393 "Otherwise they block until either a child changes state or a signal handler "
10394 "interrupts the call (assuming that system calls are not automatically "
10395 "restarted using the B<SA_RESTART> flag of B<sigaction>(2)).  In the "
10396 "remainder of this page, a child whose state has changed and which has not "
10397 "yet been waited upon by one of these system calls is termed I<waitable>."
10398 msgstr ""
10399
10400 #. type: SS
10401 #: build/C/man2/wait.2:105
10402 #, no-wrap
10403 msgid "wait() and waitpid()"
10404 msgstr ""
10405
10406 #. type: Plain text
10407 #: build/C/man2/wait.2:113
10408 msgid ""
10409 "The B<wait>()  system call suspends execution of the calling process until "
10410 "one of its children terminates.  The call I<wait(&status)> is equivalent to:"
10411 msgstr ""
10412
10413 #. type: Plain text
10414 #: build/C/man2/wait.2:116
10415 #, no-wrap
10416 msgid "    waitpid(-1, &status, 0);\n"
10417 msgstr ""
10418
10419 #. type: Plain text
10420 #: build/C/man2/wait.2:130
10421 msgid ""
10422 "The B<waitpid>()  system call suspends execution of the calling process "
10423 "until a child specified by I<pid> argument has changed state.  By default, "
10424 "B<waitpid>()  waits only for terminated children, but this behavior is "
10425 "modifiable via the I<options> argument, as described below."
10426 msgstr ""
10427
10428 #. type: Plain text
10429 #: build/C/man2/wait.2:134
10430 msgid "The value of I<pid> can be:"
10431 msgstr ""
10432
10433 #. type: IP
10434 #: build/C/man2/wait.2:134
10435 #, no-wrap
10436 msgid "E<lt> -1"
10437 msgstr ""
10438
10439 #. type: Plain text
10440 #: build/C/man2/wait.2:138
10441 msgid ""
10442 "meaning wait for any child process whose process group ID is equal to the "
10443 "absolute value of I<pid>."
10444 msgstr ""
10445
10446 #. type: IP
10447 #: build/C/man2/wait.2:138
10448 #, no-wrap
10449 msgid "-1"
10450 msgstr ""
10451
10452 #. type: Plain text
10453 #: build/C/man2/wait.2:140
10454 msgid "meaning wait for any child process."
10455 msgstr ""
10456
10457 #. type: IP
10458 #: build/C/man2/wait.2:140
10459 #, no-wrap
10460 msgid "0"
10461 msgstr ""
10462
10463 #. type: Plain text
10464 #: build/C/man2/wait.2:143
10465 msgid ""
10466 "meaning wait for any child process whose process group ID is equal to that "
10467 "of the calling process."
10468 msgstr ""
10469
10470 #. type: IP
10471 #: build/C/man2/wait.2:143
10472 #, no-wrap
10473 msgid "E<gt> 0"
10474 msgstr ""
10475
10476 #. type: Plain text
10477 #: build/C/man2/wait.2:147
10478 msgid "meaning wait for the child whose process ID is equal to the value of I<pid>."
10479 msgstr ""
10480
10481 #. type: Plain text
10482 #: build/C/man2/wait.2:151
10483 msgid "The value of I<options> is an OR of zero or more of the following constants:"
10484 msgstr ""
10485
10486 #. type: TP
10487 #: build/C/man2/wait.2:151 build/C/man2/wait.2:280
10488 #, no-wrap
10489 msgid "B<WNOHANG>"
10490 msgstr ""
10491
10492 #. type: Plain text
10493 #: build/C/man2/wait.2:154
10494 msgid "return immediately if no child has exited."
10495 msgstr ""
10496
10497 #. type: TP
10498 #: build/C/man2/wait.2:154
10499 #, no-wrap
10500 msgid "B<WUNTRACED>"
10501 msgstr ""
10502
10503 #. type: Plain text
10504 #: build/C/man2/wait.2:163
10505 msgid ""
10506 "also return if a child has stopped (but not traced via B<ptrace>(2)).  "
10507 "Status for I<traced> children which have stopped is provided even if this "
10508 "option is not specified."
10509 msgstr ""
10510
10511 #. type: TP
10512 #: build/C/man2/wait.2:163
10513 #, no-wrap
10514 msgid "B<WCONTINUED> (since Linux 2.6.10)"
10515 msgstr ""
10516
10517 #. type: Plain text
10518 #: build/C/man2/wait.2:167
10519 msgid "also return if a stopped child has been resumed by delivery of B<SIGCONT>."
10520 msgstr ""
10521
10522 #. type: Plain text
10523 #: build/C/man2/wait.2:169
10524 msgid "(For Linux-only options, see below.)"
10525 msgstr ""
10526
10527 #. type: Plain text
10528 #: build/C/man2/wait.2:183
10529 msgid ""
10530 "If I<status> is not NULL, B<wait>()  and B<waitpid>()  store status "
10531 "information in the I<int> to which it points.  This integer can be inspected "
10532 "with the following macros (which take the integer itself as an argument, not "
10533 "a pointer to it, as is done in B<wait>()  and B<waitpid>()!):"
10534 msgstr ""
10535
10536 #. type: TP
10537 #: build/C/man2/wait.2:183
10538 #, no-wrap
10539 msgid "B<WIFEXITED(>I<status>B<)>"
10540 msgstr ""
10541
10542 #. type: Plain text
10543 #: build/C/man2/wait.2:191
10544 msgid ""
10545 "returns true if the child terminated normally, that is, by calling "
10546 "B<exit>(3)  or B<_exit>(2), or by returning from main()."
10547 msgstr ""
10548
10549 #. type: TP
10550 #: build/C/man2/wait.2:191
10551 #, no-wrap
10552 msgid "B<WEXITSTATUS(>I<status>B<)>"
10553 msgstr ""
10554
10555 #. type: Plain text
10556 #: build/C/man2/wait.2:204
10557 msgid ""
10558 "returns the exit status of the child.  This consists of the least "
10559 "significant 8 bits of the I<status> argument that the child specified in a "
10560 "call to B<exit>(3)  or B<_exit>(2)  or as the argument for a return "
10561 "statement in main().  This macro should be employed only if B<WIFEXITED> "
10562 "returned true."
10563 msgstr ""
10564
10565 #. type: TP
10566 #: build/C/man2/wait.2:204
10567 #, no-wrap
10568 msgid "B<WIFSIGNALED(>I<status>B<)>"
10569 msgstr ""
10570
10571 #. type: Plain text
10572 #: build/C/man2/wait.2:207
10573 msgid "returns true if the child process was terminated by a signal."
10574 msgstr ""
10575
10576 #. type: TP
10577 #: build/C/man2/wait.2:207
10578 #, no-wrap
10579 msgid "B<WTERMSIG(>I<status>B<)>"
10580 msgstr ""
10581
10582 #. type: Plain text
10583 #: build/C/man2/wait.2:214
10584 msgid ""
10585 "returns the number of the signal that caused the child process to "
10586 "terminate.  This macro should be employed only if B<WIFSIGNALED> returned "
10587 "true."
10588 msgstr ""
10589
10590 #. type: TP
10591 #: build/C/man2/wait.2:214
10592 #, no-wrap
10593 msgid "B<WCOREDUMP(>I<status>B<)>"
10594 msgstr ""
10595
10596 #. type: Plain text
10597 #: build/C/man2/wait.2:223
10598 msgid ""
10599 "returns true if the child produced a core dump.  This macro should be "
10600 "employed only if B<WIFSIGNALED> returned true.  This macro is not specified "
10601 "in POSIX.1-2001 and is not available on some UNIX implementations (e.g., "
10602 "AIX, SunOS).  Only use this enclosed in #ifdef WCOREDUMP ... #endif."
10603 msgstr ""
10604
10605 #. type: TP
10606 #: build/C/man2/wait.2:223
10607 #, no-wrap
10608 msgid "B<WIFSTOPPED(>I<status>B<)>"
10609 msgstr ""
10610
10611 #. type: Plain text
10612 #: build/C/man2/wait.2:230
10613 msgid ""
10614 "returns true if the child process was stopped by delivery of a signal; this "
10615 "is possible only if the call was done using B<WUNTRACED> or when the child "
10616 "is being traced (see B<ptrace>(2))."
10617 msgstr ""
10618
10619 #. type: TP
10620 #: build/C/man2/wait.2:230
10621 #, no-wrap
10622 msgid "B<WSTOPSIG(>I<status>B<)>"
10623 msgstr ""
10624
10625 #. type: Plain text
10626 #: build/C/man2/wait.2:236
10627 msgid ""
10628 "returns the number of the signal which caused the child to stop.  This macro "
10629 "should be employed only if B<WIFSTOPPED> returned true."
10630 msgstr ""
10631
10632 #. type: TP
10633 #: build/C/man2/wait.2:236
10634 #, no-wrap
10635 msgid "B<WIFCONTINUED(>I<status>B<)>"
10636 msgstr ""
10637
10638 #. type: Plain text
10639 #: build/C/man2/wait.2:241
10640 msgid ""
10641 "(since Linux 2.6.10)  returns true if the child process was resumed by "
10642 "delivery of B<SIGCONT>."
10643 msgstr ""
10644
10645 #. type: SS
10646 #: build/C/man2/wait.2:241
10647 #, no-wrap
10648 msgid "waitid()"
10649 msgstr ""
10650
10651 #. type: Plain text
10652 #: build/C/man2/wait.2:246
10653 msgid ""
10654 "The B<waitid>()  system call (available since Linux 2.6.9) provides more "
10655 "precise control over which child state changes to wait for."
10656 msgstr ""
10657
10658 #. type: Plain text
10659 #: build/C/man2/wait.2:252
10660 msgid ""
10661 "The I<idtype> and I<id> arguments select the child(ren) to wait for, as "
10662 "follows:"
10663 msgstr ""
10664
10665 #. type: IP
10666 #: build/C/man2/wait.2:252
10667 #, no-wrap
10668 msgid "I<idtype> == B<P_PID>"
10669 msgstr ""
10670
10671 #. type: Plain text
10672 #: build/C/man2/wait.2:255
10673 msgid "Wait for the child whose process ID matches I<id>."
10674 msgstr ""
10675
10676 #. type: IP
10677 #: build/C/man2/wait.2:255
10678 #, no-wrap
10679 msgid "I<idtype> == B<P_PGID>"
10680 msgstr ""
10681
10682 #. type: Plain text
10683 #: build/C/man2/wait.2:258
10684 msgid "Wait for any child whose process group ID matches I<id>."
10685 msgstr ""
10686
10687 #. type: IP
10688 #: build/C/man2/wait.2:258
10689 #, no-wrap
10690 msgid "I<idtype> == B<P_ALL>"
10691 msgstr ""
10692
10693 #. type: Plain text
10694 #: build/C/man2/wait.2:262
10695 msgid "Wait for any child; I<id> is ignored."
10696 msgstr ""
10697
10698 #. type: Plain text
10699 #: build/C/man2/wait.2:266
10700 msgid ""
10701 "The child state changes to wait for are specified by ORing one or more of "
10702 "the following flags in I<options>:"
10703 msgstr ""
10704
10705 #. type: TP
10706 #: build/C/man2/wait.2:266
10707 #, no-wrap
10708 msgid "B<WEXITED>"
10709 msgstr ""
10710
10711 #. type: Plain text
10712 #: build/C/man2/wait.2:269
10713 msgid "Wait for children that have terminated."
10714 msgstr ""
10715
10716 #. type: TP
10717 #: build/C/man2/wait.2:269
10718 #, no-wrap
10719 msgid "B<WSTOPPED>"
10720 msgstr ""
10721
10722 #. type: Plain text
10723 #: build/C/man2/wait.2:272
10724 msgid "Wait for children that have been stopped by delivery of a signal."
10725 msgstr ""
10726
10727 #. type: TP
10728 #: build/C/man2/wait.2:272
10729 #, no-wrap
10730 msgid "B<WCONTINUED>"
10731 msgstr ""
10732
10733 #. type: Plain text
10734 #: build/C/man2/wait.2:277
10735 msgid ""
10736 "Wait for (previously stopped) children that have been resumed by delivery of "
10737 "B<SIGCONT>."
10738 msgstr ""
10739
10740 #. type: Plain text
10741 #: build/C/man2/wait.2:280
10742 msgid "The following flags may additionally be ORed in I<options>:"
10743 msgstr ""
10744
10745 #. type: Plain text
10746 #: build/C/man2/wait.2:284
10747 msgid "As for B<waitpid>()."
10748 msgstr ""
10749
10750 #. type: TP
10751 #: build/C/man2/wait.2:284
10752 #, no-wrap
10753 msgid "B<WNOWAIT>"
10754 msgstr ""
10755
10756 #. type: Plain text
10757 #: build/C/man2/wait.2:288
10758 msgid ""
10759 "Leave the child in a waitable state; a later wait call can be used to again "
10760 "retrieve the child status information."
10761 msgstr ""
10762
10763 #. type: Plain text
10764 #: build/C/man2/wait.2:295
10765 msgid ""
10766 "Upon successful return, B<waitid>()  fills in the following fields of the "
10767 "I<siginfo_t> structure pointed to by I<infop>:"
10768 msgstr ""
10769
10770 #. type: Plain text
10771 #: build/C/man2/wait.2:298
10772 msgid "The process ID of the child."
10773 msgstr ""
10774
10775 #. type: Plain text
10776 #: build/C/man2/wait.2:302
10777 msgid ""
10778 "The real user ID of the child.  (This field is not set on most other "
10779 "implementations.)"
10780 msgstr ""
10781
10782 #. type: Plain text
10783 #: build/C/man2/wait.2:306
10784 msgid "Always set to B<SIGCHLD>."
10785 msgstr ""
10786
10787 #. type: TP
10788 #: build/C/man2/wait.2:306
10789 #, no-wrap
10790 msgid "I<si_status>"
10791 msgstr ""
10792
10793 #. type: Plain text
10794 #: build/C/man2/wait.2:316
10795 msgid ""
10796 "Either the exit status of the child, as given to B<_exit>(2)  (or "
10797 "B<exit>(3)), or the signal that caused the child to terminate, stop, or "
10798 "continue.  The I<si_code> field can be used to determine how to interpret "
10799 "this field."
10800 msgstr ""
10801
10802 #. type: Plain text
10803 #: build/C/man2/wait.2:333
10804 msgid ""
10805 "Set to one of: B<CLD_EXITED> (child called B<_exit>(2)); B<CLD_KILLED> "
10806 "(child killed by signal); B<CLD_DUMPED> (child killed by signal, and dumped "
10807 "core); B<CLD_STOPPED> (child stopped by signal); B<CLD_TRAPPED> (traced "
10808 "child has trapped); or B<CLD_CONTINUED> (child continued by B<SIGCONT>)."
10809 msgstr ""
10810
10811 #.  POSIX.1-2001 leaves this possibility unspecified; most
10812 #.  implementations (including Linux) zero out the structure
10813 #.  in this case, but at least one implementation (AIX 5.1)
10814 #.  does not -- MTK Nov 04
10815 #. type: Plain text
10816 #: build/C/man2/wait.2:355
10817 msgid ""
10818 "If B<WNOHANG> was specified in I<options> and there were no children in a "
10819 "waitable state, then B<waitid>()  returns 0 immediately and the state of the "
10820 "I<siginfo_t> structure pointed to by I<infop> is unspecified.  To "
10821 "distinguish this case from that where a child was in a waitable state, zero "
10822 "out the I<si_pid> field before the call and check for a nonzero value in "
10823 "this field after the call returns."
10824 msgstr ""
10825
10826 #. type: Plain text
10827 #: build/C/man2/wait.2:359
10828 msgid ""
10829 "B<wait>(): on success, returns the process ID of the terminated child; on "
10830 "error, -1 is returned."
10831 msgstr ""
10832
10833 #. type: Plain text
10834 #: build/C/man2/wait.2:368
10835 msgid ""
10836 "B<waitpid>(): on success, returns the process ID of the child whose state "
10837 "has changed; if B<WNOHANG> was specified and one or more child(ren) "
10838 "specified by I<pid> exist, but have not yet changed state, then 0 is "
10839 "returned.  On error, -1 is returned."
10840 msgstr ""
10841
10842 #.  FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid()
10843 #.  returns the PID of the child.  Either this is a bug, or it is intended
10844 #.  behavior that needs to be documented.  See my Jan 2009 LKML mail
10845 #.  "waitid() return value strangeness when infop is NULL".
10846 #. type: Plain text
10847 #: build/C/man2/wait.2:384
10848 msgid ""
10849 "B<waitid>(): returns 0 on success or if B<WNOHANG> was specified and no "
10850 "child(ren) specified by I<id> has yet changed state; on error, -1 is "
10851 "returned.  Each of these calls sets I<errno> to an appropriate value in the "
10852 "case of an error."
10853 msgstr ""
10854
10855 #. type: TP
10856 #: build/C/man2/wait.2:385 build/C/man2/wait.2:390
10857 #, no-wrap
10858 msgid "B<ECHILD>"
10859 msgstr ""
10860
10861 #. type: Plain text
10862 #: build/C/man2/wait.2:390
10863 msgid ""
10864 "(for B<wait>())  The calling process does not have any unwaited-for "
10865 "children."
10866 msgstr ""
10867
10868 #. type: Plain text
10869 #: build/C/man2/wait.2:410
10870 msgid ""
10871 "(for B<waitpid>()  or B<waitid>())  The process specified by I<pid> "
10872 "(B<waitpid>())  or I<idtype> and I<id> (B<waitid>())  does not exist or is "
10873 "not a child of the calling process.  (This can happen for one's own child if "
10874 "the action for B<SIGCHLD> is set to B<SIG_IGN>.  See also the I<Linux Notes> "
10875 "section about threads.)"
10876 msgstr ""
10877
10878 #. type: Plain text
10879 #: build/C/man2/wait.2:417
10880 msgid ""
10881 "B<WNOHANG> was not set and an unblocked signal or a B<SIGCHLD> was caught; "
10882 "see B<signal>(7)."
10883 msgstr ""
10884
10885 #. type: Plain text
10886 #: build/C/man2/wait.2:422
10887 msgid "The I<options> argument was invalid."
10888 msgstr ""
10889
10890 #. type: Plain text
10891 #: build/C/man2/wait.2:437
10892 msgid ""
10893 "A child that terminates, but has not been waited for becomes a \"zombie\".  "
10894 "The kernel maintains a minimal set of information about the zombie process "
10895 "(PID, termination status, resource usage information)  in order to allow the "
10896 "parent to later perform a wait to obtain information about the child.  As "
10897 "long as a zombie is not removed from the system via a wait, it will consume "
10898 "a slot in the kernel process table, and if this table fills, it will not be "
10899 "possible to create further processes.  If a parent process terminates, then "
10900 "its \"zombie\" children (if any)  are adopted by B<init>(8), which "
10901 "automatically performs a wait to remove the zombies."
10902 msgstr ""
10903
10904 #. type: Plain text
10905 #: build/C/man2/wait.2:478
10906 msgid ""
10907 "POSIX.1-2001 specifies that if the disposition of B<SIGCHLD> is set to "
10908 "B<SIG_IGN> or the B<SA_NOCLDWAIT> flag is set for B<SIGCHLD> (see "
10909 "B<sigaction>(2)), then children that terminate do not become zombies and a "
10910 "call to B<wait>()  or B<waitpid>()  will block until all children have "
10911 "terminated, and then fail with I<errno> set to B<ECHILD>.  (The original "
10912 "POSIX standard left the behavior of setting B<SIGCHLD> to B<SIG_IGN> "
10913 "unspecified.  Note that even though the default disposition of B<SIGCHLD> is "
10914 "\"ignore\", explicitly setting the disposition to B<SIG_IGN> results in "
10915 "different treatment of zombie process children.)  Linux 2.6 conforms to this "
10916 "specification.  However, Linux 2.4 (and earlier) does not: if a B<wait>()  "
10917 "or B<waitpid>()  call is made while B<SIGCHLD> is being ignored, the call "
10918 "behaves just as though B<SIGCHLD> were not being ignored, that is, the call "
10919 "blocks until the next child terminates and then returns the process ID and "
10920 "status of that child."
10921 msgstr ""
10922
10923 #. type: Plain text
10924 #: build/C/man2/wait.2:494
10925 msgid ""
10926 "In the Linux kernel, a kernel-scheduled thread is not a distinct construct "
10927 "from a process.  Instead, a thread is simply a process that is created using "
10928 "the Linux-unique B<clone>(2)  system call; other routines such as the "
10929 "portable B<pthread_create>(3)  call are implemented using B<clone>(2).  "
10930 "Before Linux 2.4, a thread was just a special case of a process, and as a "
10931 "consequence one thread could not wait on the children of another thread, "
10932 "even when the latter belongs to the same thread group.  However, POSIX "
10933 "prescribes such functionality, and since Linux 2.4 a thread can, and by "
10934 "default will, wait on children of other threads in the same thread group."
10935 msgstr ""
10936
10937 #. type: Plain text
10938 #: build/C/man2/wait.2:501
10939 msgid ""
10940 "The following Linux-specific I<options> are for use with children created "
10941 "using B<clone>(2); they cannot be used with B<waitid>():"
10942 msgstr ""
10943
10944 #. type: TP
10945 #: build/C/man2/wait.2:501
10946 #, no-wrap
10947 msgid "B<__WCLONE>"
10948 msgstr ""
10949
10950 #.  since 0.99pl10
10951 #. type: Plain text
10952 #: build/C/man2/wait.2:512
10953 msgid ""
10954 "Wait for \"clone\" children only.  If omitted then wait for \"non-clone\" "
10955 "children only.  (A \"clone\" child is one which delivers no signal, or a "
10956 "signal other than B<SIGCHLD> to its parent upon termination.)  This option "
10957 "is ignored if B<__WALL> is also specified."
10958 msgstr ""
10959
10960 #. type: TP
10961 #: build/C/man2/wait.2:512
10962 #, no-wrap
10963 msgid "B<__WALL> (since Linux 2.4)"
10964 msgstr ""
10965
10966 #.  since patch-2.3.48
10967 #. type: Plain text
10968 #: build/C/man2/wait.2:517
10969 msgid "Wait for all children, regardless of type (\"clone\" or \"non-clone\")."
10970 msgstr ""
10971
10972 #. type: TP
10973 #: build/C/man2/wait.2:517
10974 #, no-wrap
10975 msgid "B<__WNOTHREAD> (since Linux 2.4)"
10976 msgstr ""
10977
10978 #.  since patch-2.4.0-test8
10979 #. type: Plain text
10980 #: build/C/man2/wait.2:523
10981 msgid ""
10982 "Do not wait for children of other threads in the same thread group.  This "
10983 "was the default before Linux 2.4."
10984 msgstr ""
10985
10986 #. type: Plain text
10987 #: build/C/man2/wait.2:535
10988 msgid ""
10989 "The raw B<waitid>()  system call takes a fith argument, of type I<struct "
10990 "rusage\\ *>.  If this argument is non-NULL, then it is used to return "
10991 "resource usage information about the child, in the same manner as "
10992 "B<wait4>(2).  See B<getrusage>(2)  for details."
10993 msgstr ""
10994
10995 #. type: Plain text
10996 #: build/C/man2/wait.2:550
10997 msgid ""
10998 "According to POSIX.1-2008, an application calling B<waitid>()  must ensure "
10999 "that I<infop> points to a I<siginfo_t> structure (i.e., that it is a "
11000 "non-NULL pointer).  On Linux, if I<infop> is NULL, B<waitid>()  succeeds, "
11001 "and returns the process ID of the waited-for child.  Applications should "
11002 "avoid relying on this inconsistent, nonstandard, and unnecessary feature."
11003 msgstr ""
11004
11005 #.  fork.2 refers to this example program.
11006 #. type: Plain text
11007 #: build/C/man2/wait.2:567
11008 msgid ""
11009 "The following program demonstrates the use of B<fork>(2)  and B<waitpid>().  "
11010 "The program creates a child process.  If no command-line argument is "
11011 "supplied to the program, then the child suspends its execution using "
11012 "B<pause>(2), to allow the user to send signals to the child.  Otherwise, if "
11013 "a command-line argument is supplied, then the child exits immediately, using "
11014 "the integer supplied on the command line as the exit status.  The parent "
11015 "process executes a loop that monitors the child using B<waitpid>(), and uses "
11016 "the W*() macros described above to analyze the wait status value."
11017 msgstr ""
11018
11019 #. type: Plain text
11020 #: build/C/man2/wait.2:583
11021 #, no-wrap
11022 msgid ""
11023 "$B< ./a.out &>\n"
11024 "Child PID is 32360\n"
11025 "[1] 32359\n"
11026 "$B< kill -STOP 32360>\n"
11027 "stopped by signal 19\n"
11028 "$B< kill -CONT 32360>\n"
11029 "continued\n"
11030 "$B< kill -TERM 32360>\n"
11031 "killed by signal 15\n"
11032 "[1]+  Done                    ./a.out\n"
11033 "$\n"
11034 msgstr ""
11035
11036 #. type: Plain text
11037 #: build/C/man2/wait.2:592
11038 #, no-wrap
11039 msgid ""
11040 "#include E<lt>sys/wait.hE<gt>\n"
11041 "#include E<lt>stdlib.hE<gt>\n"
11042 "#include E<lt>unistd.hE<gt>\n"
11043 "#include E<lt>stdio.hE<gt>\n"
11044 msgstr ""
11045
11046 #. type: Plain text
11047 #: build/C/man2/wait.2:598
11048 #, no-wrap
11049 msgid ""
11050 "int\n"
11051 "main(int argc, char *argv[])\n"
11052 "{\n"
11053 "    pid_t cpid, w;\n"
11054 "    int status;\n"
11055 msgstr ""
11056
11057 #. type: Plain text
11058 #: build/C/man2/wait.2:604
11059 #, no-wrap
11060 msgid ""
11061 "    cpid = fork();\n"
11062 "    if (cpid == -1) {\n"
11063 "        perror(\"fork\");\n"
11064 "        exit(EXIT_FAILURE);\n"
11065 "    }\n"
11066 msgstr ""
11067
11068 #. type: Plain text
11069 #: build/C/man2/wait.2:610
11070 #, no-wrap
11071 msgid ""
11072 "    if (cpid == 0) {            /* Code executed by child */\n"
11073 "        printf(\"Child PID is %ld\\en\", (long) getpid());\n"
11074 "        if (argc == 1)\n"
11075 "            pause();                    /* Wait for signals */\n"
11076 "        _exit(atoi(argv[1]));\n"
11077 msgstr ""
11078
11079 #. type: Plain text
11080 #: build/C/man2/wait.2:618
11081 #, no-wrap
11082 msgid ""
11083 "    } else {                    /* Code executed by parent */\n"
11084 "        do {\n"
11085 "            w = waitpid(cpid, &status, WUNTRACED | WCONTINUED);\n"
11086 "            if (w == -1) {\n"
11087 "                perror(\"waitpid\");\n"
11088 "                exit(EXIT_FAILURE);\n"
11089 "            }\n"
11090 msgstr ""
11091
11092 #. type: Plain text
11093 #: build/C/man2/wait.2:632
11094 #, no-wrap
11095 msgid ""
11096 "            if (WIFEXITED(status)) {\n"
11097 "                printf(\"exited, status=%d\\en\", WEXITSTATUS(status));\n"
11098 "            } else if (WIFSIGNALED(status)) {\n"
11099 "                printf(\"killed by signal %d\\en\", WTERMSIG(status));\n"
11100 "            } else if (WIFSTOPPED(status)) {\n"
11101 "                printf(\"stopped by signal %d\\en\", WSTOPSIG(status));\n"
11102 "            } else if (WIFCONTINUED(status)) {\n"
11103 "                printf(\"continued\\en\");\n"
11104 "            }\n"
11105 "        } while (!WIFEXITED(status) && !WIFSIGNALED(status));\n"
11106 "        exit(EXIT_SUCCESS);\n"
11107 "    }\n"
11108 "}\n"
11109 msgstr ""
11110
11111 #. type: Plain text
11112 #: build/C/man2/wait.2:645
11113 msgid ""
11114 "B<_exit>(2), B<clone>(2), B<fork>(2), B<kill>(2), B<ptrace>(2), "
11115 "B<sigaction>(2), B<signal>(2), B<wait4>(2), B<pthread_create>(3), "
11116 "B<credentials>(7), B<signal>(7)"
11117 msgstr ""
11118
11119 #. type: TH
11120 #: build/C/man2/wait4.2:33
11121 #, no-wrap
11122 msgid "WAIT4"
11123 msgstr ""
11124
11125 #. type: TH
11126 #: build/C/man2/wait4.2:33
11127 #, no-wrap
11128 msgid "2012-09-23"
11129 msgstr ""
11130
11131 #. type: Plain text
11132 #: build/C/man2/wait4.2:36
11133 msgid "wait3, wait4 - wait for process to change state, BSD style"
11134 msgstr ""
11135
11136 #. type: Plain text
11137 #: build/C/man2/wait4.2:42
11138 #, no-wrap
11139 msgid ""
11140 "B<#include E<lt>sys/types.hE<gt>>\n"
11141 "B<#include E<lt>sys/time.hE<gt>>\n"
11142 "B<#include E<lt>sys/resource.hE<gt>>\n"
11143 "B<#include E<lt>sys/wait.hE<gt>>\n"
11144 msgstr ""
11145
11146 #. type: Plain text
11147 #: build/C/man2/wait4.2:45
11148 #, no-wrap
11149 msgid ""
11150 "B<pid_t wait3(int *>I<status>B<, int >I<options>B<,>\n"
11151 "B<            struct rusage *>I<rusage>B<);>\n"
11152 msgstr ""
11153
11154 #. type: Plain text
11155 #: build/C/man2/wait4.2:48
11156 #, no-wrap
11157 msgid ""
11158 "B<pid_t wait4(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<,>\n"
11159 "B<            struct rusage *>I<rusage>B<);>\n"
11160 msgstr ""
11161
11162 #. type: Plain text
11163 #: build/C/man2/wait4.2:57
11164 msgid "B<wait3>():"
11165 msgstr ""
11166
11167 #. type: Plain text
11168 #: build/C/man2/wait4.2:63
11169 msgid "B<wait4>():"
11170 msgstr ""
11171
11172 #. type: Plain text
11173 #: build/C/man2/wait4.2:65
11174 msgid "_BSD_SOURCE"
11175 msgstr ""
11176
11177 #. type: Plain text
11178 #: build/C/man2/wait4.2:73
11179 msgid ""
11180 "These functions are obsolete; use B<waitpid>(2)  or B<waitid>(2)  in new "
11181 "programs."
11182 msgstr ""
11183
11184 #. type: Plain text
11185 #: build/C/man2/wait4.2:83
11186 msgid ""
11187 "The B<wait3>()  and B<wait4>()  system calls are similar to B<waitpid>(2), "
11188 "but additionally return resource usage information about the child in the "
11189 "structure pointed to by I<rusage>."
11190 msgstr ""
11191
11192 #. type: Plain text
11193 #: build/C/man2/wait4.2:89
11194 msgid ""
11195 "Other than the use of the I<rusage> argument, the following B<wait3>()  "
11196 "call:"
11197 msgstr ""
11198
11199 #. type: Plain text
11200 #: build/C/man2/wait4.2:92
11201 #, no-wrap
11202 msgid "    wait3(status, options, rusage);\n"
11203 msgstr ""
11204
11205 #. type: Plain text
11206 #: build/C/man2/wait4.2:95 build/C/man2/wait4.2:109
11207 msgid "is equivalent to:"
11208 msgstr ""
11209
11210 #. type: Plain text
11211 #: build/C/man2/wait4.2:98
11212 #, no-wrap
11213 msgid "    waitpid(-1, status, options);\n"
11214 msgstr ""
11215
11216 #. type: Plain text
11217 #: build/C/man2/wait4.2:103
11218 msgid "Similarly, the following B<wait4>()  call:"
11219 msgstr ""
11220
11221 #. type: Plain text
11222 #: build/C/man2/wait4.2:106
11223 #, no-wrap
11224 msgid "    wait4(pid, status, options, rusage);\n"
11225 msgstr ""
11226
11227 #. type: Plain text
11228 #: build/C/man2/wait4.2:112
11229 #, no-wrap
11230 msgid "    waitpid(pid, status, options);\n"
11231 msgstr ""
11232
11233 #. type: Plain text
11234 #: build/C/man2/wait4.2:122
11235 msgid ""
11236 "In other words, B<wait3>()  waits of any child, while B<wait4>()  can be "
11237 "used to select a specific child, or children, on which to wait.  See "
11238 "B<wait>(2)  for further details."
11239 msgstr ""
11240
11241 #. type: Plain text
11242 #: build/C/man2/wait4.2:132
11243 msgid ""
11244 "If I<rusage> is not NULL, the I<struct rusage> to which it points will be "
11245 "filled with accounting information about the child.  See B<getrusage>(2)  "
11246 "for details."
11247 msgstr ""
11248
11249 #. type: Plain text
11250 #: build/C/man2/wait4.2:135 build/C/man2/wait4.2:138
11251 msgid "As for B<waitpid>(2)."
11252 msgstr ""
11253
11254 #. type: Plain text
11255 #: build/C/man2/wait4.2:140
11256 msgid "4.3BSD."
11257 msgstr ""
11258
11259 #. type: Plain text
11260 #: build/C/man2/wait4.2:147
11261 msgid ""
11262 "SUSv1 included a specification of B<wait3>(); SUSv2 included B<wait3>(), but "
11263 "marked it LEGACY; SUSv3 removed it."
11264 msgstr ""
11265
11266 #. type: Plain text
11267 #: build/C/man2/wait4.2:159
11268 msgid ""
11269 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
11270 "portability.  (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
11271 "structure with fields of type I<struct timeval> defined in "
11272 "I<E<lt>sys/time.hE<gt>>.)"
11273 msgstr ""
11274
11275 #. type: Plain text
11276 #: build/C/man2/wait4.2:165
11277 msgid ""
11278 "On Linux, B<wait3>()  is a library function implemented on top of the "
11279 "B<wait4>()  system call."
11280 msgstr ""
11281
11282 #. type: Plain text
11283 #: build/C/man2/wait4.2:172
11284 msgid ""
11285 "B<fork>(2), B<getrusage>(2), B<sigaction>(2), B<signal>(2), B<wait>(2), "
11286 "B<signal>(7)"
11287 msgstr ""