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.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2013-08-15 19:32+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"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man3/bsd_signal.3:25
26 #: build/C/man3/bsd_signal.3:25
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
34 msgid "Linux Programmer's Manual"
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
44 #: build/C/man3/bsd_signal.3:28
45 msgid "bsd_signal - signal handling with BSD semantics"
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
55 #: build/C/man3/bsd_signal.3:30
56 msgid "B<#define _XOPEN_SOURCE> /* See feature_test_macros(7) */"
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>>"
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);>"
70 #: build/C/man3/bsd_signal.3:36
71 msgid "B<sighandler_t bsd_signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
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:81 build/C/man2/wait4.2:67
81 #: build/C/man3/bsd_signal.3:41
83 "The B<bsd_signal>() function takes the same arguments, and performs the "
84 "same task, as B<signal>(2)."
88 #: build/C/man3/bsd_signal.3:54
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."
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:99 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:353 build/C/man2/wait4.2:132
106 #: build/C/man3/bsd_signal.3:60
108 "The B<bsd_signal>() function returns the previous value of the signal "
109 "handler, or B<SIG_ERR> on error."
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:104 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:382 build/C/man2/wait4.2:135
119 #: build/C/man3/bsd_signal.3:63 build/C/man3/sysv_signal.3:60
120 msgid "As for B<signal>(2)."
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:120 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:420 build/C/man2/wait4.2:138
126 msgid "CONFORMING TO"
130 #: build/C/man3/bsd_signal.3:70
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."
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:122 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:422 build/C/man2/wait4.2:147
143 #: build/C/man3/bsd_signal.3:76
144 msgid "Use of B<bsd_signal>() should be avoided; use B<sigaction>(2) instead."
148 #: build/C/man3/bsd_signal.3:87
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."
156 #: build/C/man3/bsd_signal.3:94 build/C/man3/sysv_signal.3:87
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."
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:170 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:619 build/C/man2/wait4.2:165
169 #: build/C/man3/bsd_signal.3:99
170 msgid "B<sigaction>(2), B<signal>(2), B<sysv_signal>(3), B<signal>(7)"
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:180 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:631 build/C/man2/wait4.2:172
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:187 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:638 build/C/man2/wait4.2:179
182 "This page is part of release 3.53 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/."
188 #: build/C/man2/eventfd.2:22
194 #: build/C/man2/eventfd.2:22
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
206 #: build/C/man2/eventfd.2:25
207 msgid "eventfd - create a file descriptor for event notification"
211 #: build/C/man2/eventfd.2:27
212 msgid "B<#include E<lt>sys/eventfd.hE<gt>>"
216 #: build/C/man2/eventfd.2:29
217 msgid "B<int eventfd(unsigned int >I<initval>B<, int >I<flags>B<);>"
221 #: build/C/man2/eventfd.2:39
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 "
232 #: build/C/man2/eventfd.2:44
234 "The following values may be bitwise ORed in I<flags> to change the behaviour "
239 #: build/C/man2/eventfd.2:44
241 msgid "B<EFD_CLOEXEC> (since Linux 2.6.27)"
245 #: build/C/man2/eventfd.2:54 build/C/man2/signalfd.2:95 build/C/man2/timerfd_create.2:103
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 "
253 #: build/C/man2/eventfd.2:54
255 msgid "B<EFD_NONBLOCK> (since Linux 2.6.27)"
259 #: build/C/man2/eventfd.2:62 build/C/man2/signalfd.2:85 build/C/man2/timerfd_create.2:93
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 "
267 #: build/C/man2/eventfd.2:62
269 msgid "B<EFD_SEMAPHORE> (since Linux 2.6.30)"
273 #: build/C/man2/eventfd.2:66
275 "Provide semaphore-like semantics for reads from the new file descriptor. "
280 #: build/C/man2/eventfd.2:70 build/C/man2/signalfd.2:99
282 "In Linux up to version 2.6.26, the I<flags> argument is unused, and must be "
287 #: build/C/man2/eventfd.2:76
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:"
295 #: build/C/man2/eventfd.2:76 build/C/man2/signalfd.2:102 build/C/man2/timerfd_create.2:211
301 #: build/C/man2/eventfd.2:86
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 "
309 #: build/C/man2/eventfd.2:91
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."
316 #: build/C/man2/eventfd.2:98
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:"
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
330 #: build/C/man2/eventfd.2:106
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."
338 #: build/C/man2/eventfd.2:113
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."
346 #: build/C/man2/eventfd.2:123
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."
355 #: build/C/man2/eventfd.2:124
361 #: build/C/man2/eventfd.2:141
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."
373 #: build/C/man2/eventfd.2:148
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."
381 #: build/C/man2/eventfd.2:148 build/C/man2/signalfd.2:140 build/C/man2/timerfd_create.2:244
383 msgid "B<poll>(2), B<select>(2) (and similar)"
387 #: build/C/man2/eventfd.2:157
389 "The returned file descriptor supports B<poll>(2) (and analogously "
390 "B<epoll>(7)) and B<select>(2), as follows:"
394 #: build/C/man2/eventfd.2:168
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."
401 #: build/C/man2/eventfd.2:178
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."
409 #: build/C/man2/eventfd.2:198
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)."
422 #: build/C/man2/eventfd.2:205
424 "The eventfd file descriptor also supports the other file-descriptor "
425 "multiplexing APIs: B<pselect>(2) and B<ppoll>(2)."
429 #: build/C/man2/eventfd.2:205 build/C/man2/signalfd.2:160 build/C/man2/timerfd_create.2:262
435 #: build/C/man2/eventfd.2:210
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."
443 #: build/C/man2/eventfd.2:222
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."
452 #: build/C/man2/eventfd.2:229
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."
459 #: build/C/man2/eventfd.2:230 build/C/man2/getitimer.2:135 build/C/man2/kill.2:105 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:415
465 #: build/C/man2/eventfd.2:234
466 msgid "An unsupported value was specified in I<flags>."
470 #: build/C/man2/eventfd.2:234 build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:320
476 #: build/C/man2/eventfd.2:237
477 msgid "The per-process limit on open file descriptors has been reached."
481 #: build/C/man2/eventfd.2:237 build/C/man2/signalfd.2:289 build/C/man2/timerfd_create.2:323
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."
492 #: build/C/man2/eventfd.2:241 build/C/man2/signalfd.2:293 build/C/man2/timerfd_create.2:327
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."
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
509 #: build/C/man2/eventfd.2:253
510 msgid "There was insufficient memory to create a new eventfd file descriptor."
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
519 #. eventfd() is in glibc 2.7, but reportedly does not build
521 #: build/C/man2/eventfd.2:266
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."
531 #: build/C/man2/eventfd.2:271
532 msgid "B<eventfd>() and B<eventfd2>() are Linux-specific."
536 #: build/C/man2/eventfd.2:279
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 "
545 #. or eventually syslets/threadlets
547 #: build/C/man2/eventfd.2:285
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 "
556 #: build/C/man2/eventfd.2:302
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).)"
568 #: build/C/man2/eventfd.2:302 build/C/man2/signalfd.2:336
570 msgid "Underlying Linux system calls"
574 #: build/C/man2/eventfd.2:316
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 "
584 #: build/C/man2/eventfd.2:316
586 msgid "Additional glibc features"
590 #: build/C/man2/eventfd.2:320
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 "
598 #: build/C/man2/eventfd.2:324
600 msgid "typedef uint64_t eventfd_t;\n"
604 #: build/C/man2/eventfd.2:327
607 "int eventfd_read(int fd, eventfd_t *value);\n"
608 "int eventfd_write(int fd, eventfd_t value);\n"
612 #: build/C/man2/eventfd.2:334
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 "
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:536
626 #: build/C/man2/eventfd.2:343
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."
636 #: build/C/man2/eventfd.2:345
637 msgid "The following shell session shows a sample run of the program:"
641 #: build/C/man2/eventfd.2:357
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"
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:571
658 msgid "Program source"
662 #: build/C/man2/eventfd.2:367
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"
673 #: build/C/man2/eventfd.2:370 build/C/man2/signalfd.2:394
676 "#define handle_error(msg) \\e\n"
677 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
681 #: build/C/man2/eventfd.2:377
685 "main(int argc, char *argv[])\n"
693 #: build/C/man2/eventfd.2:382
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"
703 #: build/C/man2/eventfd.2:386
706 " efd = eventfd(0, 0);\n"
708 " handle_error(\"eventfd\");\n"
712 #: build/C/man2/eventfd.2:398
715 " switch (fork()) {\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"
725 " printf(\"Child completed write loop\\en\");\n"
729 #: build/C/man2/eventfd.2:400
731 msgid " exit(EXIT_SUCCESS);\n"
735 #: build/C/man2/eventfd.2:403
743 #: build/C/man2/eventfd.2:411
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"
756 #: build/C/man2/eventfd.2:416
760 " handle_error(\"fork\");\n"
766 #: build/C/man2/eventfd.2:428
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), "
774 #: build/C/man2/getitimer.2:12
780 #: build/C/man2/getitimer.2:12
786 #: build/C/man2/getitimer.2:15
787 msgid "getitimer, setitimer - get or set value of an interval timer"
791 #: build/C/man2/getitimer.2:18
793 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
797 #: build/C/man2/getitimer.2:20
799 msgid "B<int getitimer(int >I<which>B<, struct itimerval *>I<curr_value>B<);>\n"
803 #: build/C/man2/getitimer.2:23
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"
811 #: build/C/man2/getitimer.2:29
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."
819 #: build/C/man2/getitimer.2:29
821 msgid "B<ITIMER_REAL>"
825 #: build/C/man2/getitimer.2:34
826 msgid "decrements in real time, and delivers B<SIGALRM> upon expiration."
830 #: build/C/man2/getitimer.2:34
832 msgid "B<ITIMER_VIRTUAL>"
836 #: build/C/man2/getitimer.2:39
838 "decrements only when the process is executing, and delivers B<SIGVTALRM> "
843 #: build/C/man2/getitimer.2:39
845 msgid "B<ITIMER_PROF>"
849 #: build/C/man2/getitimer.2:49
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."
858 #: build/C/man2/getitimer.2:51
859 msgid "Timer values are defined by the following structures:"
863 #: build/C/man2/getitimer.2:59
866 "struct itimerval {\n"
867 " struct timeval it_interval; /* next value */\n"
868 " struct timeval it_value; /* current value */\n"
873 #: build/C/man2/getitimer.2:64
877 " time_t tv_sec; /* seconds */\n"
878 " suseconds_t tv_usec; /* microseconds */\n"
883 #: build/C/man2/getitimer.2:86
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."
893 #: build/C/man2/getitimer.2:94
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 "
901 #: build/C/man2/getitimer.2:104
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."
909 #: build/C/man2/getitimer.2:110
911 "Both I<tv_sec> and I<tv_usec> are significant in determining the duration of "
916 #: build/C/man2/getitimer.2:122
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."
928 #: build/C/man2/getitimer.2:127 build/C/man2/killpg.2:94 build/C/man2/tkill.2:99
930 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
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
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."
946 #: build/C/man2/getitimer.2:148
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."
954 #: build/C/man2/getitimer.2:158
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."
963 #: build/C/man2/getitimer.2:164
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)."
970 #: build/C/man2/getitimer.2:174
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."
977 #: build/C/man2/getitimer.2:176
978 msgid "The standards are silent on the meaning of the call:"
982 #: build/C/man2/getitimer.2:178
984 msgid " setitimer(which, NULL, &old_value);\n"
988 #: build/C/man2/getitimer.2:181
990 "Many systems (Solaris, the BSDs, and perhaps others) treat this as "
995 #: build/C/man2/getitimer.2:183
997 msgid " getitimer(which, &old_value);\n"
1001 #: build/C/man2/getitimer.2:189
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."
1009 #: build/C/man2/getitimer.2:189 build/C/man2/kill.2:160 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:521
1015 #: build/C/man2/getitimer.2:198
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."
1025 #: build/C/man2/getitimer.2:213
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."
1037 #. 4 Jul 2005: It looks like this bug may remain in 2.4.x.
1038 #. http://lkml.org/lkml/2005/7/1/165
1040 #: build/C/man2/getitimer.2:220
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."
1047 #. Bugzilla report 25 Apr 2006:
1048 #. http://bugzilla.kernel.org/show_bug.cgi?id=6443
1049 #. "setitimer() should reject noncanonical arguments"
1051 #: build/C/man2/getitimer.2:239
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."
1062 #: build/C/man2/getitimer.2:246
1064 "B<gettimeofday>(2), B<sigaction>(2), B<signal>(2), B<timer_create>(2), "
1065 "B<timerfd_create>(2), B<time>(7)"
1069 #: build/C/man3/gsignal.3:27
1075 #: build/C/man3/gsignal.3:27 build/C/man3/profil.3:28
1081 #: build/C/man3/gsignal.3:30
1082 msgid "gsignal, ssignal - software signal facility"
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
1088 msgid "B<#include E<lt>signal.hE<gt>>\n"
1092 #: build/C/man3/gsignal.3:35
1094 msgid "B<typedef void (*sighandler_t)(int);>\n"
1098 #: build/C/man3/gsignal.3:37
1100 msgid "B<int gsignal(int >I<signum>B<);>\n"
1104 #: build/C/man3/gsignal.3:39
1106 msgid "B<sighandler_t ssignal(int >I<signum>B<, sighandler_t >I<action>B<);>\n"
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:67 build/C/man2/wait4.2:53
1111 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1115 #: build/C/man3/gsignal.3:49
1116 msgid "B<gsignal>(), B<ssignal>(): _SVID_SOURCE"
1120 #: build/C/man3/gsignal.3:57
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), "
1128 #: build/C/man3/gsignal.3:95
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)."
1145 #: build/C/man3/gsignal.3:103
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 "
1154 #: build/C/man3/gsignal.3:107
1155 msgid "B<kill>(2), B<signal>(2), B<raise>(3)"
1159 #: build/C/man2/kill.2:44
1165 #: build/C/man2/kill.2:44
1171 #: build/C/man2/kill.2:47
1172 msgid "kill - send signal to a process"
1176 #: build/C/man2/kill.2:50
1178 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
1182 #: build/C/man2/kill.2:54
1184 msgid "B<int kill(pid_t >I<pid>B<, int >I<sig>B<);>\n"
1188 #: build/C/man2/kill.2:64
1189 msgid "B<kill>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1193 #: build/C/man2/kill.2:70
1195 "The B<kill>() system call can be used to send any signal to any process "
1200 #: build/C/man2/kill.2:73
1202 "If I<pid> is positive, then signal I<sig> is sent to the process with the ID "
1203 "specified by I<pid>."
1207 #: build/C/man2/kill.2:76
1209 "If I<pid> equals 0, then I<sig> is sent to every process in the process "
1210 "group of the calling process."
1214 #: build/C/man2/kill.2:80
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."
1222 #: build/C/man2/kill.2:83
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>."
1229 #: build/C/man2/kill.2:88
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 "
1237 #: build/C/man2/kill.2:99 build/C/man2/killpg.2:89
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."
1247 #: build/C/man2/kill.2:104
1249 "On success (at least one signal was sent), zero is returned. On error, -1 "
1250 "is returned, and I<errno> is set appropriately."
1254 #: build/C/man2/kill.2:108
1255 msgid "An invalid signal was specified."
1259 #: build/C/man2/kill.2:108 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
1265 #: build/C/man2/kill.2:112 build/C/man2/killpg.2:103
1267 "The process does not have permission to send the signal to any of the target "
1272 #: build/C/man2/kill.2:112 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
1278 #: build/C/man2/kill.2:120
1280 "The pid or process group does not exist. Note that an existing process "
1281 "might be a zombie, a process which already committed termination, but has "
1282 "not yet been B<wait>(2)ed for."
1286 #: build/C/man2/kill.2:122 build/C/man2/pause.2:59 build/C/man2/wait.2:422
1287 msgid "SVr4, 4.3BSD, POSIX.1-2001."
1291 #: build/C/man2/kill.2:130
1293 "The only signals that can be sent to process ID 1, the I<init> process, are "
1294 "those for which I<init> has explicitly installed signal handlers. This is "
1295 "done to assure the system is not brought down accidentally."
1299 #: build/C/man2/kill.2:136
1301 "POSIX.1-2001 requires that I<kill(-1,sig)> send I<sig> to all processes that "
1302 "the calling process may send signals to, except possibly for some "
1303 "implementation-defined system processes. Linux allows a process to signal "
1304 "itself, but on Linux the call I<kill(-1,sig)> does not signal the calling "
1309 #: build/C/man2/kill.2:146
1311 "POSIX.1-2001 requires that if a process sends a signal to itself, and the "
1312 "sending thread does not have the signal blocked, and no other thread has it "
1313 "unblocked or is waiting for it in B<sigwait>(3), at least one unblocked "
1314 "signal must be delivered to the sending thread before the B<kill>() "
1319 #: build/C/man2/kill.2:146 build/C/man3/sigpause.3:77 build/C/man2/wait.2:476
1324 #. In the 0.* kernels things chopped and changed quite
1325 #. a bit - MTK, 24 Jul 02
1327 #: build/C/man2/kill.2:160
1329 "Across different kernel versions, Linux has enforced different rules for the "
1330 "permissions required for an unprivileged process to send a signal to another "
1331 "process. In kernels 1.0 to 1.2.2, a signal could be sent if the effective "
1332 "user ID of the sender matched that of the receiver, or the real user ID of "
1333 "the sender matched that of the receiver. From kernel 1.2.3 until 1.3.77, a "
1334 "signal could be sent if the effective user ID of the sender matched either "
1335 "the real or effective user ID of the receiver. The current rules, which "
1336 "conform to POSIX.1-2001, were adopted in kernel 1.3.78."
1340 #: build/C/man2/kill.2:170
1342 "In 2.6 kernels up to and including 2.6.7, there was a bug that meant that "
1343 "when sending signals to a process group, B<kill>() failed with the error "
1344 "B<EPERM> if the caller did not have permission to send the signal to I<any> "
1345 "(rather than I<all>) of the members of the process group. Notwithstanding "
1346 "this error return, the signal was still delivered to all of the processes "
1347 "for which the caller had permission to signal."
1351 #: build/C/man2/kill.2:180
1353 "B<_exit>(2), B<killpg>(2), B<signal>(2), B<tkill>(2), B<exit>(3), "
1354 "B<sigqueue>(3), B<capabilities>(7), B<credentials>(7), B<signal>(7)"
1358 #: build/C/man2/killpg.2:42
1364 #: build/C/man2/killpg.2:42 build/C/man3/sigset.3:26
1370 #: build/C/man2/killpg.2:45
1371 msgid "killpg - send signal to a process group"
1375 #: build/C/man2/killpg.2:49
1376 msgid "B<int killpg(int >I<pgrp>B<, int >I<sig>B<);>"
1380 #: build/C/man2/killpg.2:55
1382 msgid "B<killpg>():"
1386 #: 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 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
1389 "_XOPEN_SOURCE_EXTENDED"
1393 #: build/C/man2/killpg.2:69
1395 "B<killpg>() sends the signal I<sig> to the process group I<pgrp>. See "
1396 "B<signal>(7) for a list of signals."
1400 #: build/C/man2/killpg.2:78
1402 "If I<pgrp> is 0, B<killpg>() sends the signal to the calling process's "
1403 "process group. (POSIX says: If I<pgrp> is less than or equal to 1, the "
1404 "behavior is undefined.)"
1408 #: build/C/man2/killpg.2:99
1409 msgid "I<sig> is not a valid signal number."
1413 #: build/C/man2/killpg.2:107
1414 msgid "No process can be found in the process group specified by I<pgrp>."
1418 #: build/C/man2/killpg.2:111
1420 "The process group was given as 0 but the sending process does not have a "
1425 #: build/C/man2/killpg.2:115
1427 "SVr4, 4.4BSD (the B<killpg>() function call first appeared in 4BSD), "
1432 #: build/C/man2/killpg.2:129
1434 "There are various differences between the permission checking in BSD-type "
1435 "systems and System V-type systems. See the POSIX rationale for B<kill>(). "
1436 "A difference not mentioned by POSIX concerns the return value B<EPERM>: BSD "
1437 "documents that no signal is sent and B<EPERM> returned when the permission "
1438 "check failed for at least one target process, while POSIX documents B<EPERM> "
1439 "only when the permission check failed for all target processes."
1443 #: build/C/man2/killpg.2:134
1445 "On Linux, B<killpg>() is implemented as a library function that makes the "
1446 "call I<kill(-pgrp,\\ sig)>."
1450 #: build/C/man2/killpg.2:140
1452 "B<getpgrp>(2), B<kill>(2), B<signal>(2), B<capabilities>(7), "
1457 #: build/C/man2/pause.2:30
1463 #: build/C/man2/pause.2:30
1469 #: build/C/man2/pause.2:33
1470 msgid "pause - wait for signal"
1474 #: build/C/man2/pause.2:35
1475 msgid "B<#include E<lt>unistd.hE<gt>>"
1479 #: build/C/man2/pause.2:37
1480 msgid "B<int pause(void);>"
1484 #: build/C/man2/pause.2:42
1486 "B<pause>() causes the calling process (or thread) to sleep until a signal "
1487 "is delivered that either terminates the process or causes the invocation of "
1488 "a signal-catching function."
1491 #. .BR ERESTARTNOHAND .
1493 #: build/C/man2/pause.2:53
1495 "B<pause>() returns only when a signal was caught and the signal-catching "
1496 "function returned. In this case B<pause>() returns -1, and I<errno> is set "
1501 #: build/C/man2/pause.2:54 build/C/man2/sigsuspend.2:81 build/C/man2/sigwaitinfo.2:123 build/C/man2/wait.2:408
1507 #: build/C/man2/pause.2:57
1508 msgid "a signal was caught and the signal-catching function returned."
1512 #: build/C/man2/pause.2:64
1513 msgid "B<kill>(2), B<select>(2), B<signal>(2), B<sigsuspend>(2)"
1517 #: build/C/man2/prctl.2:52
1523 #: build/C/man2/prctl.2:52
1529 #: build/C/man2/prctl.2:55
1530 msgid "prctl - operations on a process"
1534 #: build/C/man2/prctl.2:58
1536 msgid "B<#include E<lt>sys/prctl.hE<gt>>\n"
1540 #: build/C/man2/prctl.2:61
1543 "B<int prctl(int >I<option>B<, unsigned long >I<arg2>B<, unsigned long "
1545 "B< unsigned long >I<arg4>B<, unsigned long >I<arg5>B<);>\n"
1549 #: build/C/man2/prctl.2:68
1551 "B<prctl>() is called with a first argument describing what to do (with "
1552 "values defined in I<E<lt>linux/prctl.hE<gt>>), and further arguments with a "
1553 "significance depending on the first one. The first argument can be:"
1557 #: build/C/man2/prctl.2:68
1559 msgid "B<PR_CAPBSET_READ> (since Linux 2.6.25)"
1563 #: build/C/man2/prctl.2:80
1565 "Return (as the function result) 1 if the capability specified in I<arg2> is "
1566 "in the calling thread's capability bounding set, or 0 if it is not. (The "
1567 "capability constants are defined in I<E<lt>linux/capability.hE<gt>>.) The "
1568 "capability bounding set dictates whether the process can receive the "
1569 "capability through a file's permitted capability set on a subsequent call to "
1574 #: build/C/man2/prctl.2:85
1576 "If the capability specified in I<arg2> is not valid, then the call fails "
1577 "with the error B<EINVAL>."
1581 #: build/C/man2/prctl.2:85
1583 msgid "B<PR_CAPBSET_DROP> (since Linux 2.6.25)"
1587 #: build/C/man2/prctl.2:94
1589 "If the calling thread has the B<CAP_SETPCAP> capability, then drop the "
1590 "capability specified by I<arg2> from the calling thread's capability "
1591 "bounding set. Any children of the calling thread will inherit the newly "
1592 "reduced bounding set."
1596 #: build/C/man2/prctl.2:106
1598 "The call fails with the error: B<EPERM> if the calling thread does not have "
1599 "the B<CAP_SETPCAP>; B<EINVAL> if I<arg2> does not represent a valid "
1600 "capability; or B<EINVAL> if file capabilities are not enabled in the kernel, "
1601 "in which case bounding sets are not supported."
1605 #: build/C/man2/prctl.2:106
1607 msgid "B<PR_SET_CHILD_SUBREAPER> (since Linux 3.4)"
1610 #. commit ebec18a6d3aa1e7d84aab16225e87fd25170ec2b
1612 #: build/C/man2/prctl.2:131
1614 "If I<arg2> is nonzero, set the \"child subreaper\" attribute of the calling "
1615 "process; if I<arg2> is zero, unset the attribute. When a process is marked "
1616 "as a child subreaper, all of the children that it creates, and their "
1617 "descendants, will be marked as having a subreaper. In effect, a subreaper "
1618 "fulfills the role of B<init>(1) for its descendant processes. Upon "
1619 "termination of a process that is orphaned (i.e., its immediate parent has "
1620 "already terminated) and marked as having a subreaper, the nearest still "
1621 "living ancestor subreaper will receive a B<SIGCHLD> signal and be able to "
1622 "B<wait>(2) on the process to discover its termination status."
1626 #: build/C/man2/prctl.2:131
1628 msgid "B<PR_GET_CHILD_SUBREAPER> (since Linux 3.4)"
1632 #: build/C/man2/prctl.2:136
1634 "Return the \"child subreaper\" setting of the caller, in the location "
1635 "pointed to by I<(int\\ *) arg2>."
1639 #: build/C/man2/prctl.2:136
1641 msgid "B<PR_SET_DUMPABLE> (since Linux 2.3.20)"
1644 #. See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2
1645 #. Subject: Fix prctl privilege escalation (CVE-2006-2451)
1646 #. From: Marcel Holtmann <marcel () holtmann ! org>
1647 #. Date: 2006-07-12 11:12:00
1649 #: build/C/man2/prctl.2:162
1651 "Set the state of the flag determining whether core dumps are produced for "
1652 "the calling process upon delivery of a signal whose default behavior is to "
1653 "produce a core dump. (Normally, this flag is set for a process by default, "
1654 "but it is cleared when a set-user-ID or set-group-ID program is executed and "
1655 "also by various system calls that manipulate process UIDs and GIDs). In "
1656 "kernels up to and including 2.6.12, I<arg2> must be either 0 (process is not "
1657 "dumpable) or 1 (process is dumpable). Between kernels 2.6.13 and 2.6.17, "
1658 "the value 2 was also permitted, which caused any binary which normally would "
1659 "not be dumped to be dumped readable by root only; for security reasons, this "
1660 "feature has been removed. (See also the description of "
1661 "I</proc/sys/fs/suid_dumpable> in B<proc>(5).) Processes that are not "
1662 "dumpable can not be attached via B<ptrace>(2) B<PTRACE_ATTACH>."
1666 #: build/C/man2/prctl.2:162
1668 msgid "B<PR_GET_DUMPABLE> (since Linux 2.3.20)"
1671 #. Since Linux 2.6.13, the dumpable flag can have the value 2,
1672 #. but in 2.6.13 PR_GET_DUMPABLE simply returns 1 if the dumpable
1673 #. flags has a nonzero value. This was fixed in 2.6.14.
1675 #: build/C/man2/prctl.2:169
1677 "Return (as the function result) the current state of the calling process's "
1682 #: build/C/man2/prctl.2:169
1684 msgid "B<PR_SET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1687 #. Respectively 0, 1, 2
1689 #: build/C/man2/prctl.2:179
1691 "Set the endian-ness of the calling process to the value given in I<arg2>, "
1692 "which should be one of the following: B<PR_ENDIAN_BIG>, B<PR_ENDIAN_LITTLE>, "
1693 "or B<PR_ENDIAN_PPC_LITTLE> (PowerPC pseudo little endian)."
1697 #: build/C/man2/prctl.2:179
1699 msgid "B<PR_GET_ENDIAN> (since Linux 2.6.18, PowerPC only)"
1703 #: build/C/man2/prctl.2:184
1705 "Return the endian-ness of the calling process, in the location pointed to by "
1706 "I<(int\\ *) arg2>."
1710 #: build/C/man2/prctl.2:184
1712 msgid "B<PR_SET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1716 #: build/C/man2/prctl.2:191
1718 "Set floating-point emulation control bits to I<arg2>. Pass "
1719 "B<PR_FPEMU_NOPRINT> to silently emulate fp operations accesses, or "
1720 "B<PR_FPEMU_SIGFPE> to not emulate fp operations and send B<SIGFPE> instead."
1724 #: build/C/man2/prctl.2:191
1726 msgid "B<PR_GET_FPEMU> (since Linux 2.4.18, 2.5.9, only on ia64)"
1730 #: build/C/man2/prctl.2:196
1732 "Return floating-point emulation control bits, in the location pointed to by "
1733 "I<(int\\ *) arg2>."
1737 #: build/C/man2/prctl.2:196
1739 msgid "B<PR_SET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1743 #: build/C/man2/prctl.2:209
1745 "Set floating-point exception mode to I<arg2>. Pass B<PR_FP_EXC_SW_ENABLE> "
1746 "to use FPEXC for FP exception enables, B<PR_FP_EXC_DIV> for floating-point "
1747 "divide by zero, B<PR_FP_EXC_OVF> for floating-point overflow, "
1748 "B<PR_FP_EXC_UND> for floating-point underflow, B<PR_FP_EXC_RES> for "
1749 "floating-point inexact result, B<PR_FP_EXC_INV> for floating-point invalid "
1750 "operation, B<PR_FP_EXC_DISABLED> for FP exceptions disabled, "
1751 "B<PR_FP_EXC_NONRECOV> for async nonrecoverable exception mode, "
1752 "B<PR_FP_EXC_ASYNC> for async recoverable exception mode, "
1753 "B<PR_FP_EXC_PRECISE> for precise exception mode."
1757 #: build/C/man2/prctl.2:209
1759 msgid "B<PR_GET_FPEXC> (since Linux 2.4.21, 2.5.32, only on PowerPC)"
1763 #: build/C/man2/prctl.2:214
1765 "Return floating-point exception mode, in the location pointed to by I<(int\\ "
1770 #: build/C/man2/prctl.2:214
1772 msgid "B<PR_SET_KEEPCAPS> (since Linux 2.2.18)"
1776 #: build/C/man2/prctl.2:232
1778 "Set the state of the thread's \"keep capabilities\" flag, which determines "
1779 "whether the threads's permitted capability set is cleared when a change is "
1780 "made to the threads's user IDs such that the threads's real UID, effective "
1781 "UID, and saved set-user-ID all become nonzero when at least one of them "
1782 "previously had the value 0. By default, the permitted capability set is "
1783 "cleared when such a change is made; setting the \"keep capabilities\" flag "
1784 "prevents it from being cleared. I<arg2> must be either 0 (permitted "
1785 "capabilities are cleared) or 1 (permitted capabilities are kept). (A "
1786 "thread's I<effective> capability set is always cleared when such a "
1787 "credential change is made, regardless of the setting of the \"keep "
1788 "capabilities\" flag.) The \"keep capabilities\" value will be reset to 0 on "
1789 "subsequent calls to B<execve>(2)."
1793 #: build/C/man2/prctl.2:232
1795 msgid "B<PR_GET_KEEPCAPS> (since Linux 2.2.18)"
1799 #: build/C/man2/prctl.2:236
1801 "Return (as the function result) the current state of the calling threads's "
1802 "\"keep capabilities\" flag."
1806 #: build/C/man2/prctl.2:236
1808 msgid "B<PR_SET_NAME> (since Linux 2.6.9)"
1811 #. TASK_COMM_LEN in include/linux/sched.h
1813 #: build/C/man2/prctl.2:253
1815 "Set the name of the calling thread, using the value in the location pointed "
1816 "to by I<(char\\ *) arg2>. The name can be up to 16 bytes long, and should "
1817 "be null-terminated if it contains fewer bytes. This is the same attribute "
1818 "that can be set via B<pthread_setname_np>(3) and retrieved using "
1819 "B<pthread_getname_np>(3). The attribute is likewise accessible via "
1820 "I</proc/self/task/[tid]/comm>, where I<tid> is the name of the calling "
1825 #: build/C/man2/prctl.2:253
1827 msgid "B<PR_GET_NAME> (since Linux 2.6.11)"
1831 #: build/C/man2/prctl.2:260
1833 "Return the name of the calling thread, in the buffer pointed to by I<(char\\ "
1834 "*) arg2>. The buffer should allow space for up to 16 bytes; the returned "
1835 "string will be null-terminated if it is shorter than that."
1839 #: build/C/man2/prctl.2:260
1841 msgid "B<PR_SET_NO_NEW_PRIVS> (since Linux 3.5)"
1845 #: build/C/man2/prctl.2:283
1847 "Set the calling process's I<no_new_privs> bit to the value in I<arg2>. With "
1848 "I<no_new_privs> set to 1, B<execve>(2) promises not to grant privileges to "
1849 "do anything that could not have been done without the B<execve>(2) call "
1850 "(for example, rendering the set-user-ID and set-group-ID permission bits, "
1851 "and file capabilities non-functional). Once set, this bit cannot be unset. "
1852 "The setting of this bit is inherited by children created by B<fork>(2) and "
1853 "B<clone>(2), and preserved across B<execve>(2)."
1857 #: build/C/man2/prctl.2:286
1859 "For more information, see the kernel source file "
1860 "I<Documentation/prctl/no_new_privs.txt>."
1864 #: build/C/man2/prctl.2:286
1866 msgid "B<PR_GET_NO_NEW_PRIVS> (since Linux 3.5)"
1870 #: build/C/man2/prctl.2:297
1872 "Return the value of the I<no_new_privs> bit for the current process. A "
1873 "value of 0 indicates the regular B<execve>(2) behavior. A value of 1 "
1874 "indicates B<execve>(2) will operate in the privilege-restricting mode "
1879 #: build/C/man2/prctl.2:297
1881 msgid "B<PR_SET_PDEATHSIG> (since Linux 2.1.57)"
1885 #: build/C/man2/prctl.2:308
1887 "Set the parent process death signal of the calling process to I<arg2> "
1888 "(either a signal value in the range 1..maxsig, or 0 to clear). This is the "
1889 "signal that the calling process will get when its parent dies. This value "
1890 "is cleared for the child of a B<fork>(2) and (since Linux 2.4.36 / 2.6.23) "
1891 "when executing a set-user-ID or set-group-ID binary."
1895 #: build/C/man2/prctl.2:308
1897 msgid "B<PR_GET_PDEATHSIG> (since Linux 2.3.15)"
1901 #: build/C/man2/prctl.2:313
1903 "Return the current value of the parent process death signal, in the location "
1904 "pointed to by I<(int\\ *) arg2>."
1908 #: build/C/man2/prctl.2:313
1910 msgid "B<PR_SET_PTRACER> (since Linux 3.4)"
1913 #. commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
1914 #. commit bf06189e4d14641c0148bea16e9dd24943862215
1916 #: build/C/man2/prctl.2:338
1918 "This is meaningful only when the Yama LSM is enabled and in mode 1 "
1919 "(\"restricted ptrace\", visible via I</proc/sys/kernel/yama/ptrace_scope>). "
1920 "When a \"ptracer process ID\" is passed in I<arg2>, the caller is declaring "
1921 "that the ptracer process can B<ptrace>(2) the calling process as if it were "
1922 "a direct process ancestor. Each B<PR_SET_PTRACER> operation replaces the "
1923 "previous \"ptracer process ID\". Employing B<PR_SET_PTRACER> with I<arg2> "
1924 "set to 0 clears the caller's \"ptracer process ID\". If I<arg2> is "
1925 "B<PR_SET_PTRACER_ANY,> the ptrace restrictions introduced by Yama are "
1926 "effectively disabled for the calling process."
1930 #: build/C/man2/prctl.2:341
1932 "For further information, see the kernel source file "
1933 "I<Documentation/security/Yama.txt>."
1937 #: build/C/man2/prctl.2:341
1939 msgid "B<PR_SET_SECCOMP> (since Linux 2.6.23)"
1942 #. See http://thread.gmane.org/gmane.linux.kernel/542632
1943 #. [PATCH 0 of 2] seccomp updates
1944 #. andrea@cpushare.com
1946 #: build/C/man2/prctl.2:352
1948 "Set the secure computing (seccomp) mode for the calling thread, to limit the "
1949 "available system calls. The seccomp mode is selected via I<arg2>. (The "
1950 "seccomp constants are defined in I<E<lt>linux/seccomp.hE<gt>>.)"
1954 #: build/C/man2/prctl.2:373
1956 "With I<arg2> set to B<SECCOMP_MODE_STRICT> the only system calls that the "
1957 "thread is permitted to make are B<read>(2), B<write>(2), B<_exit>(2), and "
1958 "B<sigreturn>(2). Other system calls result in the delivery of a B<SIGKILL> "
1959 "signal. Strict secure computing mode is useful for number-crunching "
1960 "applications that may need to execute untrusted byte code, perhaps obtained "
1961 "by reading from a pipe or socket. This operation is available only if the "
1962 "kernel is configured with B<CONFIG_SECCOMP> enabled."
1966 #: build/C/man2/prctl.2:388
1968 "With I<arg2> set to B<SECCOMP_MODE_FILTER> (since Linux 3.5) the system "
1969 "calls allowed are defined by a pointer to a Berkeley Packet Filter passed in "
1970 "I<arg3>. This argument is a pointer to I<struct sock_fprog>; it can be "
1971 "designed to filter arbitrary system calls and system call arguments. This "
1972 "mode is available only if the kernel is configured with "
1973 "B<CONFIG_SECCOMP_FILTER> enabled."
1977 #: build/C/man2/prctl.2:403
1979 "If B<SECCOMP_MODE_FILTER> filters permit B<fork>(2), then the seccomp mode "
1980 "is inherited by children created by B<fork>(2); if B<execve>(2) is "
1981 "permitted, then the seccomp mode is preserved across B<execve>(2). If the "
1982 "filters permit B<prctl>() calls, then additional filters can be added; they "
1983 "are run in order until the first non-allow result is seen."
1987 #: build/C/man2/prctl.2:406
1989 "For further information, see the kernel source file "
1990 "I<Documentation/prctl/seccomp_filter.txt>."
1994 #: build/C/man2/prctl.2:406
1996 msgid "B<PR_GET_SECCOMP> (since Linux 2.6.23)"
2000 #: build/C/man2/prctl.2:421
2002 "Return the secure computing mode of the calling thread. If the caller is "
2003 "not in secure computing mode, this operation returns 0; if the caller is in "
2004 "strict secure computing mode, then the B<prctl>() call will cause a "
2005 "B<SIGKILL> signal to be sent to the process. If the caller is in filter "
2006 "mode, and this system call is allowed by the seccomp filters, it returns 2. "
2007 "This operation is available only if the kernel is configured with "
2008 "B<CONFIG_SECCOMP> enabled."
2012 #: build/C/man2/prctl.2:421
2014 msgid "B<PR_SET_SECUREBITS> (since Linux 2.6.26)"
2018 #: build/C/man2/prctl.2:427
2020 "Set the \"securebits\" flags of the calling thread to the value supplied in "
2021 "I<arg2>. See B<capabilities>(7)."
2025 #: build/C/man2/prctl.2:427
2027 msgid "B<PR_GET_SECUREBITS> (since Linux 2.6.26)"
2031 #: build/C/man2/prctl.2:433
2033 "Return (as the function result) the \"securebits\" flags of the calling "
2034 "thread. See B<capabilities>(7)."
2038 #: build/C/man2/prctl.2:433
2040 msgid "B<PR_GET_TID_ADDRESS> (since Linux 3.5)"
2043 #. commit 300f786b2683f8bb1ec0afb6e1851183a479c86d
2045 #: build/C/man2/prctl.2:448
2047 "Retrieve the I<clear_child_tid> address set by B<set_tid_address>(2) and "
2048 "the B<clone>(2) B<CLONE_CHILD_CLEARTID> flag, in the location pointed to by "
2049 "I<(int\\ **)\\ arg2>. This feature is available only if the kernel is built "
2050 "with the B<CONFIG_CHECKPOINT_RESTORE> option enabled."
2054 #: build/C/man2/prctl.2:448
2056 msgid "B<PR_SET_TIMERSLACK> (since Linux 2.6.28)"
2059 #. See https://lwn.net/Articles/369549/
2060 #. commit 6976675d94042fbd446231d1bd8b7de71a980ada
2061 #. It seems that it's not possible to set the timer slack to zero;
2062 #. The minimum value is 1? Seems a little strange.
2064 #: build/C/man2/prctl.2:467
2066 "Set the current timer slack for the calling thread to the nanosecond value "
2067 "supplied in I<arg2>. If I<arg2> is less than or equal to zero, reset the "
2068 "current timer slack to the thread's default timer slack value. The timer "
2069 "slack is used by the kernel to group timer expirations for the calling "
2070 "thread that are close to one another; as a consequence, timer expirations "
2071 "for the thread may be up to the specified number of nanoseconds late (but "
2072 "will never expire early). Grouping timer expirations can help reduce system "
2073 "power consumption by minimizing CPU wake-ups."
2076 #. List obtained by grepping for futex usage in glibc source
2078 #: build/C/man2/prctl.2:487
2080 "The timer expirations affected by timer slack are those set by B<select>(2), "
2081 "B<pselect>(2), B<poll>(2), B<ppoll>(2), B<epoll_wait>(2), B<epoll_pwait>(2), "
2082 "B<clock_nanosleep>(2), B<nanosleep>(2), and B<futex>(2) (and thus the "
2083 "library functions implemented via futexes, including "
2084 "B<pthread_cond_timedwait>(3), B<pthread_mutex_timedlock>(3), "
2085 "B<pthread_rwlock_timedrdlock>(3), B<pthread_rwlock_timedwrlock>(3), and "
2086 "B<sem_timedwait>(3))."
2090 #: build/C/man2/prctl.2:491
2092 "Timer slack is not applied to threads that are scheduled under a realtime "
2093 "scheduling policy (see B<sched_setscheduler>(2))."
2097 #: build/C/man2/prctl.2:508
2099 "Each thread has two associated timer slack values: a \"default\" value, and "
2100 "a \"current\" value. The current value is the one that governs grouping of "
2101 "timer expirations. When a new thread is created, the two timer slack values "
2102 "are made the same as the current value of the creating thread. Thereafter, "
2103 "a thread can adjust its current timer slack value via B<PR_SET_TIMERSLACK> "
2104 "(the default value can't be changed). The timer slack values of I<init> "
2105 "(PID 1), the ancestor of all processes, are 50,000 nanoseconds (50 "
2106 "microseconds). The timer slack values are preserved across B<execve>(2)."
2110 #: build/C/man2/prctl.2:508
2112 msgid "B<PR_GET_TIMERSLACK> (since Linux 2.6.28)"
2116 #: build/C/man2/prctl.2:511
2117 msgid "Return the current timer slack value of the calling thread."
2121 #: build/C/man2/prctl.2:511
2123 msgid "B<PR_SET_TIMING> (since Linux 2.6.0-test4)"
2128 #. PR_TIMING_TIMESTAMP doesn't do anything in 2.6.26-rc8,
2129 #. and looking at the patch history, it appears
2130 #. that it never did anything.
2132 #: build/C/man2/prctl.2:528
2134 "Set whether to use (normal, traditional) statistical process timing or "
2135 "accurate timestamp-based process timing, by passing B<PR_TIMING_STATISTICAL> "
2136 "or B<PR_TIMING_TIMESTAMP> to I<arg2>. B<PR_TIMING_TIMESTAMP> is not "
2137 "currently implemented (attempting to set this mode will yield the error "
2142 #: build/C/man2/prctl.2:528
2144 msgid "B<PR_GET_TIMING> (since Linux 2.6.0-test4)"
2148 #: build/C/man2/prctl.2:532
2150 "Return (as the function result) which process timing method is currently in "
2155 #: build/C/man2/prctl.2:532
2157 msgid "B<PR_TASK_PERF_EVENTS_DISABLE> (since Linux 2.6.31)"
2161 #: build/C/man2/prctl.2:541
2163 "Disable all performance counters attached to the calling process, regardless "
2164 "of whether the counters were created by this process or another process. "
2165 "Performance counters created by the calling process for other processes are "
2166 "unaffected. For more information on performance counters, see the Linux "
2167 "kernel source file I<tools/perf/design.txt>."
2170 #. commit 1d1c7ddbfab358445a542715551301b7fc363e28
2172 #: build/C/man2/prctl.2:547
2174 "Originally called B<PR_TASK_PERF_COUNTERS_DISABLE>; renamed (with same "
2175 "numerical value) in Linux 2.6.32."
2179 #: build/C/man2/prctl.2:547
2181 msgid "B<PR_TASK_PERF_EVENTS_ENABLE> (since Linux 2.6.31)"
2185 #: build/C/man2/prctl.2:552
2187 "The converse of B<PR_TASK_PERF_EVENTS_DISABLE>; enable performance counters "
2188 "attached to the calling process."
2191 #. commit 1d1c7ddbfab358445a542715551301b7fc363e28
2192 #. commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6
2194 #: build/C/man2/prctl.2:559
2195 msgid "Originally called B<PR_TASK_PERF_COUNTERS_ENABLE>; renamed in Linux 2.6.32."
2199 #: build/C/man2/prctl.2:559
2201 msgid "B<PR_SET_TSC> (since Linux 2.6.26, x86 only)"
2205 #: build/C/man2/prctl.2:572
2207 "Set the state of the flag determining whether the timestamp counter can be "
2208 "read by the process. Pass B<PR_TSC_ENABLE> to I<arg2> to allow it to be "
2209 "read, or B<PR_TSC_SIGSEGV> to generate a B<SIGSEGV> when the process tries "
2210 "to read the timestamp counter."
2214 #: build/C/man2/prctl.2:572
2216 msgid "B<PR_GET_TSC> (since Linux 2.6.26, x86 only)"
2220 #: build/C/man2/prctl.2:578
2222 "Return the state of the flag determining whether the timestamp counter can "
2223 "be read, in the location pointed to by I<(int\\ *) arg2>."
2227 #: build/C/man2/prctl.2:578
2229 msgid "B<PR_SET_UNALIGN>"
2233 #: build/C/man2/prctl.2:588
2235 "(Only on: ia64, since Linux 2.3.48; parisc, since Linux 2.6.15; PowerPC, "
2236 "since Linux 2.6.18; Alpha, since Linux 2.6.22) Set unaligned access control "
2237 "bits to I<arg2>. Pass B<PR_UNALIGN_NOPRINT> to silently fix up unaligned "
2238 "user accesses, or B<PR_UNALIGN_SIGBUS> to generate B<SIGBUS> on unaligned "
2243 #: build/C/man2/prctl.2:588
2245 msgid "B<PR_GET_UNALIGN>"
2249 #: build/C/man2/prctl.2:595
2251 "(see B<PR_SET_UNALIGN> for information on versions and architectures) "
2252 "Return unaligned access control bits, in the location pointed to by I<(int\\ "
2257 #: build/C/man2/prctl.2:595
2259 msgid "B<PR_MCE_KILL> (since Linux 2.6.32)"
2263 #: build/C/man2/prctl.2:635
2265 "Set the machine check memory corruption kill policy for the current thread. "
2266 "If I<arg2> is B<PR_MCE_KILL_CLEAR>, clear the thread memory corruption kill "
2267 "policy and use the system-wide default. (The system-wide default is defined "
2268 "by I</proc/sys/vm/memory_failure_early_kill>; see B<proc>(5).) If I<arg2> "
2269 "is B<PR_MCE_KILL_SET>, use a thread-specific memory corruption kill policy. "
2270 "In this case, I<arg3> defines whether the policy is I<early kill> "
2271 "(B<PR_MCE_KILL_EARLY>), I<late kill> (B<PR_MCE_KILL_LATE>), or the "
2272 "system-wide default (B<PR_MCE_KILL_DEFAULT>). Early kill means that the "
2273 "thread receives a B<SIGBUS> signal as soon as hardware memory corruption is "
2274 "detected inside its address space. In late kill mode, the process is killed "
2275 "only when it accesses a corrupted page. See B<sigaction>(2) for more "
2276 "information on the B<SIGBUS> signal. The policy is inherited by children. "
2277 "The remaining unused B<prctl>() arguments must be zero for future "
2282 #: build/C/man2/prctl.2:635
2284 msgid "B<PR_MCE_KILL_GET> (since Linux 2.6.32)"
2288 #: build/C/man2/prctl.2:641
2290 "Return the current per-process machine check kill policy. All unused "
2291 "B<prctl>() arguments must be zero."
2295 #: build/C/man2/prctl.2:641
2297 msgid "B<PR_SET_MM> (since Linux 3.3)"
2301 #: build/C/man2/prctl.2:661
2303 "Modify certain kernel memory map descriptor fields of the calling process. "
2304 "Usually these fields are set by the kernel and dynamic loader (see "
2305 "B<ld.so>(8) for more information) and a regular application should not use "
2306 "this feature. However, there are cases, such as self-modifying programs, "
2307 "where a program might find it useful to change its own memory map. This "
2308 "feature is available only if the kernel is built with the "
2309 "B<CONFIG_CHECKPOINT_RESTORE> option enabled. The calling process must have "
2310 "the B<CAP_SYS_RESOURCE> capability. The value in I<arg2> is one of the "
2311 "options below, while I<arg3> provides a new value for the option."
2315 #: build/C/man2/prctl.2:662
2317 msgid "B<PR_SET_MM_START_CODE>"
2321 #: build/C/man2/prctl.2:671
2323 "Set the address above which the program text can run. The corresponding "
2324 "memory area must be readable and executable, but not writable or sharable "
2325 "(see B<mprotect>(2) and B<mmap>(2) for more information)."
2329 #: build/C/man2/prctl.2:671
2331 msgid "B<PR_SET_MM_END_CODE>"
2335 #: build/C/man2/prctl.2:676
2337 "Set the address below which the program text can run. The corresponding "
2338 "memory area must be readable and executable, but not writable or sharable."
2342 #: build/C/man2/prctl.2:676
2344 msgid "B<PR_SET_MM_START_DATA>"
2348 #: build/C/man2/prctl.2:682
2350 "Set the address above which initialized and uninitialized (bss) data are "
2351 "placed. The corresponding memory area must be readable and writable, but "
2352 "not executable or sharable."
2356 #: build/C/man2/prctl.2:682
2358 msgid "B<PR_SET_MM_END_DATA>"
2362 #: build/C/man2/prctl.2:688
2364 "Set the address below which initialized and uninitialized (bss) data are "
2365 "placed. The corresponding memory area must be readable and writable, but "
2366 "not executable or sharable."
2370 #: build/C/man2/prctl.2:688
2372 msgid "B<PR_SET_MM_START_STACK>"
2376 #: build/C/man2/prctl.2:692
2378 "Set the start address of the stack. The corresponding memory area must be "
2379 "readable and writable."
2383 #: build/C/man2/prctl.2:692
2385 msgid "B<PR_SET_MM_START_BRK>"
2389 #: build/C/man2/prctl.2:704
2391 "Set the address above which the program heap can be expanded with B<brk>(2) "
2392 "call. The address must be greater than the ending address of the current "
2393 "program data segment. In addition, the combined size of the resulting heap "
2394 "and the size of the data segment can't exceed the B<RLIMIT_DATA> resource "
2395 "limit (see B<setrlimit>(2))."
2399 #: build/C/man2/prctl.2:704
2401 msgid "B<PR_SET_MM_BRK>"
2404 #. FIXME The following (until ========) is not yet in mainline kernel,
2405 #. so commented out for the moment.
2407 #. .BR PR_SET_MM_ARG_START
2408 #. Set the address above which the program command line is placed.
2410 #. .BR PR_SET_MM_ARG_END
2411 #. Set the address below which the program command line is placed.
2413 #. .BR PR_SET_MM_ENV_START
2414 #. Set the address above which the program environment is placed.
2416 #. .BR PR_SET_MM_ENV_END
2417 #. Set the address below which the program environment is placed.
2419 #. The address passed with
2420 #. .BR PR_SET_MM_ARG_START ,
2421 #. .BR PR_SET_MM_ARG_END ,
2422 #. .BR PR_SET_MM_ENV_START ,
2424 #. .BR PR_SET_MM_ENV_END
2425 #. should belong to a process stack area.
2426 #. Thus, the corresponding memory area must be readable, writable, and
2427 #. (depending on the kernel configuration) have the
2428 #. .BR MAP_GROWSDOWN
2429 #. attribute set (see
2432 #. .BR PR_SET_MM_AUXV
2433 #. Set a new auxiliary vector.
2436 #. argument should provide the address of the vector.
2439 #. is the size of the vector.
2441 #. .BR PR_SET_MM_EXE_FILE
2443 #. .IR /proc/pid/exe
2444 #. symbolic link with a new one pointing to a new executable file
2445 #. identified by the file descriptor provided in
2448 #. The file descriptor should be obtained with a regular
2452 #. To change the symbolic link, one needs to unmap all existing
2453 #. executable memory areas, including those created by the kernel itself
2454 #. (for example the kernel usually creates at least one executable
2455 #. memory area for the ELF
2459 #. The second limitation is that such transitions can be done only once
2460 #. in a process life time.
2461 #. Any further attempts will be rejected.
2462 #. This should help system administrators to monitor unusual
2463 #. symbolic-link transitions over all process running in a system.
2464 #. ========== END FIXME
2466 #: build/C/man2/prctl.2:773
2468 "Set the current B<brk>(2) value. The requirements for the address are the "
2469 "same as for the B<PR_SET_MM_START_BRK> option."
2473 #: build/C/man2/prctl.2:793
2475 "On success, B<PR_GET_DUMPABLE>, B<PR_GET_KEEPCAPS>, B<PR_GET_NO_NEW_PRIVS>, "
2476 "B<PR_CAPBSET_READ>, B<PR_GET_TIMING>, B<PR_GET_SECUREBITS>, "
2477 "B<PR_MCE_KILL_GET>, and (if it returns) B<PR_GET_SECCOMP> return the "
2478 "nonnegative values described above. All other I<option> values return 0 on "
2479 "success. On error, -1 is returned, and I<errno> is set appropriately."
2483 #: build/C/man2/prctl.2:798
2484 msgid "I<arg2> is an invalid address."
2488 #: build/C/man2/prctl.2:803
2489 msgid "The value of I<option> is not recognized."
2493 #: build/C/man2/prctl.2:815
2495 "I<option> is B<PR_MCE_KILL> or B<PR_MCE_KILL_GET> or B<PR_SET_MM>, and "
2496 "unused B<prctl>() arguments were not specified as zero."
2500 #: build/C/man2/prctl.2:820
2501 msgid "I<arg2> is not valid value for this I<option>."
2505 #: build/C/man2/prctl.2:829
2507 "I<option> is B<PR_SET_SECCOMP> or B<PR_GET_SECCOMP>, and the kernel was not "
2508 "configured with B<CONFIG_SECCOMP>."
2512 #: build/C/man2/prctl.2:835
2513 msgid "I<option> is B<PR_SET_MM>, and one of the following is true"
2517 #: build/C/man2/prctl.2:841
2518 msgid "I<arg4> or I<arg5> is nonzero;"
2522 #: build/C/man2/prctl.2:846
2524 "I<arg3> is greater than B<TASK_SIZE> (the limit on the size of the user "
2525 "address space for this architecture);"
2529 #: build/C/man2/prctl.2:856
2531 "I<arg2> is B<PR_SET_MM_START_CODE>, B<PR_SET_MM_END_CODE>, "
2532 "B<PR_SET_MM_START_DATA>, B<PR_SET_MM_END_DATA>, or B<PR_SET_MM_START_STACK,> "
2533 "and the permissions of the corresponding memory area are not as required;"
2537 #: build/C/man2/prctl.2:868
2539 "I<arg2> is B<PR_SET_MM_START_BRK> or B<PR_SET_MM_BRK>, and I<arg3> is less "
2540 "than or equal to the end of the data segment or specifies a value that would "
2541 "cause the B<RLIMIT_DATA> resource limit to be exceeded."
2545 #: build/C/man2/prctl.2:879
2547 "I<option> is B<PR_SET_PTRACER> and I<arg2> is not 0, B<PR_SET_PTRACER_ANY>, "
2548 "or the PID of an existing process."
2552 #: build/C/man2/prctl.2:891
2554 "I<option> is B<PR_SET_SECUREBITS>, and the caller does not have the "
2555 "B<CAP_SETPCAP> capability, or tried to unset a \"locked\" flag, or tried to "
2556 "set a flag whose corresponding locked flag was set (see B<capabilities>(7))."
2560 #: build/C/man2/prctl.2:901
2562 "I<option> is B<PR_SET_KEEPCAPS>, and the callers's "
2563 "B<SECURE_KEEP_CAPS_LOCKED> flag is set (see B<capabilities>(7))."
2567 #: build/C/man2/prctl.2:909
2569 "I<option> is B<PR_CAPBSET_DROP>, and the caller does not have the "
2570 "B<CAP_SETPCAP> capability."
2573 #. FIXME The following (until ========) is not yet in mainline kernel,
2574 #. so commented out for the moment.
2583 #. .BR PR_SET_MM_EXE_FILE ,
2584 #. the file is not executable.
2592 #. .BR PR_SET_MM_EXE_FILE ,
2593 #. and this the second attempt to change the
2595 #. symbolic link, which is prohibited.
2603 #. .BR PR_SET_MM_EXE_FILE ,
2604 #. and the file descriptor passed in
2607 #. ========== END FIXME
2608 #. The following can't actually happen, because prctl() in
2609 #. seccomp mode will cause SIGKILL.
2614 #. .BR PR_SET_SECCOMP ,
2615 #. and secure computing mode is already 1.
2617 #: build/C/man2/prctl.2:960
2619 "I<option> is B<PR_SET_MM>, and the caller does not have the "
2620 "B<CAP_SYS_RESOURCE> capability."
2623 #. The library interface was added in glibc 2.0.6
2625 #: build/C/man2/prctl.2:965
2626 msgid "The B<prctl>() system call was introduced in Linux 2.1.57."
2630 #: build/C/man2/prctl.2:972
2632 "This call is Linux-specific. IRIX has a B<prctl>() system call (also "
2633 "introduced in Linux 2.1.44 as irix_prctl on the MIPS architecture), with "
2638 #: build/C/man2/prctl.2:974
2639 msgid "B<ptrdiff_t prctl(int >I<option>B<, int >I<arg2>B<, int >I<arg3>B<);>"
2643 #: build/C/man2/prctl.2:979
2645 "and options to get the maximum number of processes per user, get the maximum "
2646 "number of processors the calling process can use, find out whether a "
2647 "specified process is currently blocked, get or set the maximum stack size, "
2652 #: build/C/man2/prctl.2:982
2653 msgid "B<signal>(2), B<core>(5)"
2657 #: build/C/man3/profil.3:28
2663 #: build/C/man3/profil.3:31
2664 msgid "profil - execution time profile"
2668 #: build/C/man3/profil.3:34
2670 msgid "B<#include E<lt>unistd.hE<gt>>\n"
2674 #: build/C/man3/profil.3:37
2677 "B<int profil(unsigned short *>I<buf>B<, size_t >I<bufsiz>B<,>\n"
2678 "B< size_t >I<offset>B<, unsigned int >I<scale>B<);>\n"
2682 #: build/C/man3/profil.3:46
2683 msgid "B<profil>(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\\ E<lt>\\ 500)"
2687 #: build/C/man3/profil.3:68
2689 "This routine provides a means to find out in what areas your program spends "
2690 "most of its time. The argument I<buf> points to I<bufsiz> bytes of core. "
2691 "Every virtual 10 milliseconds, the user's program counter (PC) is examined: "
2692 "I<offset> is subtracted and the result is multiplied by I<scale> and divided "
2693 "by 65536. If the resulting value is less than I<bufsiz>, then the "
2694 "corresponding entry in I<buf> is incremented. If I<buf> is NULL, profiling "
2699 #: build/C/man3/profil.3:70
2700 msgid "Zero is always returned."
2704 #: build/C/man3/profil.3:72
2705 msgid "Similar to a call in SVr4 (but not POSIX.1-2001)."
2709 #: build/C/man3/profil.3:78
2711 "B<profil>() cannot be used on a program that also uses B<ITIMER_PROF> "
2712 "interval timers (see B<setitimer>(2))."
2716 #: build/C/man3/profil.3:81
2718 "True kernel profiling provides more accurate results. Libc 4.4 contained a "
2719 "kernel patch providing a system call profil."
2723 #: build/C/man3/profil.3:86
2724 msgid "B<gprof>(1), B<setitimer>(2), B<sigaction>(2), B<signal>(2)"
2728 #: build/C/man3/psignal.3:30
2734 #: build/C/man3/psignal.3:30
2740 #: build/C/man3/psignal.3:30 build/C/man3/raise.3:29 build/C/man7/sigevent.7:26
2746 #: build/C/man3/psignal.3:33
2747 msgid "psignal, psiginfo - print signal message"
2751 #: build/C/man3/psignal.3:39
2754 "B<void psignal(int >I<sig>B<, const char *>I<s>B<);>\n"
2755 "B<void psiginfo(const siginfo_t *>I<pinfo>B<, const char *>I<s>B<);>\n"
2759 #: build/C/man3/psignal.3:41
2761 msgid "B<extern const char *const >I<sys_siglist>B<[];>\n"
2765 #: build/C/man3/psignal.3:50
2766 msgid "B<psignal>(): _SVID_SOURCE || _BSD_SOURCE"
2770 #: build/C/man3/psignal.3:53
2772 "B<psiginfo>(): _XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ "
2777 #: build/C/man3/psignal.3:56
2778 msgid "I<sys_siglist>: _BSD_SOURCE"
2782 #: build/C/man3/psignal.3:65
2784 "The B<psignal>() function displays a message on I<stderr> consisting of the "
2785 "string I<s>, a colon, a space, a string describing the signal number I<sig>, "
2786 "and a trailing newline. If the string I<s> is NULL or empty, the colon and "
2787 "space are omitted. If I<sig> is invalid, the message displayed will "
2788 "indicate an unknown signal."
2792 #: build/C/man3/psignal.3:86
2794 "The B<psiginfo>() function is like B<psignal>(), except that it displays "
2795 "information about the signal described by I<pinfo>, which should point to a "
2796 "valid I<siginfo_t> structure. As well as the signal description, "
2797 "B<psiginfo>() displays information about the origin of the signal, and "
2798 "other information relevant to the signal (e.g., the relevant memory address "
2799 "for hardware-generated signals, the child process ID for B<SIGCHLD>, and the "
2800 "user ID and process ID of the sender, for signals set using B<kill>(2) or "
2805 #: build/C/man3/psignal.3:89
2807 "The array I<sys_siglist> holds the signal description strings indexed by "
2812 #: build/C/man3/psignal.3:95
2813 msgid "The B<psignal>() and B<psiginfo>() functions return no value."
2817 #: build/C/man3/psignal.3:99
2818 msgid "The B<psiginfo>() function was added to glibc in version 2.10."
2822 #: build/C/man3/psignal.3:101
2823 msgid "POSIX.1-2008, 4.3BSD."
2827 #: build/C/man3/psignal.3:105
2828 msgid "In glibc versions up to 2.12, B<psiginfo>() had the following bugs:"
2831 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12107
2832 #. Reportedly now fixed; check glibc 2.13
2834 #: build/C/man3/psignal.3:109
2835 msgid "In some circumstances, a trailing newline is not printed."
2838 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12108
2839 #. Reportedly now fixed; check glibc 2.13
2841 #: build/C/man3/psignal.3:113
2842 msgid "Additional details are not displayed for real-time signals."
2846 #: build/C/man3/psignal.3:118
2847 msgid "B<sigaction>(2), B<perror>(3), B<strsignal>(3), B<signal>(7)"
2851 #: build/C/man3/raise.3:29
2857 #: build/C/man3/raise.3:29
2863 #: build/C/man3/raise.3:32
2864 msgid "raise - send a signal to the caller"
2868 #: build/C/man3/raise.3:37
2870 msgid "B<int raise(int >I<sig>B<);>\n"
2874 #: build/C/man3/raise.3:43
2876 "The B<raise>() function sends a signal to the calling process or thread. "
2877 "In a single-threaded program it is equivalent to"
2881 #: build/C/man3/raise.3:47
2883 msgid "kill(getpid(), sig);\n"
2887 #: build/C/man3/raise.3:51
2888 msgid "In a multithreaded program it is equivalent to"
2892 #: build/C/man3/raise.3:55
2894 msgid "pthread_kill(pthread_self(), sig);\n"
2898 #: build/C/man3/raise.3:61
2900 "If the signal causes a handler to be called, B<raise>() will return only "
2901 "after the signal handler has returned."
2905 #: build/C/man3/raise.3:64
2906 msgid "B<raise>() returns 0 on success, and nonzero for failure."
2910 #: build/C/man3/raise.3:66 build/C/man2/signal.2:112
2911 msgid "C89, C99, POSIX.1-2001."
2914 #. 2.3.2 used the obsolete tkill(), if available.
2916 #: build/C/man3/raise.3:77
2918 "Since version 2.3.3, glibc implements B<raise>() by calling B<tgkill>(2), "
2919 "if the kernel supports that system call. Older glibc versions implemented "
2920 "B<raise>() using B<kill>(2)."
2924 #: build/C/man3/raise.3:84
2926 "B<getpid>(2), B<kill>(2), B<sigaction>(2), B<signal>(2), B<pthread_kill>(3), "
2931 #: build/C/man2/restart_syscall.2:33
2933 msgid "RESTART_SYSCALL"
2937 #: 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
2943 #: build/C/man2/restart_syscall.2:36
2944 msgid "restart_syscall - restart a system call after interruption by a stop signal"
2948 #: build/C/man2/restart_syscall.2:38
2949 msgid "B<int restart_syscall(void);>"
2953 #: build/C/man2/restart_syscall.2:41
2954 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
2958 #: build/C/man2/restart_syscall.2:53
2960 "The B<restart_syscall>() system call is used to restart certain system "
2961 "calls after a process that was stopped by a signal (e.g., B<SIGSTOP> or "
2962 "B<SIGTSTP>) is later resumed after receiving a B<SIGCONT> signal. This "
2963 "system call is designed only for internal use by the kernel."
2966 #. These system calls correspond to the special internal errno value
2967 #. ERESTART_RESTARTBLOCK. Each of the system calls has a "restart"
2968 #. helper function that is invoked by restart_syscall().
2970 #: build/C/man2/restart_syscall.2:84
2972 "B<restart_syscall>() is used for restarting only those system calls that, "
2973 "when restarted, should adjust their time-related parameters\\(emnamely "
2974 "B<poll>(2) (since Linux 2.6.24), B<nanosleep>(2) (since Linux 2.6), "
2975 "B<clock_nanosleep>(2) (since Linux 2.6), and B<futex>(2), when employed "
2976 "with the B<FUTEX_WAIT> (since Linux 2.6.22) and B<FUTEX_WAIT_BITSET> (since "
2977 "Linux 2.6.31) operations. B<restart_syscall>() restarts the interrupted "
2978 "system call with a time argument that is suitably adjusted to account for "
2979 "the time that has already elapsed (including the time where the process was "
2980 "stopped by a signal). Without the B<restart_syscall>() mechanism, "
2981 "restarting these system calls would not correctly deduce the already elapsed "
2982 "time when the process continued execution."
2986 #: build/C/man2/restart_syscall.2:88
2988 "The return value of B<restart_syscall>() is the return value of whatever "
2989 "system call is being restarted."
2993 #: build/C/man2/restart_syscall.2:92
2995 "I<errno> is set as per the errors for whatever system call is being "
2996 "restarted by B<restart_syscall>()."
3000 #: build/C/man2/restart_syscall.2:96
3001 msgid "The B<restart_syscall>() system call is present since Linux 2.6."
3005 #: build/C/man2/restart_syscall.2:98
3006 msgid "This system call is Linux specific."
3010 #: build/C/man2/restart_syscall.2:102
3012 "There is no glibc wrapper for this system call, because it is intended for "
3013 "use only by the kernel and should never be called by applications."
3018 #. There is one oddness in the implementation though, with respect to
3019 #. nanosleep() (and probably also clock_nanosleep()). The scenario
3021 #. 1. Start a nanosleep() for (say) 30 seconds,
3022 #. 2. Stop the process with (say) SIGTSTP (^Z).
3023 #. 3. Resume the process with SIGCONT,
3024 #. 4. Upon return, the 'rem' argument of nanosleep() will contain the
3025 #. remaining unslept time **at the time when SIGTSTP was delivered**.
3026 #. The behavior at point 4 is odd, but doesn't violate the standards, which
3027 #. specify the treatment of 'rem' only when the system call returns with
3028 #. the error EINTR (i.e., the call was interrupted by a signal handler).
3030 #: build/C/man2/restart_syscall.2:123
3032 "From user space, the operation of B<restart_syscall>(2) is largely "
3033 "invisible: to the process that made the system call that is restarted, it "
3034 "appears as though that system call executed and returned in the usual "
3038 #. FIXME select(2) should probably get the restart_syscall() treatment:
3039 #. If a select() call is suspended by stop-sig+SIGCONT, the time
3040 #. spent suspended is *not* deducted when the select() is restarted.
3041 #. FIXME: check whether recvmmsg() handles stop-sig+SIGCONT properly.
3043 #: build/C/man2/restart_syscall.2:131
3044 msgid "B<sigreturn>(2), B<sigaction>(2), B<signal>(7)"
3048 #: build/C/man2/rt_sigqueueinfo.2:25
3050 msgid "RT_SIGQUEUEINFO"
3054 #: build/C/man2/rt_sigqueueinfo.2:25 build/C/man2/sgetmask.2:26 build/C/man2/tkill.2:29
3060 #: build/C/man2/rt_sigqueueinfo.2:28
3061 msgid "rt_sigqueueinfo, rt_tgsigqueueinfo - queue a signal and data"
3065 #: build/C/man2/rt_sigqueueinfo.2:31
3068 "B<int rt_sigqueueinfo(pid_t >I<tgid>B<, int >I<sig>B<, siginfo_t "
3073 #: build/C/man2/rt_sigqueueinfo.2:34
3076 "B<int rt_tgsigqueueinfo(pid_t >I<tgid>B<, pid_t >I<tid>B<, int >I<sig>B<,>\n"
3077 "B< siginfo_t *>I<uinfo>B<);>\n"
3081 #: build/C/man2/rt_sigqueueinfo.2:38 build/C/man2/sgetmask.2:36 build/C/man2/tkill.2:41
3082 msgid "I<Note>: There are no glibc wrappers for these system calls; see NOTES."
3086 #: build/C/man2/rt_sigqueueinfo.2:50
3088 "The B<rt_sigqueueinfo>() and B<rt_tgsigqueueinfo>() system calls are the "
3089 "low-level interfaces used to send a signal plus data to a process or "
3090 "thread. The receiver of the signal can obtain the accompanying data by "
3091 "establishing a signal handler with the B<sigaction>(2) B<SA_SIGINFO> flag."
3095 #: build/C/man2/rt_sigqueueinfo.2:56
3097 "These system calls are not intended for direct application use; they are "
3098 "provided to allow the implementation of B<sigqueue>(3) and "
3099 "B<pthread_sigqueue>(3)."
3103 #: build/C/man2/rt_sigqueueinfo.2:68
3105 "The B<rt_sigqueueinfo>() system call sends the signal I<sig> to the thread "
3106 "group with the ID I<tgid>. (The term \"thread group\" is synonymous with "
3107 "\"process\", and I<tid> corresponds to the traditional UNIX process ID.) "
3108 "The signal will be delivered to an arbitrary member of the thread group "
3109 "(i.e., one of the threads that is not currently blocking the signal)."
3113 #: build/C/man2/rt_sigqueueinfo.2:79
3115 "The I<uinfo> argument specifies the data to accompany the signal. This "
3116 "argument is a pointer to a structure of type I<siginfo_t>, described in "
3117 "B<sigaction>(2) (and defined by including I<E<lt>sigaction.hE<gt>>). The "
3118 "caller should set the following fields in this structure:"
3122 #: build/C/man2/rt_sigqueueinfo.2:79 build/C/man7/sigevent.7:88 build/C/man2/wait.2:314
3129 #: build/C/man2/rt_sigqueueinfo.2:95
3131 "This must be one of the B<SI_*> codes in the Linux kernel source file "
3132 "I<include/asm-generic/siginfo.h>, with the restriction that the code must be "
3133 "negative (i.e., cannot be B<SI_USER>, which is used by the kernel to "
3134 "indicate a signal sent by B<kill>(2)) and cannot (since Linux 2.6.39) be "
3135 "B<SI_TKILL> (which is used by the kernel to indicate a signal sent using "
3140 #: build/C/man2/rt_sigqueueinfo.2:95 build/C/man2/wait.2:293
3146 #: build/C/man2/rt_sigqueueinfo.2:99
3147 msgid "This should be set to a process ID, typically the process ID of the sender."
3151 #: build/C/man2/rt_sigqueueinfo.2:99 build/C/man2/wait.2:296
3157 #: build/C/man2/rt_sigqueueinfo.2:103
3158 msgid "This should be set to a user ID, typically the real user ID of the sender."
3162 #: build/C/man2/rt_sigqueueinfo.2:103 build/C/man7/sigevent.7:96
3168 #: build/C/man2/rt_sigqueueinfo.2:110
3170 "This field contains the user data to accompany the signal. For more "
3171 "information, see the description of the last (I<union sigval>) argument of "
3176 #: build/C/man2/rt_sigqueueinfo.2:117
3178 "Internally, the kernel sets the I<si_signo> field to the value specified in "
3179 "I<sig>, so that the receiver of the signal can also obtain the signal number "
3184 #: build/C/man2/rt_sigqueueinfo.2:129
3186 "The B<rt_tgsigqueueinfo>() system call is like B<rt_sigqueueinfo>(), but "
3187 "sends the signal and data to the single thread specified by the combination "
3188 "of I<tgid>, a thread group ID, and I<tid>, a thread in that thread group."
3192 #: build/C/man2/rt_sigqueueinfo.2:134
3194 "On success, these system calls return 0. On error, they return -1 and "
3195 "I<errno> is set to indicate the error."
3199 #: 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
3205 #: build/C/man2/rt_sigqueueinfo.2:141 build/C/man3/sigqueue.3:98
3207 "The limit of signals which may be queued has been reached. (See "
3208 "B<signal>(7) for further information.)"
3212 #: build/C/man2/rt_sigqueueinfo.2:148
3213 msgid "I<sig>, I<tgid>, or I<tid> was invalid."
3217 #: build/C/man2/rt_sigqueueinfo.2:156
3219 "The caller does not have permission to send the signal to the target. For "
3220 "the required permissions, see B<kill>(2). Or: I<uinfo-E<gt>si_code> is "
3225 #: build/C/man2/rt_sigqueueinfo.2:162
3226 msgid "B<rt_sigqueueinfo>(): No thread group matching I<tgid> was found."
3230 #: build/C/man2/rt_sigqueueinfo.2:169
3231 msgid "B<rt_tgsigqueinfo>(): No thread matching I<tgid> and I<tid> was found."
3235 #: build/C/man2/rt_sigqueueinfo.2:176
3237 "The B<rt_sigqueueinfo>() system call was added to Linux in version 2.2. "
3238 "The B<rt_tgsigqueueinfo>() system call was added to Linux in version "
3243 #: build/C/man2/rt_sigqueueinfo.2:178 build/C/man2/sgetmask.2:68 build/C/man2/timerfd_create.2:373
3244 msgid "These system calls are Linux-specific."
3248 #: build/C/man2/rt_sigqueueinfo.2:183
3250 "Since these system calls are not intended for application use, there are no "
3251 "glibc wrapper functions; use B<syscall>(2) in the unlikely case that you "
3252 "want to call them directly."
3256 #: build/C/man2/rt_sigqueueinfo.2:188
3258 "As with B<kill>(2), the null signal (0) can be used to check if the "
3259 "specified process or thread exists."
3263 #: build/C/man2/rt_sigqueueinfo.2:196
3265 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<tgkill>(2), "
3266 "B<pthread_sigqueue>(3), B<sigqueue>(3), B<signal>(7)"
3270 #: build/C/man2/s390_runtime_instr.2:25
3272 msgid "S390_RUNTIME_INSTR"
3276 #: build/C/man2/s390_runtime_instr.2:25
3282 #: build/C/man2/s390_runtime_instr.2:28
3283 msgid "s390_runtime_instr - enable/disable s390 CPU run-time instrumentation"
3287 #: build/C/man2/s390_runtime_instr.2:31
3289 msgid "B<#include E<lt>asm/runtime_instr.hE<gt>>\n"
3293 #: build/C/man2/s390_runtime_instr.2:33
3295 msgid "B<int s390_runtime_instr(int >I<command>B<, int >I<signum>B<);>\n"
3299 #: build/C/man2/s390_runtime_instr.2:39
3301 "The B<s390_runtime_instr>() system call starts or stops CPU run-time "
3302 "instrumentation for the calling thread."
3306 #: build/C/man2/s390_runtime_instr.2:47
3308 "The I<command> argument controls whether run-time instrumentation is started "
3309 "(B<S390_RUNTIME_INSTR_START>, 1) or stopped (B<S390_RUNTIME_INSTR_STOP>, 2) "
3310 "for the calling thread."
3314 #: build/C/man2/s390_runtime_instr.2:54
3316 "The I<signum> argument specifies the number of a real-time signal. The "
3317 "real-time signal is sent to the thread if the run-time instrumentation "
3318 "buffer is full or if the run-time-instrumentation-halted interrupt occurred."
3322 #: build/C/man2/s390_runtime_instr.2:65
3324 "On success, B<s390_runtime_instr>() returns 0 and enables the thread for "
3325 "run-time instrumentation by assigning the thread a default run-time "
3326 "instrumentation control block. The caller can then read and modify the "
3327 "control block and start the run-time instrumentation. On error, -1 is "
3328 "returned and I<errno> is set to one of the error codes listed below."
3332 #: build/C/man2/s390_runtime_instr.2:73
3334 "The value specified in I<command> is not a valid command or the value "
3335 "specified in I<signum> is not a real-time signal number."
3339 #: build/C/man2/s390_runtime_instr.2:76
3340 msgid "Allocating memory for the run-time instrumentation control block failed."
3344 #: build/C/man2/s390_runtime_instr.2:76
3346 msgid "B<EOPNOTSUPP>"
3350 #: build/C/man2/s390_runtime_instr.2:79
3351 msgid "The run-time instrumentation facility is not available."
3355 #: build/C/man2/s390_runtime_instr.2:81
3356 msgid "This system call is available since Linux 3.7."
3360 #: build/C/man2/s390_runtime_instr.2:84
3362 "This Linux-specific system call is available only on the s390 architecture. "
3363 "The run-time instrumentation facility is available beginning with System z "
3368 #: build/C/man2/s390_runtime_instr.2:88
3370 "Glibc does not provide a wrapper for this system call, use B<syscall>(2) to "
3375 #: build/C/man2/s390_runtime_instr.2:91
3376 msgid "B<syscall>(2), B<signal>(7)"
3380 #: build/C/man2/sgetmask.2:26
3386 #: build/C/man2/sgetmask.2:29
3387 msgid "sgetmask, ssetmask - manipulation of signal mask (obsolete)"
3391 #: build/C/man2/sgetmask.2:31
3392 msgid "B<long sgetmask(void);>"
3396 #: build/C/man2/sgetmask.2:33
3397 msgid "B<long ssetmask(long >I<newmask>B<);>"
3401 #: build/C/man2/sgetmask.2:42
3403 "These system calls are obsolete. I<Do not use them>; use B<sigprocmask>(2) "
3408 #: build/C/man2/sgetmask.2:45
3409 msgid "B<sgetmask>() returns the signal mask of the calling process."
3413 #: build/C/man2/sgetmask.2:50
3415 "B<ssetmask>() sets the signal mask of the calling process to the value "
3416 "given in I<newmask>. The previous signal mask is returned."
3420 #: build/C/man2/sgetmask.2:59
3422 "The signal masks dealt with by these two system calls are plain bit masks "
3423 "(unlike the I<sigset_t> used by B<sigprocmask>(2)); use B<sigmask>(3) to "
3424 "create and inspect these masks."
3428 #: build/C/man2/sgetmask.2:64
3430 "B<sgetmask>() always successfully returns the signal mask. B<ssetmask>() "
3431 "always succeeds, and returns the previous signal mask."
3435 #: build/C/man2/sgetmask.2:66
3436 msgid "These system calls always succeed."
3440 #: build/C/man2/sgetmask.2:72
3442 "Glibc does not provide wrappers for these obsolete system calls; in the "
3443 "unlikely event that you want to call them, use B<syscall>(2)."
3447 #: build/C/man2/sgetmask.2:75
3449 "These system calls are unaware of signal numbers greater than 31 (i.e., "
3450 "real-time signals)."
3454 #: build/C/man2/sgetmask.2:80
3455 msgid "It is not possible to block B<SIGSTOP> or B<SIGKILL>."
3459 #: build/C/man2/sgetmask.2:83
3460 msgid "B<sigprocmask>(2), B<signal>(7)"
3464 #: build/C/man2/sigaction.2:47
3470 #: build/C/man2/sigaction.2:50
3471 msgid "sigaction - examine and change a signal action"
3475 #: build/C/man2/sigaction.2:56
3478 "B<int sigaction(int >I<signum>B<, const struct sigaction *>I<act>B<,>\n"
3479 "B< struct sigaction *>I<oldact>B<);>\n"
3483 #: build/C/man2/sigaction.2:66
3485 "B<sigaction>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
3490 #: build/C/man2/sigaction.2:69
3491 msgid "I<siginfo_t>: _POSIX_C_SOURCE E<gt>= 199309L"
3495 #: build/C/man2/sigaction.2:78
3497 "The B<sigaction>() system call is used to change the action taken by a "
3498 "process on receipt of a specific signal. (See B<signal>(7) for an overview "
3503 #: build/C/man2/sigaction.2:84
3505 "I<signum> specifies the signal and can be any valid signal except B<SIGKILL> "
3510 #: build/C/man2/sigaction.2:95
3512 "If I<act> is non-NULL, the new action for signal I<signum> is installed from "
3513 "I<act>. If I<oldact> is non-NULL, the previous action is saved in "
3518 #: build/C/man2/sigaction.2:99
3519 msgid "The I<sigaction> structure is defined as something like:"
3523 #: build/C/man2/sigaction.2:109
3526 "struct sigaction {\n"
3527 " void (*sa_handler)(int);\n"
3528 " void (*sa_sigaction)(int, siginfo_t *, void *);\n"
3529 " sigset_t sa_mask;\n"
3531 " void (*sa_restorer)(void);\n"
3536 #: build/C/man2/sigaction.2:116
3538 "On some architectures a union is involved: do not assign to both "
3539 "I<sa_handler> and I<sa_sigaction>."
3543 #: build/C/man2/sigaction.2:123
3545 "The I<sa_restorer> element is obsolete and should not be used. POSIX does "
3546 "not specify a I<sa_restorer> element."
3550 #: build/C/man2/sigaction.2:133
3552 "I<sa_handler> specifies the action to be associated with I<signum> and may "
3553 "be B<SIG_DFL> for the default action, B<SIG_IGN> to ignore this signal, or a "
3554 "pointer to a signal handling function. This function receives the signal "
3555 "number as its only argument."
3559 #: build/C/man2/sigaction.2:155
3561 "If B<SA_SIGINFO> is specified in I<sa_flags>, then I<sa_sigaction> (instead "
3562 "of I<sa_handler>) specifies the signal-handling function for I<signum>. "
3563 "This function receives the signal number as its first argument, a pointer to "
3564 "a I<siginfo_t> as its second argument and a pointer to a I<ucontext_t> (cast "
3565 "to I<void\\ *>) as its third argument. (Commonly, the handler function "
3566 "doesn't make any use of the third argument. See B<getcontext>(3) for "
3567 "further information about I<ucontext_t>.)"
3571 #: build/C/man2/sigaction.2:165
3573 "I<sa_mask> specifies a mask of signals which should be blocked (i.e., added "
3574 "to the signal mask of the thread in which the signal handler is invoked) "
3575 "during execution of the signal handler. In addition, the signal which "
3576 "triggered the handler will be blocked, unless the B<SA_NODEFER> flag is "
3581 #: build/C/man2/sigaction.2:169
3583 "I<sa_flags> specifies a set of flags which modify the behavior of the "
3584 "signal. It is formed by the bitwise OR of zero or more of the following:"
3588 #: build/C/man2/sigaction.2:170
3590 msgid "B<SA_NOCLDSTOP>"
3594 #: build/C/man2/sigaction.2:187
3596 "If I<signum> is B<SIGCHLD>, do not receive notification when child processes "
3597 "stop (i.e., when they receive one of B<SIGSTOP>, B<SIGTSTP>, B<SIGTTIN> or "
3598 "B<SIGTTOU>) or resume (i.e., they receive B<SIGCONT>) (see B<wait>(2)). "
3599 "This flag is meaningful only when establishing a handler for B<SIGCHLD>."
3603 #: build/C/man2/sigaction.2:187
3605 msgid "B<SA_NOCLDWAIT> (since Linux 2.6)"
3608 #. To be precise: Linux 2.5.60 -- MTK
3610 #: build/C/man2/sigaction.2:201
3612 "If I<signum> is B<SIGCHLD>, do not transform children into zombies when they "
3613 "terminate. See also B<waitpid>(2). This flag is meaningful only when "
3614 "establishing a handler for B<SIGCHLD>, or when setting that signal's "
3615 "disposition to B<SIG_DFL>."
3619 #: build/C/man2/sigaction.2:213
3621 "If the B<SA_NOCLDWAIT> flag is set when establishing a handler for "
3622 "B<SIGCHLD>, POSIX.1 leaves it unspecified whether a B<SIGCHLD> signal is "
3623 "generated when a child process terminates. On Linux, a B<SIGCHLD> signal is "
3624 "generated in this case; on some other implementations, it is not."
3628 #: build/C/man2/sigaction.2:213
3630 msgid "B<SA_NODEFER>"
3634 #: build/C/man2/sigaction.2:220
3636 "Do not prevent the signal from being received from within its own signal "
3637 "handler. This flag is meaningful only when establishing a signal handler. "
3638 "B<SA_NOMASK> is an obsolete, nonstandard synonym for this flag."
3642 #: build/C/man2/sigaction.2:220
3644 msgid "B<SA_ONSTACK>"
3648 #: build/C/man2/sigaction.2:226
3650 "Call the signal handler on an alternate signal stack provided by "
3651 "B<sigaltstack>(2). If an alternate stack is not available, the default "
3652 "stack will be used. This flag is meaningful only when establishing a signal "
3657 #: build/C/man2/sigaction.2:226
3659 msgid "B<SA_RESETHAND>"
3663 #: build/C/man2/sigaction.2:232
3665 "Restore the signal action to the default upon entry to the signal handler. "
3666 "This flag is meaningful only when establishing a signal handler. "
3667 "B<SA_ONESHOT> is an obsolete, nonstandard synonym for this flag."
3671 #: build/C/man2/sigaction.2:232
3673 msgid "B<SA_RESTART>"
3677 #: build/C/man2/sigaction.2:240
3679 "Provide behavior compatible with BSD signal semantics by making certain "
3680 "system calls restartable across signals. This flag is meaningful only when "
3681 "establishing a signal handler. See B<signal>(7) for a discussion of system "
3686 #: build/C/man2/sigaction.2:240
3688 msgid "B<SA_SIGINFO> (since Linux 2.2)"
3693 #. field was added in Linux 2.1.86.)
3695 #: build/C/man2/sigaction.2:251
3697 "The signal handler takes three arguments, not one. In this case, "
3698 "I<sa_sigaction> should be set instead of I<sa_handler>. This flag is "
3699 "meaningful only when establishing a signal handler."
3703 #: build/C/man2/sigaction.2:258
3705 "The I<siginfo_t> argument to I<sa_sigaction> is a struct with the following "
3710 #. si_trapno seems to be only used on SPARC and Alpha;
3711 #. this page could use a little more detail on its purpose there.
3712 #. In the kernel: si_tid
3714 #: build/C/man2/sigaction.2:289
3718 " int si_signo; /* Signal number */\n"
3719 " int si_errno; /* An errno value */\n"
3720 " int si_code; /* Signal code */\n"
3721 " int si_trapno; /* Trap number that caused\n"
3722 " hardware-generated signal\n"
3723 " (unused on most architectures) */\n"
3724 " pid_t si_pid; /* Sending process ID */\n"
3725 " uid_t si_uid; /* Real user ID of sending process */\n"
3726 " int si_status; /* Exit value or signal */\n"
3727 " clock_t si_utime; /* User time consumed */\n"
3728 " clock_t si_stime; /* System time consumed */\n"
3729 " sigval_t si_value; /* Signal value */\n"
3730 " int si_int; /* POSIX.1b signal */\n"
3731 " void *si_ptr; /* POSIX.1b signal */\n"
3732 " int si_overrun; /* Timer overrun count; POSIX.1b timers */\n"
3733 " int si_timerid; /* Timer ID; POSIX.1b timers */\n"
3734 " void *si_addr; /* Memory location which caused fault */\n"
3735 " long si_band; /* Band event (was I<int> in\n"
3736 " glibc 2.3.2 and earlier) */\n"
3737 " int si_fd; /* File descriptor */\n"
3738 " short si_addr_lsb; /* Least significant bit of address\n"
3739 " (since Linux 2.6.32) */\n"
3744 #: build/C/man2/sigaction.2:298
3746 "I<si_signo>, I<si_errno> and I<si_code> are defined for all signals. "
3747 "(I<si_errno> is generally unused on Linux.) The rest of the struct may be a "
3748 "union, so that one should read only the fields that are meaningful for the "
3753 #: build/C/man2/sigaction.2:313
3755 "Signals sent with B<kill>(2) and B<sigqueue>(3) fill in I<si_pid> and "
3756 "I<si_uid>. In addition, signals sent with B<sigqueue>(3) fill in I<si_int> "
3757 "and I<si_ptr> with the values specified by the sender of the signal; see "
3758 "B<sigqueue>(3) for more details."
3762 #: build/C/man2/sigaction.2:329
3764 "Signals sent by POSIX.1b timers (since Linux 2.6) fill in I<si_overrun> and "
3765 "I<si_timerid>. The I<si_timerid> field is an internal ID used by the kernel "
3766 "to identify the timer; it is not the same as the timer ID returned by "
3767 "B<timer_create>(2). The I<si_overrun> field is the timer overrun count; "
3768 "this is the same information as is obtained by a call to "
3769 "B<timer_getoverrun>(2). These fields are nonstandard Linux extensions."
3773 #: build/C/man2/sigaction.2:344
3775 "Signals sent for message queue notification (see the description of "
3776 "B<SIGEV_SIGNAL> in B<mq_notify>(3)) fill in I<si_int>/I<si_ptr>, with the "
3777 "I<sigev_value> supplied to B<mq_notify>(3); I<si_pid>, with the process ID "
3778 "of the message sender; and I<si_uid>, with the real user ID of the message "
3783 #. When si_utime and si_stime where originally implemented, the
3784 #. measurement unit was HZ, which was the same as clock ticks
3785 #. (sysconf(_SC_CLK_TCK)). In 2.6, HZ became configurable, and
3786 #. was *still* used as the unit to return the info these fields,
3787 #. with the result that the field values depended on the the
3788 #. configured HZ. Of course, the should have been measured in
3789 #. USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to
3790 #. convert to seconds. I have a queued patch to fix this:
3791 #. http://thread.gmane.org/gmane.linux.kernel/698061/ .
3792 #. This patch made it into 2.6.27.
3793 #. But note that these fields still don't return the times of
3794 #. waited-for children (as is done by getrusage() and times()
3795 #. and wait4()). Solaris 8 does include child times.
3797 #: build/C/man2/sigaction.2:391
3799 "B<SIGCHLD> fills in I<si_pid>, I<si_uid>, I<si_status>, I<si_utime> and "
3800 "I<si_stime>, providing information about the child. The I<si_pid> field is "
3801 "the process ID of the child; I<si_uid> is the child's real user ID. The "
3802 "I<si_status> field contains the exit status of the child (if I<si_code> is "
3803 "B<CLD_EXITED>), or the signal number that caused the process to change "
3804 "state. The I<si_utime> and I<si_stime> contain the user and system CPU time "
3805 "used by the child process; these fields do not include the times used by "
3806 "waited-for children (unlike B<getrusage>(2) and B<time>(2)). In kernels up "
3807 "to 2.6, and since 2.6.27, these fields report CPU time in units of "
3808 "I<sysconf(_SC_CLK_TCK)>. In 2.6 kernels before 2.6.27, a bug meant that "
3809 "these fields reported time in units of the (configurable) system jiffy (see "
3813 #. FIXME SIGTRAP also sets the following for ptrace_notify() ?
3814 #. info.si_code = exit_code;
3815 #. info.si_pid = task_pid_vnr(current);
3816 #. info.si_uid = current_uid(); /* Real UID */
3818 #: build/C/man2/sigaction.2:427
3820 "B<SIGILL>, B<SIGFPE>, B<SIGSEGV>, B<SIGBUS>, and B<SIGTRAP> fill in "
3821 "I<si_addr> with the address of the fault. On some architectures, these "
3822 "signals also fill in the I<si_trapno> filed. Some suberrors of B<SIGBUS>, "
3823 "in particular B<BUS_MCEERR_AO> and B<BUS_MCEERR_AR>, also fill in "
3824 "I<si_addr_lsb>. This field indicates the least significant bit of the "
3825 "reported address and therefore the extent of the corruption. For example, "
3826 "if a full page was corrupted, I<si_addr_lsb> contains "
3827 "I<log2(sysconf(_SC_PAGESIZE))>. B<BUS_MCERR_*> and I<si_addr_lsb> are "
3828 "Linux-specific extensions."
3832 #: build/C/man2/sigaction.2:441
3834 "B<SIGIO>/B<SIGPOLL> (the two names are synonyms on Linux) fills in "
3835 "I<si_band> and I<si_fd>. The I<si_band> event is a bit mask containing the "
3836 "same values as are filled in the I<revents> field by B<poll>(2). The "
3837 "I<si_fd> field indicates the file descriptor for which the I/O event "
3842 #: build/C/man2/sigaction.2:448
3844 "I<si_code> is a value (not a bit mask) indicating why this signal was "
3845 "sent. The following list shows the values which can be placed in I<si_code> "
3846 "for any signal, along with reason that the signal was generated."
3850 #: build/C/man2/sigaction.2:449
3856 #: build/C/man2/sigaction.2:452 build/C/man7/signal.7:111
3862 #: build/C/man2/sigaction.2:452
3864 msgid "B<SI_KERNEL>"
3868 #: build/C/man2/sigaction.2:455
3869 msgid "Sent by the kernel."
3873 #: build/C/man2/sigaction.2:455
3879 #: build/C/man2/sigaction.2:458 build/C/man7/signal.7:128
3881 msgid "B<sigqueue>(3)"
3885 #: build/C/man2/sigaction.2:458
3891 #: build/C/man2/sigaction.2:461
3892 msgid "POSIX timer expired"
3896 #: build/C/man2/sigaction.2:461
3902 #: build/C/man2/sigaction.2:465
3903 msgid "POSIX message queue state changed (since Linux 2.6.6); see B<mq_notify>(3)"
3907 #: build/C/man2/sigaction.2:465
3909 msgid "B<SI_ASYNCIO>"
3913 #: build/C/man2/sigaction.2:468
3914 msgid "AIO completed"
3918 #: build/C/man2/sigaction.2:468
3924 #: build/C/man2/sigaction.2:477
3926 "Queued B<SIGIO> (only in kernels up to Linux 2.2; from Linux 2.4 onward "
3927 "B<SIGIO>/B<SIGPOLL> fills in I<si_code> as described below)."
3931 #: build/C/man2/sigaction.2:477
3936 #. SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented
3937 #. It appears to have been an idea that was tried during 2.5.6
3938 #. through to 2.5.24 and then was backed out.
3940 #: build/C/man2/sigaction.2:486
3941 msgid "B<tkill>(2) or B<tgkill>(2) (since Linux 2.4.19)"
3945 #: build/C/man2/sigaction.2:493
3946 msgid "The following values can be placed in I<si_code> for a B<SIGILL> signal:"
3950 #: build/C/man2/sigaction.2:494
3952 msgid "B<ILL_ILLOPC>"
3956 #: build/C/man2/sigaction.2:497
3957 msgid "illegal opcode"
3961 #: build/C/man2/sigaction.2:497
3963 msgid "B<ILL_ILLOPN>"
3967 #: build/C/man2/sigaction.2:500
3968 msgid "illegal operand"
3972 #: build/C/man2/sigaction.2:500
3974 msgid "B<ILL_ILLADR>"
3978 #: build/C/man2/sigaction.2:503
3979 msgid "illegal addressing mode"
3983 #: build/C/man2/sigaction.2:503
3985 msgid "B<ILL_ILLTRP>"
3989 #: build/C/man2/sigaction.2:506
3990 msgid "illegal trap"
3994 #: build/C/man2/sigaction.2:506
3996 msgid "B<ILL_PRVOPC>"
4000 #: build/C/man2/sigaction.2:509
4001 msgid "privileged opcode"
4005 #: build/C/man2/sigaction.2:509
4007 msgid "B<ILL_PRVREG>"
4011 #: build/C/man2/sigaction.2:512
4012 msgid "privileged register"
4016 #: build/C/man2/sigaction.2:512
4018 msgid "B<ILL_COPROC>"
4022 #: build/C/man2/sigaction.2:515
4023 msgid "coprocessor error"
4027 #: build/C/man2/sigaction.2:515
4029 msgid "B<ILL_BADSTK>"
4033 #: build/C/man2/sigaction.2:518
4034 msgid "internal stack error"
4038 #: build/C/man2/sigaction.2:525
4039 msgid "The following values can be placed in I<si_code> for a B<SIGFPE> signal:"
4043 #: build/C/man2/sigaction.2:526
4045 msgid "B<FPE_INTDIV>"
4049 #: build/C/man2/sigaction.2:529
4050 msgid "integer divide by zero"
4054 #: build/C/man2/sigaction.2:529
4056 msgid "B<FPE_INTOVF>"
4060 #: build/C/man2/sigaction.2:532
4061 msgid "integer overflow"
4065 #: build/C/man2/sigaction.2:532
4067 msgid "B<FPE_FLTDIV>"
4071 #: build/C/man2/sigaction.2:535
4072 msgid "floating-point divide by zero"
4076 #: build/C/man2/sigaction.2:535
4078 msgid "B<FPE_FLTOVF>"
4082 #: build/C/man2/sigaction.2:538
4083 msgid "floating-point overflow"
4087 #: build/C/man2/sigaction.2:538
4089 msgid "B<FPE_FLTUND>"
4093 #: build/C/man2/sigaction.2:541
4094 msgid "floating-point underflow"
4098 #: build/C/man2/sigaction.2:541
4100 msgid "B<FPE_FLTRES>"
4104 #: build/C/man2/sigaction.2:544
4105 msgid "floating-point inexact result"
4109 #: build/C/man2/sigaction.2:544
4111 msgid "B<FPE_FLTINV>"
4115 #: build/C/man2/sigaction.2:547
4116 msgid "floating-point invalid operation"
4120 #: build/C/man2/sigaction.2:547
4122 msgid "B<FPE_FLTSUB>"
4126 #: build/C/man2/sigaction.2:550
4127 msgid "subscript out of range"
4131 #: build/C/man2/sigaction.2:557
4132 msgid "The following values can be placed in I<si_code> for a B<SIGSEGV> signal:"
4136 #: build/C/man2/sigaction.2:558
4138 msgid "B<SEGV_MAPERR>"
4142 #: build/C/man2/sigaction.2:561
4143 msgid "address not mapped to object"
4147 #: build/C/man2/sigaction.2:561
4149 msgid "B<SEGV_ACCERR>"
4153 #: build/C/man2/sigaction.2:564
4154 msgid "invalid permissions for mapped object"
4158 #: build/C/man2/sigaction.2:571
4159 msgid "The following values can be placed in I<si_code> for a B<SIGBUS> signal:"
4163 #: build/C/man2/sigaction.2:572
4165 msgid "B<BUS_ADRALN>"
4169 #: build/C/man2/sigaction.2:575
4170 msgid "invalid address alignment"
4174 #: build/C/man2/sigaction.2:575
4176 msgid "B<BUS_ADRERR>"
4180 #: build/C/man2/sigaction.2:578
4181 msgid "nonexistent physical address"
4185 #: build/C/man2/sigaction.2:578
4187 msgid "B<BUS_OBJERR>"
4191 #: build/C/man2/sigaction.2:581
4192 msgid "object-specific hardware error"
4196 #: build/C/man2/sigaction.2:581
4198 msgid "B<BUS_MCEERR_AR> (since Linux 2.6.32)"
4202 #: build/C/man2/sigaction.2:584
4203 msgid "Hardware memory error consumed on a machine check; action required."
4207 #: build/C/man2/sigaction.2:584
4209 msgid "B<BUS_MCEERR_AO> (since Linux 2.6.32)"
4213 #: build/C/man2/sigaction.2:587
4214 msgid "Hardware memory error detected in process but not consumed; action optional."
4218 #: build/C/man2/sigaction.2:594
4219 msgid "The following values can be placed in I<si_code> for a B<SIGTRAP> signal:"
4223 #: build/C/man2/sigaction.2:595
4225 msgid "B<TRAP_BRKPT>"
4229 #: build/C/man2/sigaction.2:598
4230 msgid "process breakpoint"
4234 #: build/C/man2/sigaction.2:598
4236 msgid "B<TRAP_TRACE>"
4240 #: build/C/man2/sigaction.2:601
4241 msgid "process trace trap"
4245 #: build/C/man2/sigaction.2:601
4247 msgid "B<TRAP_BRANCH> (since Linux 2.4)"
4251 #: build/C/man2/sigaction.2:604
4252 msgid "process taken branch trap"
4256 #: build/C/man2/sigaction.2:604
4258 msgid "B<TRAP_HWBKPT> (since Linux 2.4)"
4262 #: build/C/man2/sigaction.2:607
4263 msgid "hardware breakpoint/watchpoint"
4267 #: build/C/man2/sigaction.2:614
4268 msgid "The following values can be placed in I<si_code> for a B<SIGCHLD> signal:"
4272 #: build/C/man2/sigaction.2:615
4274 msgid "B<CLD_EXITED>"
4278 #: build/C/man2/sigaction.2:618
4279 msgid "child has exited"
4283 #: build/C/man2/sigaction.2:618
4285 msgid "B<CLD_KILLED>"
4289 #: build/C/man2/sigaction.2:621
4290 msgid "child was killed"
4294 #: build/C/man2/sigaction.2:621
4296 msgid "B<CLD_DUMPED>"
4300 #: build/C/man2/sigaction.2:624
4301 msgid "child terminated abnormally"
4305 #: build/C/man2/sigaction.2:624
4307 msgid "B<CLD_TRAPPED>"
4311 #: build/C/man2/sigaction.2:627
4312 msgid "traced child has trapped"
4316 #: build/C/man2/sigaction.2:627
4318 msgid "B<CLD_STOPPED>"
4322 #: build/C/man2/sigaction.2:630
4323 msgid "child has stopped"
4327 #: build/C/man2/sigaction.2:630
4329 msgid "B<CLD_CONTINUED>"
4333 #: build/C/man2/sigaction.2:633
4334 msgid "stopped child has continued (since Linux 2.6.9)"
4338 #: build/C/man2/sigaction.2:640
4340 "The following values can be placed in I<si_code> for a B<SIGIO>/B<SIGPOLL> "
4345 #: build/C/man2/sigaction.2:641
4351 #: build/C/man2/sigaction.2:644
4352 msgid "data input available"
4356 #: build/C/man2/sigaction.2:644
4362 #: build/C/man2/sigaction.2:647
4363 msgid "output buffers available"
4367 #: build/C/man2/sigaction.2:647
4373 #: build/C/man2/sigaction.2:650
4374 msgid "input message available"
4378 #: build/C/man2/sigaction.2:650
4384 #: build/C/man2/sigaction.2:653
4389 #: build/C/man2/sigaction.2:653
4395 #: build/C/man2/sigaction.2:656
4396 msgid "high priority input available"
4400 #: build/C/man2/sigaction.2:656
4406 #: build/C/man2/sigaction.2:659
4407 msgid "device disconnected"
4411 #: build/C/man2/sigaction.2:665
4413 "B<sigaction>() returns 0 on success; on error, -1 is returned, and I<errno> "
4414 "is set to indicate the error."
4418 #: build/C/man2/sigaction.2:670
4420 "I<act> or I<oldact> points to memory which is not a valid part of the "
4421 "process address space."
4425 #: build/C/man2/sigaction.2:677
4427 "An invalid signal was specified. This will also be generated if an attempt "
4428 "is made to change the action for B<SIGKILL> or B<SIGSTOP>, which cannot be "
4429 "caught or ignored."
4432 #. SVr4 does not document the EINTR condition.
4434 #: build/C/man2/sigaction.2:680
4435 msgid "POSIX.1-2001, SVr4."
4439 #: build/C/man2/sigaction.2:688 build/C/man7/signal.7:105
4441 "A child created via B<fork>(2) inherits a copy of its parent's signal "
4442 "dispositions. During an B<execve>(2), the dispositions of handled signals "
4443 "are reset to the default; the dispositions of ignored signals are left "
4448 #: build/C/man2/sigaction.2:706 build/C/man2/signal.2:134
4450 "According to POSIX, the behavior of a process is undefined after it ignores "
4451 "a B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> signal that was not generated by "
4452 "B<kill>(2) or B<raise>(3). Integer division by zero has undefined result. "
4453 "On some architectures it will generate a B<SIGFPE> signal. (Also dividing "
4454 "the most negative integer by -1 may generate B<SIGFPE>.) Ignoring this "
4455 "signal might lead to an endless loop."
4459 #: build/C/man2/sigaction.2:723
4461 "POSIX.1-1990 disallowed setting the action for B<SIGCHLD> to B<SIG_IGN>. "
4462 "POSIX.1-2001 allows this possibility, so that ignoring B<SIGCHLD> can be "
4463 "used to prevent the creation of zombies (see B<wait>(2)). Nevertheless, the "
4464 "historical BSD and System V behaviors for ignoring B<SIGCHLD> differ, so "
4465 "that the only completely portable method of ensuring that terminated "
4466 "children do not become zombies is to catch the B<SIGCHLD> signal and perform "
4467 "a B<wait>(2) or similar."
4471 #: build/C/man2/sigaction.2:736
4473 "POSIX.1-1990 specified only B<SA_NOCLDSTOP>. POSIX.1-2001 added "
4474 "B<SA_NOCLDWAIT>, B<SA_RESETHAND>, B<SA_NODEFER>, and B<SA_SIGINFO>. Use of "
4475 "these latter values in I<sa_flags> may be less portable in applications "
4476 "intended for older UNIX implementations."
4480 #: build/C/man2/sigaction.2:740
4481 msgid "The B<SA_RESETHAND> flag is compatible with the SVr4 flag of the same name."
4485 #: build/C/man2/sigaction.2:750
4487 "The B<SA_NODEFER> flag is compatible with the SVr4 flag of the same name "
4488 "under kernels 1.3.9 and newer. On older kernels the Linux implementation "
4489 "allowed the receipt of any signal, not just the one we are installing "
4490 "(effectively overriding any I<sa_mask> settings)."
4494 #: build/C/man2/sigaction.2:756
4496 "B<sigaction>() can be called with a NULL second argument to query the "
4497 "current signal handler. It can also be used to check whether a given signal "
4498 "is valid for the current machine by calling it with NULL second and third "
4503 #: build/C/man2/sigaction.2:762
4505 "It is not possible to block B<SIGKILL> or B<SIGSTOP> (by specifying them in "
4506 "I<sa_mask>). Attempts to do so are silently ignored."
4510 #: build/C/man2/sigaction.2:766 build/C/man2/sigpending.2:70 build/C/man2/sigprocmask.2:144 build/C/man2/sigsuspend.2:108
4511 msgid "See B<sigsetops>(3) for details on manipulating signal sets."
4515 #: build/C/man2/sigaction.2:771
4517 "See B<signal>(7) for a list of the async-signal-safe functions that can be "
4518 "safely called inside from inside a signal handler."
4522 #: build/C/man2/sigaction.2:771
4524 msgid "Undocumented"
4528 #: build/C/man2/sigaction.2:781
4530 "Before the introduction of B<SA_SIGINFO> it was also possible to get some "
4531 "additional information, namely by using a I<sa_handler> with second argument "
4532 "of type I<struct sigcontext>. See the relevant Linux kernel sources for "
4533 "details. This use is obsolete now."
4537 #: build/C/man2/sigaction.2:790
4539 "In kernels up to and including 2.6.13, specifying B<SA_NODEFER> in "
4540 "I<sa_flags> prevents not only the delivered signal from being masked during "
4541 "execution of the handler, but also the signals specified in I<sa_mask>. "
4542 "This bug was fixed in kernel 2.6.14."
4546 #: build/C/man2/sigaction.2:793
4547 msgid "See B<mprotect>(2)."
4551 #: build/C/man2/sigaction.2:813
4553 "B<kill>(1), B<kill>(2), B<killpg>(2), B<pause>(2), B<restart_syscall>(2), "
4554 "B<sigaltstack>(2), B<signal>(2), B<signalfd>(2), B<sigpending>(2), "
4555 "B<sigprocmask>(2), B<sigsuspend>(2), B<wait>(2), B<raise>(3), "
4556 "B<siginterrupt>(3), B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), "
4557 "B<core>(5), B<signal>(7)"
4561 #: build/C/man2/sigaltstack.2:27
4567 #: build/C/man2/sigaltstack.2:27
4573 #: build/C/man2/sigaltstack.2:30
4574 msgid "sigaltstack - set and/or get signal stack context"
4578 #: build/C/man2/sigaltstack.2:34
4579 msgid "B<int sigaltstack(const stack_t *>I<ss>B<, stack_t *>I<oss>B<);>"
4583 #: build/C/man2/sigaltstack.2:41
4584 msgid "B<sigaltstack>():"
4588 #: build/C/man2/sigaltstack.2:48 build/C/man3/siginterrupt.3:53 build/C/man2/wait.2:78
4589 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
4593 #: build/C/man2/sigaltstack.2:60
4595 "B<sigaltstack>() allows a process to define a new alternate signal stack "
4596 "and/or retrieve the state of an existing alternate signal stack. An "
4597 "alternate signal stack is used during the execution of a signal handler if "
4598 "the establishment of that handler (see B<sigaction>(2)) requested it."
4602 #: build/C/man2/sigaltstack.2:63
4604 "The normal sequence of events for using an alternate signal stack is the "
4609 #: build/C/man2/sigaltstack.2:63 build/C/man7/signal.7:387
4615 #: build/C/man2/sigaltstack.2:67
4616 msgid "Allocate an area of memory to be used for the alternate signal stack."
4620 #: build/C/man2/sigaltstack.2:67 build/C/man7/signal.7:391
4626 #: build/C/man2/sigaltstack.2:73
4628 "Use B<sigaltstack>() to inform the system of the existence and location of "
4629 "the alternate signal stack."
4633 #: build/C/man2/sigaltstack.2:73 build/C/man7/signal.7:411
4639 #: build/C/man2/sigaltstack.2:80
4641 "When establishing a signal handler using B<sigaction>(2), inform the system "
4642 "that the signal handler should be executed on the alternate signal stack by "
4643 "specifying the B<SA_ONSTACK> flag."
4647 #: build/C/man2/sigaltstack.2:88
4649 "The I<ss> argument is used to specify a new alternate signal stack, while "
4650 "the I<oss> argument is used to retrieve information about the currently "
4651 "established signal stack. If we are interested in performing just one of "
4652 "these tasks then the other argument can be specified as NULL. Each of these "
4653 "arguments is a structure of the following type:"
4657 #: build/C/man2/sigaltstack.2:96
4660 "typedef struct {\n"
4661 " void *ss_sp; /* Base address of stack */\n"
4662 " int ss_flags; /* Flags */\n"
4663 " size_t ss_size; /* Number of bytes in stack */\n"
4668 #: build/C/man2/sigaltstack.2:107
4670 "To establish a new alternate signal stack, I<ss.ss_flags> is set to zero, "
4671 "and I<ss.ss_sp> and I<ss.ss_size> specify the starting address and size of "
4672 "the stack. The constant B<SIGSTKSZ> is defined to be large enough to cover "
4673 "the usual size requirements for an alternate signal stack, and the constant "
4674 "B<MINSIGSTKSZ> defines the minimum size required to execute a signal "
4679 #: build/C/man2/sigaltstack.2:111
4681 "When a signal handler is invoked on the alternate stack, the kernel "
4682 "automatically aligns the address given in I<ss.ss_sp> to a suitable address "
4683 "boundary for the underlying hardware architecture."
4687 #: build/C/man2/sigaltstack.2:116
4689 "To disable an existing stack, specify I<ss.ss_flags> as B<SS_DISABLE>. In "
4690 "this case, the remaining fields in I<ss> are ignored."
4694 #: build/C/man2/sigaltstack.2:124
4696 "If I<oss> is not NULL, then it is used to return information about the "
4697 "alternate signal stack which was in effect prior to the call to "
4698 "B<sigaltstack>(). The I<oss.ss_sp> and I<oss.ss_size> fields return the "
4699 "starting address and size of that stack. The I<oss.ss_flags> may return "
4700 "either of the following values:"
4704 #: build/C/man2/sigaltstack.2:124
4706 msgid "B<SS_ONSTACK>"
4710 #: build/C/man2/sigaltstack.2:130
4712 "The process is currently executing on the alternate signal stack. (Note "
4713 "that it is not possible to change the alternate signal stack if the process "
4714 "is currently executing on it.)"
4718 #: build/C/man2/sigaltstack.2:130
4720 msgid "B<SS_DISABLE>"
4724 #: build/C/man2/sigaltstack.2:133
4725 msgid "The alternate signal stack is currently disabled."
4729 #: build/C/man2/sigaltstack.2:137
4731 "B<sigaltstack>() returns 0 on success, or -1 on failure with I<errno> set "
4732 "to indicate the error."
4736 #: build/C/man2/sigaltstack.2:142
4738 "Either I<ss> or I<oss> is not NULL and points to an area outside of the "
4739 "process's address space."
4743 #: build/C/man2/sigaltstack.2:147
4745 "I<ss> is not NULL and the I<ss_flags> field contains a nonzero value other "
4746 "than B<SS_DISABLE>."
4750 #: build/C/man2/sigaltstack.2:151
4752 "The specified size of the new alternate signal stack (I<ss.ss_size>) was "
4753 "less than B<MINSTKSZ>."
4757 #: build/C/man2/sigaltstack.2:156
4759 "An attempt was made to change the alternate signal stack while it was active "
4760 "(i.e., the process was already executing on the current alternate signal "
4765 #: build/C/man2/sigaltstack.2:158
4766 msgid "SUSv2, SVr4, POSIX.1-2001."
4770 #: build/C/man2/sigaltstack.2:166
4772 "The most common usage of an alternate signal stack is to handle the "
4773 "B<SIGSEGV> signal that is generated if the space available for the normal "
4774 "process stack is exhausted: in this case, a signal handler for B<SIGSEGV> "
4775 "cannot be invoked on the process stack; if we wish to handle it, we must use "
4776 "an alternate signal stack."
4780 #: build/C/man2/sigaltstack.2:176
4782 "Establishing an alternate signal stack is useful if a process expects that "
4783 "it may exhaust its standard stack. This may occur, for example, because the "
4784 "stack grows so large that it encounters the upwardly growing heap, or it "
4785 "reaches a limit established by a call to B<setrlimit(RLIMIT_STACK, &rlim)>. "
4786 "If the standard stack is exhausted, the kernel sends the process a "
4787 "B<SIGSEGV> signal. In these circumstances the only way to catch this signal "
4788 "is on an alternate signal stack."
4792 #: build/C/man2/sigaltstack.2:182
4794 "On most hardware architectures supported by Linux, stacks grow downward. "
4795 "B<sigaltstack>() automatically takes account of the direction of stack "
4800 #: build/C/man2/sigaltstack.2:191
4802 "Functions called from a signal handler executing on an alternate signal "
4803 "stack will also use the alternate signal stack. (This also applies to any "
4804 "handlers invoked for other signals while the process is executing on the "
4805 "alternate signal stack.) Unlike the standard stack, the system does not "
4806 "automatically extend the alternate signal stack. Exceeding the allocated "
4807 "size of the alternate signal stack will lead to unpredictable results."
4811 #: build/C/man2/sigaltstack.2:199
4813 "A successful call to B<execve>(2) removes any existing alternate signal "
4814 "stack. A child process created via B<fork>(2) inherits a copy of its "
4815 "parent's alternate signal stack settings."
4819 #: build/C/man2/sigaltstack.2:208
4821 "B<sigaltstack>() supersedes the older B<sigstack>() call. For backward "
4822 "compatibility, glibc also provides B<sigstack>(). All new applications "
4823 "should be written using B<sigaltstack>()."
4827 #: build/C/man2/sigaltstack.2:208 build/C/man3/sigpause.3:61
4833 #: build/C/man2/sigaltstack.2:215
4835 "4.2BSD had a B<sigstack>() system call. It used a slightly different "
4836 "struct, and had the major disadvantage that the caller had to know the "
4837 "direction of stack growth."
4841 #: build/C/man2/sigaltstack.2:218
4842 msgid "The following code segment demonstrates the use of B<sigaltstack>():"
4846 #: build/C/man2/sigaltstack.2:222
4848 msgid "stack_t ss;\n"
4852 #: build/C/man2/sigaltstack.2:230
4855 "ss.ss_sp = malloc(SIGSTKSZ);\n"
4856 "if (ss.ss_sp == NULL)\n"
4857 " /* Handle error */;\n"
4858 "ss.ss_size = SIGSTKSZ;\n"
4859 "ss.ss_flags = 0;\n"
4860 "if (sigaltstack(&ss, NULL) == -1)\n"
4861 " /* Handle error */;\n"
4865 #: build/C/man2/sigaltstack.2:239
4867 "B<execve>(2), B<setrlimit>(2), B<sigaction>(2), B<siglongjmp>(3), "
4868 "B<sigsetjmp>(3), B<signal>(7)"
4872 #: build/C/man7/sigevent.7:26
4878 #: build/C/man7/sigevent.7:26
4884 #: build/C/man7/sigevent.7:29
4885 msgid "sigevent - structure for notification from asynchronous routines"
4889 #: build/C/man7/sigevent.7:36
4892 "union sigval { /* Data passed with notification */\n"
4893 " int sival_int; /* Integer value */\n"
4894 " void *sival_ptr; /* Pointer value */\n"
4899 #: build/C/man7/sigevent.7:51
4902 "struct sigevent {\n"
4903 " int sigev_notify; /* Notification method */\n"
4904 " int sigev_signo; /* Notification signal */\n"
4905 " union sigval sigev_value; /* Data passed with\n"
4906 " notification */\n"
4907 " void (*sigev_notify_function) (union sigval);\n"
4908 " /* Function used for thread\n"
4909 " notification (SIGEV_THREAD) */\n"
4910 " void *sigev_notify_attributes;\n"
4911 " /* Attributes for notification thread\n"
4912 " (SIGEV_THREAD) */\n"
4913 " pid_t sigev_notify_thread_id;\n"
4914 " /* ID of thread to signal (SIGEV_THREAD_ID) */\n"
4919 #: build/C/man7/sigevent.7:60
4921 "The I<sigevent> structure is used by various APIs to describe the way a "
4922 "process is to be notified about an event (e.g., completion of an "
4923 "asynchronous request, expiration of a timer, or the arrival of a message)."
4927 #: build/C/man7/sigevent.7:68
4929 "The definition shown in the SYNOPSIS is approximate: some of the fields in "
4930 "the I<sigevent> structure may be defined as part of a union. Programs "
4931 "should employ only those fields relevant to the value specified in "
4936 #: build/C/man7/sigevent.7:73
4938 "The I<sigev_notify> field specifies how notification is to be performed. "
4939 "This field can have one of the following values:"
4943 #: build/C/man7/sigevent.7:73 build/C/man2/timer_create.2:107
4945 msgid "B<SIGEV_NONE>"
4949 #: build/C/man7/sigevent.7:76
4950 msgid "A \"null\" notification: don't do anything when the event occurs."
4954 #: build/C/man7/sigevent.7:76 build/C/man2/timer_create.2:112
4956 msgid "B<SIGEV_SIGNAL>"
4960 #: build/C/man7/sigevent.7:80
4961 msgid "Notify the process by sending the signal specified in I<sigev_signo>."
4965 #: build/C/man7/sigevent.7:87
4967 "If the signal is caught with a signal handler that was registered using the "
4968 "B<sigaction>(2) B<SA_SIGINFO> flag, then the following fields are set in "
4969 "the I<siginfo_t> structure that is passed as the second argument of the "
4974 #: build/C/man7/sigevent.7:92
4976 "This field is set to a value that depends on the API delivering the "
4981 #: build/C/man7/sigevent.7:92 build/C/man2/wait.2:300
4987 #: build/C/man7/sigevent.7:96
4989 "This field is set to the signal number (i.e., the same value as in "
4994 #: build/C/man7/sigevent.7:100
4995 msgid "This field is set to the value specified in I<sigev_value>."
4999 #: build/C/man7/sigevent.7:105
5001 "Depending on the API, other fields may also be set in the I<siginfo_t> "
5006 #: build/C/man7/sigevent.7:108
5008 "The same information is also available if the signal is accepted using "
5009 "B<sigwaitinfo>(2)."
5013 #: build/C/man7/sigevent.7:108 build/C/man2/timer_create.2:130
5015 msgid "B<SIGEV_THREAD>"
5019 #: build/C/man7/sigevent.7:125
5021 "Notify the process by invoking I<sigev_notify_function> \"as if\" it were "
5022 "the start function of a new thread. (Among the implementation possibilities "
5023 "here are that each timer notification could result in the creation of a new "
5024 "thread, or that a single thread is created to receive all notifications.) "
5025 "The function is invoked with I<sigev_value> as its sole argument. If "
5026 "I<sigev_notify_attributes> is not NULL, it should point to a "
5027 "I<pthread_attr_t> structure that defines attributes for the new thread (see "
5028 "B<pthread_attr_init>(3))."
5032 #: build/C/man7/sigevent.7:125 build/C/man2/timer_create.2:138
5034 msgid "B<SIGEV_THREAD_ID> (Linux-specific)"
5037 #. | SIGEV_SIGNAL vs not?
5039 #: build/C/man7/sigevent.7:130
5040 msgid "Currently used only by POSIX timers; see B<timer_create>(2)."
5044 #: 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
5045 msgid "POSIX.1-2001."
5049 #: build/C/man7/sigevent.7:142
5051 "B<timer_create>(2), B<aio_fsync>(3), B<aio_read>(3), B<aio_write>(3), "
5052 "B<getaddrinfo_a>(3), B<lio_listio>(3), B<mq_notify>(3), B<aio>(7), "
5057 #: build/C/man3/siginterrupt.3:31
5059 msgid "SIGINTERRUPT"
5063 #: 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
5069 #: build/C/man3/siginterrupt.3:34
5070 msgid "siginterrupt - allow signals to interrupt system calls"
5074 #: build/C/man3/siginterrupt.3:39
5076 msgid "B<int siginterrupt(int >I<sig>B<, int >I<flag>B<);>\n"
5080 #: build/C/man3/siginterrupt.3:47
5081 msgid "B<siginterrupt>():"
5085 #: build/C/man3/siginterrupt.3:64
5087 "The B<siginterrupt>() function changes the restart behavior when a system "
5088 "call is interrupted by the signal I<sig>. If the I<flag> argument is false "
5089 "(0), then system calls will be restarted if interrupted by the specified "
5090 "signal I<sig>. This is the default behavior in Linux."
5094 #: build/C/man3/siginterrupt.3:69
5096 "If the I<flag> argument is true (1) and no data has been transferred, then a "
5097 "system call interrupted by the signal I<sig> will return -1 and I<errno> "
5098 "will be set to B<EINTR>."
5102 #: build/C/man3/siginterrupt.3:73
5104 "If the I<flag> argument is true (1) and data transfer has started, then the "
5105 "system call will be interrupted and will return the actual amount of data "
5110 #: build/C/man3/siginterrupt.3:83
5112 "The B<siginterrupt>() function returns 0 on success. It returns -1 if the "
5113 "signal number I<sig> is invalid, with I<errno> set to indicate the cause of "
5118 #: build/C/man3/siginterrupt.3:87
5119 msgid "The specified signal number is invalid."
5123 #: build/C/man3/siginterrupt.3:96
5125 "4.3BSD, POSIX.1-2001. POSIX.1-2008 marks B<siginterrupt>() as obsolete, "
5126 "recommending the use of B<sigaction>(2) with the B<SA_RESTART> flag "
5131 #: build/C/man3/siginterrupt.3:98
5132 msgid "B<signal>(2)"
5136 #: build/C/man2/signal.2:36 build/C/man7/signal.7:46
5142 #: build/C/man2/signal.2:39
5143 msgid "signal - ANSI C signal handling"
5147 #: build/C/man2/signal.2:45
5148 msgid "B<sighandler_t signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
5152 #: build/C/man2/signal.2:54
5154 "The behavior of B<signal>() varies across UNIX versions, and has also "
5155 "varied historically across different versions of Linux. B<Avoid its use>: "
5156 "use B<sigaction>(2) instead. See I<Portability> below."
5160 #: build/C/man2/signal.2:64
5162 "B<signal>() sets the disposition of the signal I<signum> to I<handler>, "
5163 "which is either B<SIG_IGN>, B<SIG_DFL>, or the address of a "
5164 "programmer-defined function (a \"signal handler\")."
5168 #: build/C/man2/signal.2:68
5170 "If the signal I<signum> is delivered to the process, then one of the "
5171 "following happens:"
5175 #: build/C/man2/signal.2:73
5176 msgid "If the disposition is set to B<SIG_IGN>, then the signal is ignored."
5180 #: build/C/man2/signal.2:80
5182 "If the disposition is set to B<SIG_DFL>, then the default action associated "
5183 "with the signal (see B<signal>(7)) occurs."
5187 #: build/C/man2/signal.2:91
5189 "If the disposition is set to a function, then first either the disposition "
5190 "is reset to B<SIG_DFL>, or the signal is blocked (see I<Portability> below), "
5191 "and then I<handler> is called with argument I<signum>. If invocation of the "
5192 "handler caused the signal to be blocked, then the signal is unblocked upon "
5193 "return from the handler."
5197 #: build/C/man2/signal.2:97
5198 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught or ignored."
5202 #: build/C/man2/signal.2:105
5204 "B<signal>() returns the previous value of the signal handler, or B<SIG_ERR> "
5205 "on error. In the event of an error, I<errno> is set to indicate the cause."
5209 #: build/C/man2/signal.2:110
5210 msgid "I<signum> is invalid."
5214 #: build/C/man2/signal.2:116
5215 msgid "The effects of B<signal>() in a multithreaded process are unspecified."
5219 #: build/C/man2/signal.2:141
5221 "See B<sigaction>(2) for details on what happens when B<SIGCHLD> is set to "
5226 #: build/C/man2/signal.2:146
5228 "See B<signal>(7) for a list of the async-signal-safe functions that can be "
5229 "safely called from inside a signal handler."
5232 #. libc4 and libc5 define
5233 #. .IR SignalHandler ;
5235 #: build/C/man2/signal.2:162
5237 "The use of I<sighandler_t> is a GNU extension, exposed if B<_GNU_SOURCE> is "
5238 "defined; glibc also defines (the BSD-derived) I<sig_t> if B<_BSD_SOURCE> is "
5239 "defined. Without use of such a type, the declaration of B<signal>() is the "
5240 "somewhat harder to read:"
5244 #: build/C/man2/signal.2:166
5247 "B<void ( *>I<signal>B<(int >I<signum>B<, void (*>I<handler>B<)(int)) ) "
5252 #: build/C/man2/signal.2:168
5258 #: build/C/man2/signal.2:180
5260 "The only portable use of B<signal>() is to set a signal's disposition to "
5261 "B<SIG_DFL> or B<SIG_IGN>. The semantics when using B<signal>() to "
5262 "establish a signal handler vary across systems (and POSIX.1 explicitly "
5263 "permits this variation); B<do not use it for this purpose.>"
5267 #: build/C/man2/signal.2:186
5269 "POSIX.1 solved the portability mess by specifying B<sigaction>(2), which "
5270 "provides explicit control of the semantics when a signal handler is invoked; "
5271 "use that interface instead of B<signal>()."
5275 #: build/C/man2/signal.2:196
5277 "In the original UNIX systems, when a handler that was established using "
5278 "B<signal>() was invoked by the delivery of a signal, the disposition of the "
5279 "signal would be reset to B<SIG_DFL>, and the system did not block delivery "
5280 "of further instances of the signal. This is equivalent to calling "
5281 "B<sigaction>(2) with the following flags:"
5285 #: build/C/man2/signal.2:198
5287 msgid " sa.sa_flags = SA_RESETHAND | SA_NODEFER;\n"
5291 #: build/C/man2/signal.2:205
5293 "System V also provides these semantics for B<signal>(). This was bad "
5294 "because the signal might be delivered again before the handler had a chance "
5295 "to reestablish itself. Furthermore, rapid deliveries of the same signal "
5296 "could result in recursive invocations of the handler."
5300 #: build/C/man2/signal.2:220
5302 "BSD improved on this situation, but unfortunately also changed the semantics "
5303 "of the existing B<signal>() interface while doing so. On BSD, when a "
5304 "signal handler is invoked, the signal disposition is not reset, and further "
5305 "instances of the signal are blocked from being delivered while the handler "
5306 "is executing. Furthermore, certain blocking system calls are automatically "
5307 "restarted if interrupted by a signal handler (see B<signal>(7)). The BSD "
5308 "semantics are equivalent to calling B<sigaction>(2) with the following "
5313 #: build/C/man2/signal.2:222
5315 msgid " sa.sa_flags = SA_RESTART;\n"
5319 #: build/C/man2/signal.2:224
5320 msgid "The situation on Linux is as follows:"
5324 #: build/C/man2/signal.2:228
5325 msgid "The kernel's B<signal>() system call provides System V semantics."
5329 #: build/C/man2/signal.2:244
5331 "By default, in glibc 2 and later, the B<signal>() wrapper function does not "
5332 "invoke the kernel system call. Instead, it calls B<sigaction>(2) using "
5333 "flags that supply BSD semantics. This default behavior is provided as long "
5334 "as the B<_BSD_SOURCE> feature test macro is defined. By default, "
5335 "B<_BSD_SOURCE> is defined; it is also implicitly defined if one defines "
5336 "B<_GNU_SOURCE>, and can of course be explicitly defined."
5340 #. System V semantics are also provided if one uses the separate
5341 #. .BR sysv_signal (3)
5344 #: build/C/man2/signal.2:267
5346 "On glibc 2 and later, if the B<_BSD_SOURCE> feature test macro is not "
5347 "defined, then B<signal>() provides System V semantics. (The default "
5348 "implicit definition of B<_BSD_SOURCE> is not provided if one invokes "
5349 "B<gcc>(1) in one of its standard modes (I<-std=xxx> or I<-ansi>) or "
5350 "defines various other feature test macros such as B<_POSIX_SOURCE>, "
5351 "B<_XOPEN_SOURCE>, or B<_SVID_SOURCE>; see B<feature_test_macros>(7).)"
5355 #: build/C/man2/signal.2:278
5357 "The B<signal>() function in Linux libc4 and libc5 provide System V "
5358 "semantics. If one on a libc5 system includes I<E<lt>bsd/signal.hE<gt>> "
5359 "instead of I<E<lt>signal.hE<gt>>, then B<signal>() provides BSD semantics."
5363 #: build/C/man2/signal.2:297
5365 "B<kill>(1), B<alarm>(2), B<kill>(2), B<killpg>(2), B<pause>(2), "
5366 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
5367 "B<sigsuspend>(2), B<bsd_signal>(3), B<raise>(3), B<siginterrupt>(3), "
5368 "B<sigqueue>(3), B<sigsetops>(3), B<sigvec>(3), B<sysv_signal>(3), "
5373 #: build/C/man7/signal.7:49
5374 msgid "signal - overview of signals"
5378 #: build/C/man7/signal.7:52
5380 "Linux supports both POSIX reliable signals (hereinafter \"standard "
5381 "signals\") and POSIX real-time signals."
5385 #: build/C/man7/signal.7:52
5387 msgid "Signal dispositions"
5391 #: build/C/man7/signal.7:57
5393 "Each signal has a current I<disposition>, which determines how the process "
5394 "behaves when it is delivered the signal."
5398 #: build/C/man7/signal.7:60
5400 "The entries in the \"Action\" column of the tables below specify the default "
5401 "disposition for each signal, as follows:"
5405 #: build/C/man7/signal.7:60
5411 #: build/C/man7/signal.7:62
5412 msgid "Default action is to terminate the process."
5416 #: build/C/man7/signal.7:62
5422 #: build/C/man7/signal.7:64
5423 msgid "Default action is to ignore the signal."
5427 #: build/C/man7/signal.7:64
5433 #: build/C/man7/signal.7:67
5434 msgid "Default action is to terminate the process and dump core (see B<core>(5))."
5438 #: build/C/man7/signal.7:67
5444 #: build/C/man7/signal.7:69
5445 msgid "Default action is to stop the process."
5449 #: build/C/man7/signal.7:69
5455 #: build/C/man7/signal.7:71
5456 msgid "Default action is to continue the process if it is currently stopped."
5460 #: build/C/man7/signal.7:93
5462 "A process can change the disposition of a signal using B<sigaction>(2) or "
5463 "B<signal>(2). (The latter is less portable when establishing a signal "
5464 "handler; see B<signal>(2) for details.) Using these system calls, a "
5465 "process can elect one of the following behaviors to occur on delivery of the "
5466 "signal: perform the default action; ignore the signal; or catch the signal "
5467 "with a I<signal handler>, a programmer-defined function that is "
5468 "automatically invoked when the signal is delivered. (By default, the signal "
5469 "handler is invoked on the normal process stack. It is possible to arrange "
5470 "that the signal handler uses an alternate stack; see B<sigaltstack>(2) for "
5471 "a discussion of how to do this and when it might be useful.)"
5475 #: build/C/man7/signal.7:97
5477 "The signal disposition is a per-process attribute: in a multithreaded "
5478 "application, the disposition of a particular signal is the same for all "
5483 #: build/C/man7/signal.7:105
5485 msgid "Sending a signal"
5489 #: build/C/man7/signal.7:108
5491 "The following system calls and library functions allow the caller to send a "
5496 #: build/C/man7/signal.7:108
5502 #: build/C/man7/signal.7:111
5503 msgid "Sends a signal to the calling thread."
5507 #: build/C/man7/signal.7:116
5509 "Sends a signal to a specified process, to all members of a specified process "
5510 "group, or to all processes on the system."
5514 #: build/C/man7/signal.7:116
5516 msgid "B<killpg>(2)"
5520 #: build/C/man7/signal.7:119
5521 msgid "Sends a signal to all of the members of a specified process group."
5525 #: build/C/man7/signal.7:119
5527 msgid "B<pthread_kill>(3)"
5531 #: build/C/man7/signal.7:123
5533 "Sends a signal to a specified POSIX thread in the same process as the "
5538 #: build/C/man7/signal.7:123
5540 msgid "B<tgkill>(2)"
5544 #: build/C/man7/signal.7:128
5546 "Sends a signal to a specified thread within a specific process. (This is "
5547 "the system call used to implement B<pthread_kill>(3).)"
5551 #: build/C/man7/signal.7:131
5552 msgid "Sends a real-time signal with accompanying data to a specified process."
5556 #: build/C/man7/signal.7:131
5558 msgid "Waiting for a signal to be caught"
5562 #: build/C/man7/signal.7:135
5564 "The following system calls suspend execution of the calling process or "
5565 "thread until a signal is caught (or an unhandled signal terminates the "
5570 #: build/C/man7/signal.7:135
5576 #: build/C/man7/signal.7:138
5577 msgid "Suspends execution until any signal is caught."
5581 #: build/C/man7/signal.7:138
5583 msgid "B<sigsuspend>(2)"
5587 #: build/C/man7/signal.7:142
5589 "Temporarily changes the signal mask (see below) and suspends execution until "
5590 "one of the unmasked signals is caught."
5594 #: build/C/man7/signal.7:142
5596 msgid "Synchronously accepting a signal"
5600 #: build/C/man7/signal.7:149
5602 "Rather than asynchronously catching a signal via a signal handler, it is "
5603 "possible to synchronously accept the signal, that is, to block execution "
5604 "until the signal is delivered, at which point the kernel returns information "
5605 "about the signal to the caller. There are two general ways to do this:"
5609 #: build/C/man7/signal.7:157
5611 "B<sigwaitinfo>(2), B<sigtimedwait>(2), and B<sigwait>(3) suspend execution "
5612 "until one of the signals in a specified set is delivered. Each of these "
5613 "calls returns information about the delivered signal."
5617 #: build/C/man7/signal.7:170
5619 "B<signalfd>(2) returns a file descriptor that can be used to read "
5620 "information about signals that are delivered to the caller. Each B<read>(2) "
5621 "from this file descriptor blocks until one of the signals in the set "
5622 "specified in the B<signalfd>(2) call is delivered to the caller. The "
5623 "buffer returned by B<read>(2) contains a structure describing the signal."
5627 #: build/C/man7/signal.7:170
5629 msgid "Signal mask and pending signals"
5633 #: build/C/man7/signal.7:177
5635 "A signal may be I<blocked>, which means that it will not be delivered until "
5636 "it is later unblocked. Between the time when it is generated and when it is "
5637 "delivered a signal is said to be I<pending>."
5641 #: build/C/man7/signal.7:186
5643 "Each thread in a process has an independent I<signal mask>, which indicates "
5644 "the set of signals that the thread is currently blocking. A thread can "
5645 "manipulate its signal mask using B<pthread_sigmask>(3). In a traditional "
5646 "single-threaded application, B<sigprocmask>(2) can be used to manipulate "
5651 #: build/C/man7/signal.7:192 build/C/man2/sigprocmask.2:126
5653 "A child created via B<fork>(2) inherits a copy of its parent's signal mask; "
5654 "the signal mask is preserved across B<execve>(2)."
5658 #: build/C/man7/signal.7:209
5660 "A signal may be generated (and thus pending) for a process as a whole "
5661 "(e.g., when sent using B<kill>(2)) or for a specific thread (e.g., certain "
5662 "signals, such as B<SIGSEGV> and B<SIGFPE>, generated as a consequence of "
5663 "executing a specific machine-language instruction are thread directed, as "
5664 "are signals targeted at a specific thread using B<pthread_kill>(3)). A "
5665 "process-directed signal may be delivered to any one of the threads that does "
5666 "not currently have the signal blocked. If more than one of the threads has "
5667 "the signal unblocked, then the kernel chooses an arbitrary thread to which "
5668 "to deliver the signal."
5672 #: build/C/man7/signal.7:216
5674 "A thread can obtain the set of signals that it currently has pending using "
5675 "B<sigpending>(2). This set will consist of the union of the set of pending "
5676 "process-directed signals and the set of signals pending for the calling "
5681 #: build/C/man7/signal.7:222 build/C/man2/sigpending.2:81
5683 "A child created via B<fork>(2) initially has an empty pending signal set; "
5684 "the pending signal set is preserved across an B<execve>(2)."
5688 #: build/C/man7/signal.7:222
5690 msgid "Standard signals"
5694 #: build/C/man7/signal.7:234
5696 "Linux supports the standard signals listed below. Several signal numbers "
5697 "are architecture-dependent, as indicated in the \"Value\" column. (Where "
5698 "three values are given, the first one is usually valid for alpha and sparc, "
5699 "the middle one for x86, arm, and most other architectures, and the last one "
5700 "for mips. (Values for parisc are I<not> shown; see the Linux kernel source "
5701 "for signal numbering on that architecture.) A - denotes that a signal is "
5702 "absent on the corresponding architecture.)"
5706 #: build/C/man7/signal.7:236
5707 msgid "First the signals described in the original POSIX.1-1990 standard."
5711 #: build/C/man7/signal.7:240 build/C/man7/signal.7:276 build/C/man7/signal.7:305
5713 msgid "Signal\tValue\tAction\tComment\n"
5717 #: build/C/man7/signal.7:241
5719 msgid "SIGHUP\t\\01\tTerm\tHangup detected on controlling terminal\n"
5723 #: build/C/man7/signal.7:242
5725 msgid "\t\t\tor death of controlling process\n"
5729 #: build/C/man7/signal.7:243
5731 msgid "SIGINT\t\\02\tTerm\tInterrupt from keyboard\n"
5735 #: build/C/man7/signal.7:244
5737 msgid "SIGQUIT\t\\03\tCore\tQuit from keyboard\n"
5741 #: build/C/man7/signal.7:245
5743 msgid "SIGILL\t\\04\tCore\tIllegal Instruction\n"
5747 #: build/C/man7/signal.7:246
5749 msgid "SIGABRT\t\\06\tCore\tAbort signal from B<abort>(3)\n"
5753 #: build/C/man7/signal.7:247
5755 msgid "SIGFPE\t\\08\tCore\tFloating point exception\n"
5759 #: build/C/man7/signal.7:248
5761 msgid "SIGKILL\t\\09\tTerm\tKill signal\n"
5765 #: build/C/man7/signal.7:249
5767 msgid "SIGSEGV\t11\tCore\tInvalid memory reference\n"
5771 #: build/C/man7/signal.7:250
5773 msgid "SIGPIPE\t13\tTerm\tBroken pipe: write to pipe with no\n"
5777 #: build/C/man7/signal.7:251
5779 msgid "\t\t\treaders\n"
5783 #: build/C/man7/signal.7:252
5785 msgid "SIGALRM\t14\tTerm\tTimer signal from B<alarm>(2)\n"
5789 #: build/C/man7/signal.7:253
5791 msgid "SIGTERM\t15\tTerm\tTermination signal\n"
5795 #: build/C/man7/signal.7:254
5797 msgid "SIGUSR1\t30,10,16\tTerm\tUser-defined signal 1\n"
5801 #: build/C/man7/signal.7:255
5803 msgid "SIGUSR2\t31,12,17\tTerm\tUser-defined signal 2\n"
5807 #: build/C/man7/signal.7:256
5809 msgid "SIGCHLD\t20,17,18\tIgn\tChild stopped or terminated\n"
5813 #: build/C/man7/signal.7:257
5815 msgid "SIGCONT\t19,18,25\tCont\tContinue if stopped\n"
5819 #: build/C/man7/signal.7:258
5821 msgid "SIGSTOP\t17,19,23\tStop\tStop process\n"
5825 #: build/C/man7/signal.7:259
5827 msgid "SIGTSTP\t18,20,24\tStop\tStop typed at terminal\n"
5831 #: build/C/man7/signal.7:260
5833 msgid "SIGTTIN\t21,21,26\tStop\tTerminal input for background process\n"
5837 #: build/C/man7/signal.7:261
5839 msgid "SIGTTOU\t22,22,27\tStop\tTerminal output for background process\n"
5843 #: build/C/man7/signal.7:269
5844 msgid "The signals B<SIGKILL> and B<SIGSTOP> cannot be caught, blocked, or ignored."
5848 #: build/C/man7/signal.7:272
5850 "Next the signals not in the POSIX.1-1990 standard but described in SUSv2 and "
5855 #: build/C/man7/signal.7:277
5857 msgid "SIGBUS\t10,7,10\tCore\tBus error (bad memory access)\n"
5861 #: build/C/man7/signal.7:278
5863 msgid "SIGPOLL\t\tTerm\tPollable event (Sys V).\n"
5867 #: build/C/man7/signal.7:279
5869 msgid "\t\t\tSynonym for B<SIGIO>\n"
5873 #: build/C/man7/signal.7:280
5875 msgid "SIGPROF\t27,27,29\tTerm\tProfiling timer expired\n"
5879 #: build/C/man7/signal.7:281
5881 msgid "SIGSYS\t12,31,12\tCore\tBad argument to routine (SVr4)\n"
5885 #: build/C/man7/signal.7:282
5887 msgid "SIGTRAP\t5\tCore\tTrace/breakpoint trap\n"
5891 #: build/C/man7/signal.7:283
5893 msgid "SIGURG\t16,23,21\tIgn\tUrgent condition on socket (4.2BSD)\n"
5897 #: build/C/man7/signal.7:284
5899 msgid "SIGVTALRM\t26,26,28\tTerm\tVirtual alarm clock (4.2BSD)\n"
5903 #: build/C/man7/signal.7:285
5905 msgid "SIGXCPU\t24,24,30\tCore\tCPU time limit exceeded (4.2BSD)\n"
5909 #: build/C/man7/signal.7:286
5911 msgid "SIGXFSZ\t25,25,31\tCore\tFile size limit exceeded (4.2BSD)\n"
5915 #: build/C/man7/signal.7:299
5917 "Up to and including Linux 2.2, the default behavior for B<SIGSYS>, "
5918 "B<SIGXCPU>, B<SIGXFSZ>, and (on architectures other than SPARC and MIPS) "
5919 "B<SIGBUS> was to terminate the process (without a core dump). (On some "
5920 "other UNIX systems the default action for B<SIGXCPU> and B<SIGXFSZ> is to "
5921 "terminate the process without a core dump.) Linux 2.4 conforms to the "
5922 "POSIX.1-2001 requirements for these signals, terminating the process with a "
5927 #: build/C/man7/signal.7:301
5928 msgid "Next various other signals."
5932 #: build/C/man7/signal.7:306
5934 msgid "SIGIOT\t6\tCore\tIOT trap. A synonym for B<SIGABRT>\n"
5938 #: build/C/man7/signal.7:307
5940 msgid "SIGEMT\t7,-,7\tTerm\n"
5944 #: build/C/man7/signal.7:308
5946 msgid "SIGSTKFLT\t-,16,-\tTerm\tStack fault on coprocessor (unused)\n"
5950 #: build/C/man7/signal.7:309
5952 msgid "SIGIO\t23,29,22\tTerm\tI/O now possible (4.2BSD)\n"
5956 #: build/C/man7/signal.7:310
5958 msgid "SIGCLD\t-,-,18\tIgn\tA synonym for B<SIGCHLD>\n"
5962 #: build/C/man7/signal.7:311
5964 msgid "SIGPWR\t29,30,19\tTerm\tPower failure (System V)\n"
5968 #: build/C/man7/signal.7:312
5970 msgid "SIGINFO\t29,-,-\t\tA synonym for B<SIGPWR>\n"
5974 #: build/C/man7/signal.7:313
5976 msgid "SIGLOST\t-,-,-\tTerm\tFile lock lost (unused)\n"
5980 #: build/C/man7/signal.7:314
5982 msgid "SIGWINCH\t28,28,20\tIgn\tWindow resize signal (4.3BSD, Sun)\n"
5986 #: build/C/man7/signal.7:315
5988 msgid "SIGUNUSED\t-,31,-\tCore\tSynonymous with B<SIGSYS>\n"
5992 #: build/C/man7/signal.7:325
5993 msgid "(Signal 29 is B<SIGINFO> / B<SIGPWR> on an alpha but B<SIGLOST> on a sparc.)"
5997 #: build/C/man7/signal.7:331
5999 "B<SIGEMT> is not specified in POSIX.1-2001, but nevertheless appears on most "
6000 "other UNIX systems, where its default action is typically to terminate the "
6001 "process with a core dump."
6005 #: build/C/man7/signal.7:335
6007 "B<SIGPWR> (which is not specified in POSIX.1-2001) is typically ignored by "
6008 "default on those other UNIX systems where it appears."
6012 #: build/C/man7/signal.7:339
6014 "B<SIGIO> (which is not specified in POSIX.1-2001) is ignored by default on "
6015 "several other UNIX systems."
6018 #. parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
6020 #: build/C/man7/signal.7:346
6022 "Where defined, B<SIGUNUSED> is synonymous with B<SIGSYS> on most "
6027 #: build/C/man7/signal.7:346
6029 msgid "Real-time signals"
6033 #: build/C/man7/signal.7:356
6035 "Linux supports real-time signals as originally defined in the POSIX.1b "
6036 "real-time extensions (and now included in POSIX.1-2001). The range of "
6037 "supported real-time signals is defined by the macros B<SIGRTMIN> and "
6038 "B<SIGRTMAX>. POSIX.1-2001 requires that an implementation support at least "
6039 "B<_POSIX_RTSIG_MAX> (8) real-time signals."
6043 #: build/C/man7/signal.7:378
6045 "The Linux kernel supports a range of 32 different real-time signals, "
6046 "numbered 33 to 64. However, the glibc POSIX threads implementation "
6047 "internally uses two (for NPTL) or three (for LinuxThreads) real-time signals "
6048 "(see B<pthreads>(7)), and adjusts the value of B<SIGRTMIN> suitably (to 34 "
6049 "or 35). Because the range of available real-time signals varies according "
6050 "to the glibc threading implementation (and this variation can occur at run "
6051 "time according to the available kernel and glibc), and indeed the range of "
6052 "real-time signals varies across UNIX systems, programs should I<never refer "
6053 "to real-time signals using hard-coded numbers>, but instead should always "
6054 "refer to real-time signals using the notation B<SIGRTMIN>+n, and include "
6055 "suitable (run-time) checks that B<SIGRTMIN>+n does not exceed B<SIGRTMAX>."
6059 #: build/C/man7/signal.7:382
6061 "Unlike standard signals, real-time signals have no predefined meanings: the "
6062 "entire set of real-time signals can be used for application-defined "
6067 #: build/C/man7/signal.7:385
6069 "The default action for an unhandled real-time signal is to terminate the "
6070 "receiving process."
6074 #: build/C/man7/signal.7:387
6075 msgid "Real-time signals are distinguished by the following:"
6079 #: build/C/man7/signal.7:391
6081 "Multiple instances of real-time signals can be queued. By contrast, if "
6082 "multiple instances of a standard signal are delivered while that signal is "
6083 "currently blocked, then only one instance is queued."
6087 #: build/C/man7/signal.7:411
6089 "If the signal is sent using B<sigqueue>(3), an accompanying value (either an "
6090 "integer or a pointer) can be sent with the signal. If the receiving process "
6091 "establishes a handler for this signal using the B<SA_SIGINFO> flag to "
6092 "B<sigaction>(2) then it can obtain this data via the I<si_value> field of "
6093 "the I<siginfo_t> structure passed as the second argument to the handler. "
6094 "Furthermore, the I<si_pid> and I<si_uid> fields of this structure can be "
6095 "used to obtain the PID and real user ID of the process sending the signal."
6099 #: build/C/man7/signal.7:420
6101 "Real-time signals are delivered in a guaranteed order. Multiple real-time "
6102 "signals of the same type are delivered in the order they were sent. If "
6103 "different real-time signals are sent to a process, they are delivered "
6104 "starting with the lowest-numbered signal. (I.e., low-numbered signals have "
6105 "highest priority.) By contrast, if multiple standard signals are pending "
6106 "for a process, the order in which they are delivered is unspecified."
6110 #: build/C/man7/signal.7:425
6112 "If both standard and real-time signals are pending for a process, POSIX "
6113 "leaves it unspecified which is delivered first. Linux, like many other "
6114 "implementations, gives priority to standard signals in this case."
6118 #: build/C/man7/signal.7:448
6120 "According to POSIX, an implementation should permit at least "
6121 "B<_POSIX_SIGQUEUE_MAX> (32) real-time signals to be queued to a process. "
6122 "However, Linux does things differently. In kernels up to and including "
6123 "2.6.7, Linux imposes a system-wide limit on the number of queued real-time "
6124 "signals for all processes. This limit can be viewed and (with privilege) "
6125 "changed via the I</proc/sys/kernel/rtsig-max> file. A related file, "
6126 "I</proc/sys/kernel/rtsig-nr>, can be used to find out how many real-time "
6127 "signals are currently queued. In Linux 2.6.8, these I</proc> interfaces "
6128 "were replaced by the B<RLIMIT_SIGPENDING> resource limit, which specifies a "
6129 "per-user limit for queued signals; see B<setrlimit>(2) for further details."
6133 #: build/C/man7/signal.7:448
6135 msgid "Async-signal-safe functions"
6139 #: build/C/man7/signal.7:457
6141 "A signal handler function must be very careful, since processing elsewhere "
6142 "may be interrupted at some arbitrary point in the execution of the program. "
6143 "POSIX has the concept of \"safe function\". If a signal interrupts the "
6144 "execution of an unsafe function, and I<handler> calls an unsafe function, "
6145 "then the behavior of the program is undefined."
6149 #: build/C/man7/signal.7:461
6151 "POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) requires "
6152 "an implementation to guarantee that the following functions can be safely "
6153 "called inside a signal handler:"
6157 #: build/C/man7/signal.7:582
6217 "posix_trace_event()\n"
6267 "timer_getoverrun()\n"
6281 #: build/C/man7/signal.7:587
6283 "POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf() from the above "
6284 "list, and adds the following functions:"
6288 #: build/C/man7/signal.7:610
6314 #: build/C/man7/signal.7:612
6316 msgid "Interruption of system calls and library functions by signal handlers"
6320 #: build/C/man7/signal.7:615
6322 "If a signal handler is invoked while a system call or library function call "
6323 "is blocked, then either:"
6327 #: build/C/man7/signal.7:617
6328 msgid "the call is automatically restarted after the signal handler returns; or"
6332 #: build/C/man7/signal.7:620
6333 msgid "the call fails with the error B<EINTR>."
6337 #: build/C/man7/signal.7:628
6339 "Which of these two behaviors occurs depends on the interface and whether or "
6340 "not the signal handler was established using the B<SA_RESTART> flag (see "
6341 "B<sigaction>(2)). The details vary across UNIX systems; below, the details "
6345 #. The following system calls use ERESTARTSYS,
6346 #. so that they are restartable
6348 #: build/C/man7/signal.7:637
6350 "If a blocked call to one of the following interfaces is interrupted by a "
6351 "signal handler, then the call will be automatically restarted after the "
6352 "signal handler returns if the B<SA_RESTART> flag was used; otherwise the "
6353 "call will fail with the error B<EINTR>:"
6357 #: build/C/man7/signal.7:653
6359 "B<read>(2), B<readv>(2), B<write>(2), B<writev>(2), and B<ioctl>(2) calls "
6360 "on \"slow\" devices. A \"slow\" device is one where the I/O call may block "
6361 "for an indefinite time, for example, a terminal, pipe, or socket. (A disk "
6362 "is not a slow device according to this definition.) If an I/O call on a "
6363 "slow device has already transferred some data by the time it is interrupted "
6364 "by a signal handler, then the call will return a success status (normally, "
6365 "the number of bytes transferred)."
6369 #: build/C/man7/signal.7:657
6370 msgid "B<open>(2), if it can block (e.g., when opening a FIFO; see B<fifo>(7))."
6374 #: build/C/man7/signal.7:664
6375 msgid "B<wait>(2), B<wait3>(2), B<wait4>(2), B<waitid>(2), and B<waitpid>(2)."
6378 #. If a timeout (setsockopt()) is in effect on the socket, then these
6379 #. system calls switch to using EINTR. Consequently, they and are not
6380 #. automatically restarted, and they show the stop/cont behavior
6381 #. described below. (Verified from 2.6.26 source, and by experiment; mtk)
6383 #: build/C/man7/signal.7:680
6385 "Socket interfaces: B<accept>(2), B<connect>(2), B<recv>(2), B<recvfrom>(2), "
6386 "B<recvmsg>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), unless a timeout "
6387 "has been set on the socket (see below)."
6391 #: build/C/man7/signal.7:686
6392 msgid "File locking interfaces: B<flock>(2) and B<fcntl>(2) B<F_SETLKW>."
6396 #: build/C/man7/signal.7:693
6398 "POSIX message queue interfaces: B<mq_receive>(3), B<mq_timedreceive>(3), "
6399 "B<mq_send>(3), and B<mq_timedsend>(3)."
6403 #: build/C/man7/signal.7:698
6405 "B<futex>(2) B<FUTEX_WAIT> (since Linux 2.6.22; beforehand, always failed "
6410 #: build/C/man7/signal.7:705
6412 "POSIX semaphore interfaces: B<sem_wait>(3) and B<sem_timedwait>(3) (since "
6413 "Linux 2.6.22; beforehand, always failed with B<EINTR>)."
6416 #. These are the system calls that give EINTR or ERESTARTNOHAND
6417 #. on interruption by a signal handler.
6419 #: build/C/man7/signal.7:716
6421 "The following interfaces are never restarted after being interrupted by a "
6422 "signal handler, regardless of the use of B<SA_RESTART>; they always fail "
6423 "with the error B<EINTR> when interrupted by a signal handler:"
6427 #: build/C/man7/signal.7:736 build/C/man7/signal.7:810
6429 "Socket interfaces, when a timeout has been set on the socket using "
6430 "B<setsockopt>(2): B<accept>(2), B<recv>(2), B<recvfrom>(2), and "
6431 "B<recvmsg>(2), if a receive timeout (B<SO_RCVTIMEO>) has been set; "
6432 "B<connect>(2), B<send>(2), B<sendto>(2), and B<sendmsg>(2), if a send "
6433 "timeout (B<SO_SNDTIMEO>) has been set."
6437 #: build/C/man7/signal.7:743
6439 "Interfaces used to wait for signals: B<pause>(2), B<sigsuspend>(2), "
6440 "B<sigtimedwait>(2), and B<sigwaitinfo>(2)."
6444 #: build/C/man7/signal.7:752
6446 "File descriptor multiplexing interfaces: B<epoll_wait>(2), "
6447 "B<epoll_pwait>(2), B<poll>(2), B<ppoll>(2), B<select>(2), and B<pselect>(2)."
6450 #. On some other systems, SA_RESTART does restart these system calls
6452 #: build/C/man7/signal.7:760
6454 "System V IPC interfaces: B<msgrcv>(2), B<msgsnd>(2), B<semop>(2), and "
6459 #: build/C/man7/signal.7:766
6460 msgid "Sleep interfaces: B<clock_nanosleep>(2), B<nanosleep>(2), and B<usleep>(3)."
6464 #: build/C/man7/signal.7:771 build/C/man7/signal.7:824
6465 msgid "B<read>(2) from an B<inotify>(7) file descriptor."
6469 #: build/C/man7/signal.7:773
6470 msgid "B<io_getevents>(2)."
6474 #: build/C/man7/signal.7:779
6476 "The B<sleep>(3) function is also never restarted if interrupted by a "
6477 "handler, but gives a success return: the number of seconds remaining to "
6482 #: build/C/man7/signal.7:779
6484 msgid "Interruption of system calls and library functions by stop signals"
6488 #: build/C/man7/signal.7:788
6490 "On Linux, even in the absence of signal handlers, certain blocking "
6491 "interfaces can fail with the error B<EINTR> after the process is stopped by "
6492 "one of the stop signals and then resumed via B<SIGCONT>. This behavior is "
6493 "not sanctioned by POSIX.1, and doesn't occur on other systems."
6497 #: build/C/man7/signal.7:790
6498 msgid "The Linux interfaces that display this behavior are:"
6502 #: build/C/man7/signal.7:813
6503 msgid "B<epoll_wait>(2), B<epoll_pwait>(2)."
6507 #: build/C/man7/signal.7:816
6508 msgid "B<semop>(2), B<semtimedop>(2)."
6512 #: build/C/man7/signal.7:819
6513 msgid "B<sigtimedwait>(2), B<sigwaitinfo>(2)."
6517 #: build/C/man7/signal.7:830
6519 "Linux 2.6.21 and earlier: B<futex>(2) B<FUTEX_WAIT>, B<sem_timedwait>(3), "
6524 #: build/C/man7/signal.7:834
6525 msgid "Linux 2.6.8 and earlier: B<msgrcv>(2), B<msgsnd>(2)."
6529 #: build/C/man7/signal.7:837
6530 msgid "Linux 2.4 and earlier: B<nanosleep>(2)."
6533 #. It must be a *very* long time since this was true:
6538 #. have the same value.
6539 #. The latter is commented out in the kernel source, but
6540 #. the build process of some software still thinks that
6544 #: build/C/man7/signal.7:850
6545 msgid "POSIX.1, except as noted."
6549 #: build/C/man7/signal.7:884
6551 "B<kill>(1), B<getrlimit>(2), B<kill>(2), B<killpg>(2), "
6552 "B<restart_syscall>(2), B<rt_sigqueueinfo>(2), B<setitimer>(2), "
6553 "B<setrlimit>(2), B<sgetmask>(2), B<sigaction>(2), B<sigaltstack>(2), "
6554 "B<signal>(2), B<signalfd>(2), B<sigpending>(2), B<sigprocmask>(2), "
6555 "B<sigsuspend>(2), B<sigwaitinfo>(2), B<abort>(3), B<bsd_signal>(3), "
6556 "B<longjmp>(3), B<raise>(3), B<pthread_sigqueue>(3), B<sigqueue>(3), "
6557 "B<sigset>(3), B<sigsetops>(3), B<sigvec>(3), B<sigwait>(3), B<strsignal>(3), "
6558 "B<sysv_signal>(3), B<core>(5), B<proc>(5), B<pthreads>(7), B<sigevent>(7)"
6562 #: build/C/man2/signalfd.2:20
6568 #: build/C/man2/signalfd.2:20
6574 #: build/C/man2/signalfd.2:23
6575 msgid "signalfd - create a file descriptor for accepting signals"
6579 #: build/C/man2/signalfd.2:25
6580 msgid "B<#include E<lt>sys/signalfd.hE<gt>>"
6584 #: build/C/man2/signalfd.2:27
6585 msgid "B<int signalfd(int >I<fd>B<, const sigset_t *>I<mask>B<, int >I<flags>B<);>"
6589 #: build/C/man2/signalfd.2:38
6591 "B<signalfd>() creates a file descriptor that can be used to accept signals "
6592 "targeted at the caller. This provides an alternative to the use of a signal "
6593 "handler or B<sigwaitinfo>(2), and has the advantage that the file descriptor "
6594 "may be monitored by B<select>(2), B<poll>(2), and B<epoll>(7)."
6598 #: build/C/man2/signalfd.2:58
6600 "The I<mask> argument specifies the set of signals that the caller wishes to "
6601 "accept via the file descriptor. This argument is a signal set whose "
6602 "contents can be initialized using the macros described in B<sigsetops>(3). "
6603 "Normally, the set of signals to be received via the file descriptor should "
6604 "be blocked using B<sigprocmask>(2), to prevent the signals being handled "
6605 "according to their default dispositions. It is not possible to receive "
6606 "B<SIGKILL> or B<SIGSTOP> signals via a signalfd file descriptor; these "
6607 "signals are silently ignored if specified in I<mask>."
6611 #: build/C/man2/signalfd.2:72
6613 "If the I<fd> argument is -1, then the call creates a new file descriptor and "
6614 "associates the signal set specified in I<mask> with that descriptor. If "
6615 "I<fd> is not -1, then it must specify a valid existing signalfd file "
6616 "descriptor, and I<mask> is used to replace the signal set associated with "
6621 #: build/C/man2/signalfd.2:77
6623 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
6624 "I<flags> to change the behaviour of B<signalfd>():"
6628 #: build/C/man2/signalfd.2:77
6630 msgid "B<SFD_NONBLOCK>"
6634 #: build/C/man2/signalfd.2:85
6636 msgid "B<SFD_CLOEXEC>"
6640 #: build/C/man2/signalfd.2:102
6642 "B<signalfd>() returns a file descriptor that supports the following "
6647 #: build/C/man2/signalfd.2:121
6649 "If one or more of the signals specified in I<mask> is pending for the "
6650 "process, then the buffer supplied to B<read>(2) is used to return one or "
6651 "more I<signalfd_siginfo> structures (see below) that describe the signals. "
6652 "The B<read>(2) returns information for as many signals as are pending and "
6653 "will fit in the supplied buffer. The buffer must be at least "
6654 "I<sizeof(struct signalfd_siginfo)> bytes. The return value of the "
6655 "B<read>(2) is the total number of bytes read."
6659 #: build/C/man2/signalfd.2:129
6661 "As a consequence of the B<read>(2), the signals are consumed, so that they "
6662 "are no longer pending for the process (i.e., will not be caught by signal "
6663 "handlers, and cannot be accepted using B<sigwaitinfo>(2))."
6667 #: build/C/man2/signalfd.2:140
6669 "If none of the signals in I<mask> is pending for the process, then the "
6670 "B<read>(2) either blocks until one of the signals in I<mask> is generated "
6671 "for the process, or fails with the error B<EAGAIN> if the file descriptor "
6672 "has been made nonblocking."
6676 #: build/C/man2/signalfd.2:153
6678 "The file descriptor is readable (the B<select>(2) I<readfds> argument; the "
6679 "B<poll>(2) B<POLLIN> flag) if one or more of the signals in I<mask> is "
6680 "pending for the process."
6684 #: build/C/man2/signalfd.2:160
6686 "The signalfd file descriptor also supports the other file-descriptor "
6687 "multiplexing APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
6691 #: build/C/man2/signalfd.2:165
6693 "When the file descriptor is no longer required it should be closed. When "
6694 "all file descriptors associated with the same signalfd object have been "
6695 "closed, the resources for object are freed by the kernel."
6699 #: build/C/man2/signalfd.2:165
6701 msgid "The signalfd_siginfo structure"
6705 #: build/C/man2/signalfd.2:171
6707 "The format of the I<signalfd_siginfo> structure(s) returned by B<read>(2)s "
6708 "from a signalfd file descriptor is as follows:"
6711 #. ssi_trapno is unused on most arches
6712 #. FIXME Since Linux 2.6.37 there is 'uint16_t ssi_addr_lsb'
6713 #. which is not yet documented
6715 #: build/C/man2/signalfd.2:198
6718 "struct signalfd_siginfo {\n"
6719 " uint32_t ssi_signo; /* Signal number */\n"
6720 " int32_t ssi_errno; /* Error number (unused) */\n"
6721 " int32_t ssi_code; /* Signal code */\n"
6722 " uint32_t ssi_pid; /* PID of sender */\n"
6723 " uint32_t ssi_uid; /* Real UID of sender */\n"
6724 " int32_t ssi_fd; /* File descriptor (SIGIO) */\n"
6725 " uint32_t ssi_tid; /* Kernel timer ID (POSIX timers)\n"
6726 " uint32_t ssi_band; /* Band event (SIGIO) */\n"
6727 " uint32_t ssi_overrun; /* POSIX timer overrun count */\n"
6728 " uint32_t ssi_trapno; /* Trap number that caused signal */\n"
6729 " int32_t ssi_status; /* Exit status or signal (SIGCHLD) */\n"
6730 " int32_t ssi_int; /* Integer sent by sigqueue(3) */\n"
6731 " uint64_t ssi_ptr; /* Pointer sent by sigqueue(3) */\n"
6732 " uint64_t ssi_utime; /* User CPU time consumed (SIGCHLD) */\n"
6733 " uint64_t ssi_stime; /* System CPU time consumed (SIGCHLD) */\n"
6734 " uint64_t ssi_addr; /* Address that generated signal\n"
6735 " (for hardware-generated signals) */\n"
6736 " uint8_t pad[I<X>]; /* Pad size to 128 bytes (allow for\n"
6737 " additional fields in the future) */\n"
6742 #: build/C/man2/signalfd.2:221
6744 "Each of the fields in this structure is analogous to the similarly named "
6745 "field in the I<siginfo_t> structure. The I<siginfo_t> structure is "
6746 "described in B<sigaction>(2). Not all fields in the returned "
6747 "I<signalfd_siginfo> structure will be valid for a specific signal; the set "
6748 "of valid fields can be determined from the value returned in the I<ssi_code> "
6749 "field. This field is the analog of the I<siginfo_t> I<si_code> field; see "
6750 "B<sigaction>(2) for details."
6754 #: build/C/man2/signalfd.2:221 build/C/man2/timerfd_create.2:269
6756 msgid "fork(2) semantics"
6760 #: build/C/man2/signalfd.2:229
6762 "After a B<fork>(2), the child inherits a copy of the signalfd file "
6763 "descriptor. A B<read>(2) from the file descriptor in the child will return "
6764 "information about signals queued to the child."
6768 #: build/C/man2/signalfd.2:229 build/C/man2/timerfd_create.2:281
6770 msgid "execve(2) semantics"
6774 #: build/C/man2/signalfd.2:241
6776 "Just like any other file descriptor, a signalfd file descriptor remains open "
6777 "across an B<execve>(2), unless it has been marked for close-on-exec (see "
6778 "B<fcntl>(2)). Any signals that were available for reading before the "
6779 "B<execve>(2) remain available to the newly loaded program. (This is "
6780 "analogous to traditional signal semantics, where a blocked signal that is "
6781 "pending remains pending across an B<execve>(2).)"
6785 #: build/C/man2/signalfd.2:241
6787 msgid "Thread semantics"
6791 #: build/C/man2/signalfd.2:251
6793 "The semantics of signalfd file descriptors in a multithreaded program mirror "
6794 "the standard semantics for signals. In other words, when a thread reads "
6795 "from a signalfd file descriptor, it will read the signals that are directed "
6796 "to the thread itself and the signals that are directed to the process (i.e., "
6797 "the entire thread group). (A thread will not be able to read signals that "
6798 "are directed to other threads in the process.)"
6802 #: build/C/man2/signalfd.2:265
6804 "On success, B<signalfd>() returns a signalfd file descriptor; this is "
6805 "either a new file descriptor (if I<fd> was -1), or I<fd> if I<fd> was a "
6806 "valid signalfd file descriptor. On error, -1 is returned and I<errno> is "
6807 "set to indicate the error."
6811 #: build/C/man2/signalfd.2:266 build/C/man2/timerfd_create.2:338
6817 #: build/C/man2/signalfd.2:271
6818 msgid "The I<fd> file descriptor is not a valid file descriptor."
6823 #. argument is not equal to
6824 #. .IR sizeof(sigset_t) ;
6826 #: build/C/man2/signalfd.2:279
6827 msgid "I<fd> is not a valid signalfd file descriptor."
6831 #: build/C/man2/signalfd.2:286 build/C/man2/timerfd_create.2:320
6832 msgid "I<flags> is invalid; or, in Linux 2.6.26 or earlier, I<flags> is nonzero."
6836 #: build/C/man2/signalfd.2:289 build/C/man2/timerfd_create.2:323
6837 msgid "The per-process limit of open file descriptors has been reached."
6841 #: build/C/man2/signalfd.2:299
6842 msgid "There was insufficient memory to create a new signalfd file descriptor."
6845 #. signalfd() is in glibc 2.7, but reportedly does not build
6847 #: build/C/man2/signalfd.2:307
6849 "B<signalfd>() is available on Linux since kernel 2.6.22. Working support "
6850 "is provided in glibc since version 2.8. The B<signalfd4>() system call "
6851 "(see NOTES) is available on Linux since kernel 2.6.27."
6855 #: build/C/man2/signalfd.2:312
6856 msgid "B<signalfd>() and B<signalfd4>() are Linux-specific."
6860 #: build/C/man2/signalfd.2:322
6862 "The underlying Linux system call requires an additional argument, I<size_t "
6863 "sizemask>, which specifies the size of the I<mask> argument. The glibc "
6864 "B<signalfd>() wrapper function does not include this argument, since it "
6865 "provides the required value for the underlying system call."
6869 #: build/C/man2/signalfd.2:336
6871 "A process can create multiple signalfd file descriptors. This makes it "
6872 "possible to accept different signals on different file descriptors. (This "
6873 "may be useful if monitoring the file descriptors using B<select>(2), "
6874 "B<poll>(2), or B<epoll>(7): the arrival of different signals will make "
6875 "different descriptors ready.) If a signal appears in the I<mask> of more "
6876 "than one of the file descriptors, then occurrences of that signal can be "
6877 "read (once) from any one of the descriptors."
6881 #: build/C/man2/signalfd.2:352
6883 "There are two underlying Linux system calls: B<signalfd>() and the more "
6884 "recent B<signalfd4>(). The former system call does not implement a I<flags> "
6885 "argument. The latter system call implements the I<flags> values described "
6886 "above. Starting with glibc 2.9, the B<signalfd>() wrapper function will "
6887 "use B<signalfd4>() where it is available."
6890 #. The fix also was put into 2.6.24.5
6892 #: build/C/man2/signalfd.2:360
6894 "In kernels before 2.6.25, the I<ssi_ptr> and I<ssi_int> fields are not "
6895 "filled in with the data accompanying a signal sent by B<sigqueue>(3)."
6899 #: build/C/man2/signalfd.2:370
6901 "The program below accepts the signals B<SIGINT> and B<SIGQUIT> via a "
6902 "signalfd file descriptor. The program terminates after accepting a "
6903 "B<SIGQUIT> signal. The following shell session demonstrates the use of the "
6908 #: build/C/man2/signalfd.2:381
6911 "$B< ./signalfd_demo>\n"
6912 "B<^C> # Control-C generates SIGINT\n"
6916 "B<^\\e> # Control-\\e generates SIGQUIT\n"
6922 #: build/C/man2/signalfd.2:391
6925 "#include E<lt>sys/signalfd.hE<gt>\n"
6926 "#include E<lt>signal.hE<gt>\n"
6927 "#include E<lt>unistd.hE<gt>\n"
6928 "#include E<lt>stdlib.hE<gt>\n"
6929 "#include E<lt>stdio.hE<gt>\n"
6933 #: build/C/man2/signalfd.2:402
6937 "main(int argc, char *argv[])\n"
6941 " struct signalfd_siginfo fdsi;\n"
6946 #: build/C/man2/signalfd.2:406
6949 " sigemptyset(&mask);\n"
6950 " sigaddset(&mask, SIGINT);\n"
6951 " sigaddset(&mask, SIGQUIT);\n"
6955 #: build/C/man2/signalfd.2:409
6958 " /* Block signals so that they aren\\(aqt handled\n"
6959 " according to their default dispositions */\n"
6963 #: build/C/man2/signalfd.2:412
6966 " if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1)\n"
6967 " handle_error(\"sigprocmask\");\n"
6971 #: build/C/man2/signalfd.2:416
6974 " sfd = signalfd(-1, &mask, 0);\n"
6976 " handle_error(\"signalfd\");\n"
6980 #: build/C/man2/signalfd.2:421
6984 " s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo));\n"
6985 " if (s != sizeof(struct signalfd_siginfo))\n"
6986 " handle_error(\"read\");\n"
6990 #: build/C/man2/signalfd.2:432
6993 " if (fdsi.ssi_signo == SIGINT) {\n"
6994 " printf(\"Got SIGINT\\en\");\n"
6995 " } else if (fdsi.ssi_signo == SIGQUIT) {\n"
6996 " printf(\"Got SIGQUIT\\en\");\n"
6997 " exit(EXIT_SUCCESS);\n"
6999 " printf(\"Read unexpected signal\\en\");\n"
7006 #: build/C/man2/signalfd.2:446
7008 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<sigaction>(2), "
7009 "B<sigprocmask>(2), B<sigwaitinfo>(2), B<timerfd_create>(2), B<sigsetops>(3), "
7010 "B<sigwait>(3), B<epoll>(7), B<signal>(7)"
7014 #: build/C/man3/sigpause.3:25
7020 #: build/C/man3/sigpause.3:25
7026 #: build/C/man3/sigpause.3:28
7027 msgid "sigpause - atomically release blocked signals and wait for interrupt"
7031 #: build/C/man3/sigpause.3:33
7033 msgid "B<int sigpause(int >I<sigmask>B<); /* BSD */>\n"
7037 #: build/C/man3/sigpause.3:35
7039 msgid "B<int sigpause(int >I<sig>B<); /* System V / UNIX 95 */>\n"
7043 #: build/C/man3/sigpause.3:41
7044 msgid "Don't use this function. Use B<sigsuspend>(2) instead."
7048 #: build/C/man3/sigpause.3:48
7050 "The function B<sigpause>() is designed to wait for some signal. It changes "
7051 "the process's signal mask (set of blocked signals), and then waits for a "
7052 "signal to arrive. Upon arrival of a signal, the original signal mask is "
7057 #: build/C/man3/sigpause.3:56
7059 "If B<sigpause>() returns, it was interrupted by a signal and the return "
7060 "value is -1 with I<errno> set to B<EINTR>."
7064 #: build/C/man3/sigpause.3:60
7065 msgid "The System V version of B<sigpause>() is standardized in POSIX.1-2001."
7068 #. __xpg_sigpause: UNIX 95, spec 1170, SVID, SVr4, XPG
7070 #: build/C/man3/sigpause.3:77
7072 "The classical BSD version of this function appeared in 4.2BSD. It sets the "
7073 "process's signal mask to I<sigmask>. UNIX 95 standardized the incompatible "
7074 "System V version of this function, which removes only the specified signal "
7075 "I<sig> from the process's signal mask. The unfortunate situation with two "
7076 "incompatible functions with the same name was solved by the "
7077 "B<\\%sigsuspend>(2) function, that takes a I<sigset_t\\ *> argument "
7078 "(instead of an I<int>)."
7082 #: build/C/man3/sigpause.3:80
7084 "On Linux, this routine is a system call only on the Sparc (sparc64) "
7089 #: build/C/man3/sigpause.3:82
7090 msgid "Libc4 and libc5 know only about the BSD version."
7094 #. For the BSD version, one usually uses a zero
7096 #. to indicate that no signals are to be blocked.
7098 #: build/C/man3/sigpause.3:98
7100 "Glibc uses the BSD version if the B<_BSD_SOURCE> feature test macro is "
7101 "defined and none of B<_POSIX_SOURCE>, B<_POSIX_C_SOURCE>, B<_XOPEN_SOURCE>, "
7102 "B<_GNU_SOURCE>, or B<_SVID_SOURCE> is defined. Otherwise, the System V "
7107 #: build/C/man3/sigpause.3:106
7109 "B<kill>(2), B<sigaction>(2), B<sigprocmask>(2), B<sigsuspend>(2), "
7110 "B<sigblock>(3), B<sigvec>(3), B<feature_test_macros>(7)"
7114 #: build/C/man2/sigpending.2:29
7120 #: build/C/man2/sigpending.2:32
7121 msgid "sigpending - examine pending signals"
7125 #: build/C/man2/sigpending.2:36
7126 msgid "B<int sigpending(sigset_t *>I<set>B<);>"
7130 #: build/C/man2/sigpending.2:45
7132 "B<sigpending>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7137 #: build/C/man2/sigpending.2:53
7139 "B<sigpending>() returns the set of signals that are pending for delivery to "
7140 "the calling thread (i.e., the signals which have been raised while "
7141 "blocked). The mask of pending signals is returned in I<set>."
7145 #: build/C/man2/sigpending.2:59
7147 "B<sigpending>() returns 0 on success and -1 on error. In the event of an "
7148 "error, I<errno> is set to indicate the cause."
7152 #: build/C/man2/sigpending.2:64
7154 "I<set> points to memory which is not a valid part of the process address "
7159 #: build/C/man2/sigpending.2:75
7161 "The set of signals that is pending for a thread is the union of the set of "
7162 "signals that is pending for that thread and the set of signals that is "
7163 "pending for the process as a whole; see B<signal>(7)."
7167 #: build/C/man2/sigpending.2:87
7169 "In versions of glibc up to and including 2.2.1, there is a bug in the "
7170 "wrapper function for B<sigpending>() which means that information about "
7171 "pending real-time signals is not correctly returned."
7175 #: build/C/man2/sigpending.2:95
7177 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7178 "B<sigsuspend>(2), B<sigsetops>(3), B<signal>(7)"
7182 #: build/C/man2/sigprocmask.2:29
7188 #: build/C/man2/sigprocmask.2:32
7189 msgid "sigprocmask - examine and change blocked signals"
7193 #: build/C/man2/sigprocmask.2:37
7195 "B<int sigprocmask(int >I<how>B<, const sigset_t *>I<set>B<,> B<sigset_t "
7200 #: build/C/man2/sigprocmask.2:46
7202 "B<sigprocmask>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7207 #: build/C/man2/sigprocmask.2:55
7209 "B<sigprocmask>() is used to fetch and/or change the signal mask of the "
7210 "calling thread. The signal mask is the set of signals whose delivery is "
7211 "currently blocked for the caller (see also B<signal>(7) for more details)."
7215 #: build/C/man2/sigprocmask.2:59
7216 msgid "The behavior of the call is dependent on the value of I<how>, as follows."
7220 #: build/C/man2/sigprocmask.2:59
7222 msgid "B<SIG_BLOCK>"
7226 #: build/C/man2/sigprocmask.2:64
7228 "The set of blocked signals is the union of the current set and the I<set> "
7233 #: build/C/man2/sigprocmask.2:64
7235 msgid "B<SIG_UNBLOCK>"
7239 #: build/C/man2/sigprocmask.2:70
7241 "The signals in I<set> are removed from the current set of blocked signals. "
7242 "It is permissible to attempt to unblock a signal which is not blocked."
7246 #: build/C/man2/sigprocmask.2:70
7248 msgid "B<SIG_SETMASK>"
7252 #: build/C/man2/sigprocmask.2:74
7253 msgid "The set of blocked signals is set to the argument I<set>."
7257 #: build/C/man2/sigprocmask.2:79
7259 "If I<oldset> is non-NULL, the previous value of the signal mask is stored in "
7264 #: build/C/man2/sigprocmask.2:88
7266 "If I<set> is NULL, then the signal mask is unchanged (i.e., I<how> is "
7267 "ignored), but the current value of the signal mask is nevertheless returned "
7268 "in I<oldset> (if it is not NULL)."
7272 #: build/C/man2/sigprocmask.2:93
7274 "The use of B<sigprocmask>() is unspecified in a multithreaded process; see "
7275 "B<pthread_sigmask>(3)."
7279 #: build/C/man2/sigprocmask.2:99
7281 "B<sigprocmask>() returns 0 on success and -1 on error. In the event of an "
7282 "error, I<errno> is set to indicate the cause."
7286 #: build/C/man2/sigprocmask.2:107
7288 "the I<set> or I<oldset> argument points outside the process's allocated "
7293 #: build/C/man2/sigprocmask.2:112
7294 msgid "The value specified in I<how> was invalid."
7298 #: build/C/man2/sigprocmask.2:118
7300 "It is not possible to block B<SIGKILL> or B<SIGSTOP>. Attempts to do so are "
7305 #: build/C/man2/sigprocmask.2:120
7306 msgid "Each of the threads in a process has its own signal mask."
7310 #: build/C/man2/sigprocmask.2:140
7312 "If B<SIGBUS>, B<SIGFPE>, B<SIGILL>, or B<SIGSEGV> are generated while they "
7313 "are blocked, the result is undefined, unless the signal was generated by "
7314 "B<kill>(2), B<sigqueue>(3), or B<raise>(3)."
7318 #: build/C/man2/sigprocmask.2:155
7320 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigpending>(2), "
7321 "B<sigsuspend>(2), B<pthread_sigmask>(3), B<sigqueue>(3), B<sigsetops>(3), "
7326 #: build/C/man3/sigqueue.3:28
7332 #: build/C/man3/sigqueue.3:28
7338 #: build/C/man3/sigqueue.3:31
7339 msgid "sigqueue - queue a signal and data to a process"
7343 #: build/C/man3/sigqueue.3:35
7345 "B<int sigqueue(pid_t >I<pid>B<, int >I<sig>B<, const union sigval "
7350 #: build/C/man3/sigqueue.3:43
7351 msgid "B<sigqueue>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
7355 #: build/C/man3/sigqueue.3:55
7357 "B<sigqueue>() sends the signal specified in I<sig> to the process whose PID "
7358 "is given in I<pid>. The permissions required to send a signal are the same "
7359 "as for B<kill>(2). As with B<kill>(2), the null signal (0) can be used to "
7360 "check if a process with a given PID exists."
7364 #: build/C/man3/sigqueue.3:60
7366 "The I<value> argument is used to specify an accompanying item of data "
7367 "(either an integer or a pointer value) to be sent with the signal, and has "
7368 "the following type:"
7372 #: build/C/man3/sigqueue.3:67
7377 " void *sival_ptr;\n"
7382 #: build/C/man3/sigqueue.3:83
7384 "If the receiving process has installed a handler for this signal using the "
7385 "B<SA_SIGINFO> flag to B<sigaction>(2), then it can obtain this data via the "
7386 "I<si_value> field of the I<siginfo_t> structure passed as the second "
7387 "argument to the handler. Furthermore, the I<si_code> field of that "
7388 "structure will be set to B<SI_QUEUE>."
7392 #: build/C/man3/sigqueue.3:91
7394 "On success, B<sigqueue>() returns 0, indicating that the signal was "
7395 "successfully queued to the receiving process. Otherwise -1 is returned and "
7396 "I<errno> is set to indicate the error."
7400 #: build/C/man3/sigqueue.3:102
7401 msgid "I<sig> was invalid."
7405 #: build/C/man3/sigqueue.3:108
7407 "The process does not have permission to send the signal to the receiving "
7408 "process. For the required permissions, see B<kill>(2)."
7412 #: build/C/man3/sigqueue.3:112
7413 msgid "No process has a PID matching I<pid>."
7417 #: build/C/man3/sigqueue.3:114
7418 msgid "This system call first appeared in Linux 2.2."
7422 #: build/C/man3/sigqueue.3:124
7424 "If this function results in the sending of a signal to the process that "
7425 "invoked it, and that signal was not blocked by the calling thread, and no "
7426 "other threads were willing to handle this signal (either by having it "
7427 "unblocked, or by waiting for it using B<sigwait>(3)), then at least some "
7428 "signal must be delivered to this thread before this function returns."
7432 #: build/C/man3/sigqueue.3:139
7434 "On Linux, this function is implemented using the B<rt_sigqueueinfo>(2) "
7435 "system call. The system call differs in its third argument, which is the "
7436 "I<siginfo_t> structure that will be supplied to the receiving process's "
7437 "signal handler or returned by the receiving process's B<sigtimedwait>(2) "
7438 "call. Inside the glibc B<sigqueue>() wrapper, this argument, I<uinfo>, is "
7439 "initialized as follows:"
7443 #: build/C/man3/sigqueue.3:147
7446 "uinfo.si_signo = sig; /* argument supplied to sigqueue() */\n"
7447 "uinfo.si_code = SI_QUEUE;\n"
7448 "uinfo.si_pid = getpid(); /* Process ID of sender */\n"
7449 "uinfo.si_uid = getuid(); /* Real UID of sender */\n"
7450 "uinfo.si_value = val; /* argument supplied to sigqueue() */\n"
7454 #: build/C/man3/sigqueue.3:157
7456 "B<kill>(2), B<rt_sigqueueinfo>(2), B<sigaction>(2), B<signal>(2), "
7457 "B<pthread_sigqueue>(3), B<sigwait>(3), B<signal>(7)"
7461 #: build/C/man2/sigreturn.2:29
7467 #: build/C/man2/sigreturn.2:32
7468 msgid "sigreturn - return from signal handler and cleanup stack frame"
7472 #: build/C/man2/sigreturn.2:34
7473 msgid "B<int sigreturn(unsigned long >I<__unused>B<);>"
7477 #: build/C/man2/sigreturn.2:42
7479 "When the Linux kernel creates the stack frame for a signal handler, a call "
7480 "to B<sigreturn>() is inserted into the stack frame so that upon return from "
7481 "the signal handler, B<sigreturn>() will be called."
7485 #: build/C/man2/sigreturn.2:53
7487 "This B<sigreturn>() call undoes everything that was done\\(emchanging the "
7488 "process's signal mask, switching stacks (see B<sigaltstack>(2))\\(emin order "
7489 "to invoke the signal handler: it restores the process's signal mask, "
7490 "switches stacks, and restores the process's context (registers, processor "
7491 "flags), so that the process directly resumes execution at the point where it "
7492 "was interrupted by the signal."
7496 #: build/C/man2/sigreturn.2:56
7497 msgid "B<sigreturn>() never returns."
7501 #: build/C/man2/sigreturn.2:56
7507 #: build/C/man2/sigreturn.2:58
7508 msgid "/usr/src/linux/arch/i386/kernel/signal.c"
7512 #: build/C/man2/sigreturn.2:60
7513 msgid "/usr/src/linux/arch/alpha/kernel/entry.S"
7517 #: build/C/man2/sigreturn.2:64
7519 "B<sigreturn>() is specific to Linux and should not be used in programs "
7520 "intended to be portable."
7524 #: build/C/man2/sigreturn.2:74
7526 "The B<sigreturn>() call is used by the kernel to implement signal "
7527 "handlers. It should B<never> be called directly. Better yet, the specific "
7528 "use of the I<__unused> argument varies depending on the architecture."
7532 #: build/C/man2/sigreturn.2:80
7534 "B<kill>(2), B<restart_syscall>(2), B<sigaltstack>(2), B<signal>(2), "
7539 #: build/C/man3/sigset.3:26
7545 #: build/C/man3/sigset.3:29
7546 msgid "sigset, sighold, sigrelse, sigignore - System V signal API"
7550 #: build/C/man3/sigset.3:35
7551 msgid "B<sighandler_t sigset(int >I<sig>B<, sighandler_t >I<disp>B<);>"
7555 #: build/C/man3/sigset.3:37
7556 msgid "B<int sighold(int >I<sig>B<);>"
7560 #: build/C/man3/sigset.3:39
7561 msgid "B<int sigrelse(int >I<sig>B<);>"
7565 #: build/C/man3/sigset.3:41
7566 msgid "B<int sigignore(int >I<sig>B<);>"
7570 #: build/C/man3/sigset.3:52
7571 msgid "B<sigset>(), B<sighold>(), B<sigrelse>(), B<sigignore>():"
7575 #: build/C/man3/sigset.3:56
7576 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
7580 #: build/C/man3/sigset.3:65
7582 "These functions are provided in glibc as a compatibility interface for "
7583 "programs that make use of the historical System V signal API. This API is "
7584 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
7585 "B<sigprocmask>(2), etc.)"
7589 #: build/C/man3/sigset.3:74
7591 "The B<sigset>() function modifies the disposition of the signal I<sig>. "
7592 "The I<disp> argument can be the address of a signal handler function, or one "
7593 "of the following constants:"
7597 #: build/C/man3/sigset.3:74
7603 #: build/C/man3/sigset.3:79
7604 msgid "Reset the disposition of I<sig> to the default."
7608 #: build/C/man3/sigset.3:79
7614 #: build/C/man3/sigset.3:83
7615 msgid "Ignore I<sig>."
7619 #: build/C/man3/sigset.3:83
7625 #: build/C/man3/sigset.3:90
7627 "Add I<sig> to the process's signal mask, but leave the disposition of I<sig> "
7632 #: build/C/man3/sigset.3:96
7634 "If I<disp> specifies the address of a signal handler, then I<sig> is added "
7635 "to the process's signal mask during execution of the handler."
7639 #: build/C/man3/sigset.3:104
7641 "If I<disp> was specified as a value other than B<SIG_HOLD>, then I<sig> is "
7642 "removed from the process's signal mask."
7646 #: build/C/man3/sigset.3:110 build/C/man3/sigvec.3:87
7647 msgid "The dispositions for B<SIGKILL> and B<SIGSTOP> cannot be changed."
7651 #: build/C/man3/sigset.3:116
7652 msgid "The B<sighold>() function adds I<sig> to the calling process's signal mask."
7656 #: build/C/man3/sigset.3:122
7658 "The B<sigrelse>() function removes I<sig> from the calling process's signal "
7663 #: build/C/man3/sigset.3:129
7664 msgid "The B<sigignore>() function sets the disposition of I<sig> to B<SIG_IGN>."
7668 #: build/C/man3/sigset.3:145
7670 "On success, B<sigset>() returns B<SIG_HOLD> if I<sig> was blocked before "
7671 "the call, or the signal's previous disposition if it was not blocked before "
7672 "the call. On error, B<sigset>() returns -1, with I<errno> set to indicate "
7673 "the error. (But see BUGS below.)"
7677 #: build/C/man3/sigset.3:154
7679 "The B<sighold>(), B<sigrelse>(), and B<sigignore>() functions return 0 on "
7680 "success; on error, these functions return -1 and set I<errno> to indicate "
7685 #: build/C/man3/sigset.3:161
7687 "For B<sigset>() see the ERRORS under B<sigaction>(2) and "
7688 "B<sigprocmask>(2)."
7692 #: build/C/man3/sigset.3:168
7693 msgid "For B<sighold>() and B<sigrelse>() see the ERRORS under B<sigprocmask>(2)."
7697 #: build/C/man3/sigset.3:173
7698 msgid "For B<sigignore>(), see the errors under B<sigaction>(2)."
7702 #: build/C/man3/sigset.3:190
7704 "SVr4, POSIX.1-2001. These functions are obsolete: do not use them in new "
7705 "programs. POSIX.1-2008 marks B<sighold>(), B<sigignore>(), B<sigpause>(), "
7706 "B<sigrelse>(), and B<sigset>() as obsolete, recommending the use of "
7707 "B<sigaction>(2), B<sigprocmask>(2), B<pthread_sigmask>(3), and "
7708 "B<sigsuspend>(2) instead."
7712 #: build/C/man3/sigset.3:192
7713 msgid "These functions appeared in glibc version 2.1."
7717 #: build/C/man3/sigset.3:198
7719 "The I<sighandler_t> type is a GNU extension; it is used on this page only to "
7720 "make the B<sigset>() prototype more easily readable."
7724 #: build/C/man3/sigset.3:206
7726 "The B<sigset>() function provides reliable signal handling semantics (as "
7727 "when calling B<sigaction>(2) with I<sa_mask> equal to 0)."
7731 #: build/C/man3/sigset.3:224
7733 "On System V, the B<signal>() function provides unreliable semantics (as "
7734 "when calling B<sigaction>(2) with I<sa_mask> equal to I<SA_RESETHAND | "
7735 "SA_NODEFER>). On BSD, B<signal>() provides reliable semantics. "
7736 "POSIX.1-2001 leaves these aspects of B<signal>() unspecified. See "
7737 "B<signal>(2) for further details."
7741 #: build/C/man3/sigset.3:232 build/C/man3/sigvec.3:252
7743 "In order to wait for a signal, BSD and System V both provided a function "
7744 "named B<sigpause>(3), but this function has a different argument on the two "
7745 "systems. See B<sigpause>(3) for details."
7749 #: build/C/man3/sigset.3:241
7751 "In versions of glibc before 2.2, B<sigset>() did not unblock I<sig> if "
7752 "I<disp> was specified as a value other than B<SIG_HOLD>."
7755 #. See http://sourceware.org/bugzilla/show_bug.cgi?id=1951
7757 #: build/C/man3/sigset.3:266
7759 "In versions of glibc before 2.5, B<sigset>() does not correctly return the "
7760 "previous disposition of the signal in two cases. First, if I<disp> is "
7761 "specified as B<SIG_HOLD>, then a successful B<sigset>() always returns "
7762 "B<SIG_HOLD>. Instead, it should return the previous disposition of the "
7763 "signal (unless the signal was blocked, in which case B<SIG_HOLD> should be "
7764 "returned). Second, if the signal is currently blocked, then the return "
7765 "value of a successful B<sigset>() should be B<SIG_HOLD>. Instead, the "
7766 "previous disposition of the signal is returned. These problems have been "
7767 "fixed since glibc 2.5."
7771 #: build/C/man3/sigset.3:276
7773 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
7774 "B<raise>(3), B<sigpause>(3), B<sigvec>(3), B<signal>(7)"
7778 #: build/C/man3/sigsetops.3:31
7784 #: build/C/man3/sigsetops.3:35
7786 "sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX signal "
7791 #: build/C/man3/sigsetops.3:39
7792 msgid "B<int sigemptyset(sigset_t *>I<set>B<);>"
7796 #: build/C/man3/sigsetops.3:41
7797 msgid "B<int sigfillset(sigset_t *>I<set>B<);>"
7801 #: build/C/man3/sigsetops.3:43
7802 msgid "B<int sigaddset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7806 #: build/C/man3/sigsetops.3:45
7807 msgid "B<int sigdelset(sigset_t *>I<set>B<, int >I<signum>B<);>"
7811 #: build/C/man3/sigsetops.3:47
7812 msgid "B<int sigismember(const sigset_t *>I<set>B<, int >I<signum>B<);>"
7816 #: build/C/man3/sigsetops.3:59
7818 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), B<sigdelset>(), "
7823 #: build/C/man3/sigsetops.3:61
7824 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
7828 #: build/C/man3/sigsetops.3:65
7829 msgid "These functions allow the manipulation of POSIX signal sets."
7833 #: build/C/man3/sigsetops.3:70
7835 "B<sigemptyset>() initializes the signal set given by I<set> to empty, with "
7836 "all signals excluded from the set."
7840 #: build/C/man3/sigsetops.3:75
7841 msgid "B<sigfillset>() initializes I<set> to full, including all signals."
7845 #: build/C/man3/sigsetops.3:83
7847 "B<sigaddset>() and B<sigdelset>() add and delete respectively signal "
7848 "I<signum> from I<set>."
7852 #: build/C/man3/sigsetops.3:89
7853 msgid "B<sigismember>() tests whether I<signum> is a member of I<set>."
7857 #: build/C/man3/sigsetops.3:107
7859 "Objects of type I<sigset_t> must be initialized by a call to either "
7860 "B<sigemptyset>() or B<sigfillset>() before being passed to the functions "
7861 "B<sigaddset>(), B<sigdelset>() and B<sigismember>() or the additional "
7862 "glibc functions described below (B<sigisemptyset>(), B<sigandset>(), and "
7863 "B<sigorset>()). The results are undefined if this is not done."
7867 #: build/C/man3/sigsetops.3:114
7869 "B<sigemptyset>(), B<sigfillset>(), B<sigaddset>(), and B<sigdelset>() "
7870 "return 0 on success and -1 on error."
7874 #: build/C/man3/sigsetops.3:126
7876 "B<sigismember>() returns 1 if I<signum> is a member of I<set>, 0 if "
7877 "I<signum> is not a member, and -1 on error. On error, these functions set "
7878 "I<errno> to indicate the cause."
7882 #: build/C/man3/sigsetops.3:131
7883 msgid "I<sig> is not a valid signal."
7887 #: build/C/man3/sigsetops.3:134
7893 #: build/C/man3/sigsetops.3:140
7895 "If the B<_GNU_SOURCE> feature test macro is defined, then "
7896 "I<E<lt>signal.hE<gt>> exposes three other functions for manipulating signal "
7901 #: build/C/man3/sigsetops.3:140
7903 msgid "B<int sigisemptyset(sigset_t *>I<set>B<);>"
7907 #: build/C/man3/sigsetops.3:145
7908 msgid "returns 1 if I<set> contains no signals, and 0 otherwise."
7912 #: build/C/man3/sigsetops.3:145
7915 "B<int sigorset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7920 #: build/C/man3/sigsetops.3:154
7921 msgid "places the union of the sets I<left> and I<right> in I<dest>."
7925 #: build/C/man3/sigsetops.3:154
7928 "B<int sigandset(sigset_t *>I<dest>B<, sigset_t *>I<left>B<, sigset_t "
7933 #: build/C/man3/sigsetops.3:163
7934 msgid "places the intersection of the sets I<left> and I<right> in I<dest>."
7938 #: build/C/man3/sigsetops.3:168
7939 msgid "B<sigorset>() and B<sigandset>() return 0 on success, and -1 on failure."
7943 #: build/C/man3/sigsetops.3:171
7945 "These functions are nonstandard (a few other systems provide similar "
7946 "functions) and their use should be avoided in portable applications."
7950 #: build/C/man3/sigsetops.3:176
7951 msgid "B<sigaction>(2), B<sigpending>(2), B<sigprocmask>(2), B<sigsuspend>(2)"
7955 #: build/C/man2/sigsuspend.2:29
7961 #: build/C/man2/sigsuspend.2:32
7962 msgid "sigsuspend - wait for a signal"
7966 #: build/C/man2/sigsuspend.2:36
7967 msgid "B<int sigsuspend(const sigset_t *>I<mask>B<);>"
7971 #: build/C/man2/sigsuspend.2:45
7973 "B<sigsuspend>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || "
7978 #: build/C/man2/sigsuspend.2:53
7980 "B<sigsuspend>() temporarily replaces the signal mask of the calling process "
7981 "with the mask given by I<mask> and then suspends the process until delivery "
7982 "of a signal whose action is to invoke a signal handler or to terminate a "
7987 #: build/C/man2/sigsuspend.2:62
7989 "If the signal terminates the process, then B<sigsuspend>() does not "
7990 "return. If the signal is caught, then B<sigsuspend>() returns after the "
7991 "signal handler returns, and the signal mask is restored to the state before "
7992 "the call to B<sigsuspend>()."
7996 #: build/C/man2/sigsuspend.2:70
7998 "It is not possible to block B<SIGKILL> or B<SIGSTOP>; specifying these "
7999 "signals in I<mask>, has no effect on the process's signal mask."
8003 #: build/C/man2/sigsuspend.2:76
8005 "B<sigsuspend>() always returns -1, with I<errno> set to inndicate the error "
8006 "(normally, B<EINTR>)."
8010 #: build/C/man2/sigsuspend.2:81
8012 "I<mask> points to memory which is not a valid part of the process address "
8017 #: build/C/man2/sigsuspend.2:84
8018 msgid "The call was interrupted by a signal."
8022 #: build/C/man2/sigsuspend.2:104
8024 "Normally, B<sigsuspend>() is used in conjunction with B<sigprocmask>(2) in "
8025 "order to prevent delivery of a signal during the execution of a critical "
8026 "code section. The caller first blocks the signals with B<sigprocmask>(2). "
8027 "When the critical code has completed, the caller then waits for the signals "
8028 "by calling B<sigsuspend>() with the signal mask that was returned by "
8029 "B<sigprocmask>(2) (in the I<oldset> argument)."
8033 #: build/C/man2/sigsuspend.2:118
8035 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
8036 "B<sigwaitinfo>(2), B<sigsetops>(3), B<sigwait>(3), B<signal>(7)"
8040 #: build/C/man3/sigvec.3:26
8046 #: build/C/man3/sigvec.3:26
8052 #: build/C/man3/sigvec.3:29
8053 msgid "sigvec, sigblock, sigsetmask, siggetmask, sigmask - BSD signal API"
8057 #: build/C/man3/sigvec.3:33
8059 "B<int sigvec(int >I<sig>B<, struct sigvec *>I<vec>B<, struct sigvec "
8064 #: build/C/man3/sigvec.3:35
8065 msgid "B<int sigmask(int >I<signum>B<);>"
8069 #: build/C/man3/sigvec.3:37
8070 msgid "B<int sigblock(int >I<mask>B<);>"
8074 #: build/C/man3/sigvec.3:39
8075 msgid "B<int sigsetmask(int >I<mask>B<);>"
8079 #: build/C/man3/sigvec.3:41
8080 msgid "B<int siggetmask(void);>"
8084 #: build/C/man3/sigvec.3:49
8085 msgid "All functions shown above: _BSD_SOURCE"
8089 #: build/C/man3/sigvec.3:56
8091 "These functions are provided in glibc as a compatibility interface for "
8092 "programs that make use of the historical BSD signal API. This API is "
8093 "obsolete: new applications should use the POSIX signal API (B<sigaction>(2), "
8094 "B<sigprocmask>(2), etc.)."
8098 #: build/C/man3/sigvec.3:81
8100 "The B<sigvec>() function sets and/or gets the disposition of the signal "
8101 "I<sig> (like the POSIX B<sigaction>(2)). If I<vec> is not NULL, it points "
8102 "to a I<sigvec> structure that defines the new disposition for I<sig>. If "
8103 "I<ovec> is not NULL, it points to a I<sigvec> structure that is used to "
8104 "return the previous disposition of I<sig>. To obtain the current "
8105 "disposition of I<sig> without changing it, specify NULL for I<vec>, and a "
8106 "non-NULL pointer for I<ovec>."
8110 #: build/C/man3/sigvec.3:91
8111 msgid "The I<sigvec> structure has the following form:"
8115 #: build/C/man3/sigvec.3:99
8119 " void (*sv_handler)(int); /* Signal disposition */\n"
8120 " int sv_mask; /* Signals to be blocked in handler */\n"
8121 " int sv_flags; /* Flags */\n"
8126 #: build/C/man3/sigvec.3:110
8128 "The I<sv_handler> field specifies the disposition of the signal, and is "
8129 "either: the address of a signal handler function; B<SIG_DFL>, meaning the "
8130 "default disposition applies for the signal; or B<SIG_IGN>, meaning that the "
8131 "signal is ignored."
8135 #: build/C/man3/sigvec.3:124
8137 "If I<sv_handler> specifies the address of a signal handler, then I<sv_mask> "
8138 "specifies a mask of signals that are to be blocked while the handler is "
8139 "executing. In addition, the signal for which the handler is invoked is also "
8140 "blocked. Attempts to block B<SIGKILL> or B<SIGSTOP> are silently ignored."
8144 #: build/C/man3/sigvec.3:131
8146 "If I<sv_handler> specifies the address of a signal handler, then the "
8147 "I<sv_flags> field specifies flags controlling what happens when the handler "
8148 "is called. This field may contain zero or more of the following flags:"
8152 #: build/C/man3/sigvec.3:131
8154 msgid "B<SV_INTERRUPT>"
8158 #: build/C/man3/sigvec.3:139
8160 "If the signal handler interrupts a blocking system call, then upon return "
8161 "from the handler the system call will not be restarted: instead it will fail "
8162 "with the error B<EINTR>. If this flag is not specified, then system calls "
8163 "are restarted by default."
8167 #: build/C/man3/sigvec.3:139
8169 msgid "B<SV_RESETHAND>"
8173 #: build/C/man3/sigvec.3:148
8175 "Reset the disposition of the signal to the default before calling the signal "
8176 "handler. If this flag is not specified, then the handler remains "
8177 "established until explicitly removed by a later call to B<sigvec>() or "
8178 "until the process performs an B<execve>(2)."
8182 #: build/C/man3/sigvec.3:148
8184 msgid "B<SV_ONSTACK>"
8188 #: build/C/man3/sigvec.3:155
8190 "Handle the signal on the alternate signal stack (historically established "
8191 "under BSD using the obsolete B<sigstack>() function; the POSIX replacement "
8192 "is B<sigaltstack>(2))."
8196 #: build/C/man3/sigvec.3:165
8198 "The B<sigmask>() function constructs and returns a \"signal mask\" for "
8199 "I<signum>. For example, we can initialize the I<vec.sv_mask> field given to "
8200 "B<sigvec>() using code such as the following:"
8204 #: build/C/man3/sigvec.3:170
8207 " vec.sv_mask = sigmask(SIGQUIT) | sigpause(SIGABRT);\n"
8208 " /* Block SIGQUIT and SIGABRT during\n"
8209 " handler execution */\n"
8213 #: build/C/man3/sigvec.3:185
8215 "The B<sigblock>() function adds the signals in I<mask> to the process's "
8216 "signal mask (like POSIX I<sigprocmask(SIG_BLOCK)>), and returns the "
8217 "process's previous signal mask. Attempts to block B<SIGKILL> or B<SIGSTOP> "
8218 "are silently ignored."
8222 #: build/C/man3/sigvec.3:193
8224 "The B<sigsetmask>() function sets the process's signal mask to the value "
8225 "given in I<mask> (like POSIX I<sigprocmask(SIG_SETMASK)>), and returns the "
8226 "process's previous signal mask."
8230 #: build/C/man3/sigvec.3:199
8232 "The B<siggetmask>() function returns the process's current signal mask. "
8233 "This call is equivalent to I<sigblock(0)>."
8237 #: build/C/man3/sigvec.3:205
8239 "The B<sigvec>() function returns 0 on success; on error, it returns -1 and "
8240 "sets I<errno> to indicate the error."
8244 #: build/C/man3/sigvec.3:211
8246 "The B<sigblock>() and B<sigsetmask>() functions return the previous signal "
8251 #: build/C/man3/sigvec.3:216
8252 msgid "The B<sigmask>() function returns the signal mask for I<signum>."
8256 #: build/C/man3/sigvec.3:221
8257 msgid "See the ERRORS under B<sigaction>(2) and B<sigprocmask>(2)."
8261 #: build/C/man3/sigvec.3:227
8263 "All of these functions were in 4.3BSD, except B<siggetmask>(), whose origin "
8264 "is unclear. These functions are obsolete: do not use them in new programs."
8268 #: build/C/man3/sigvec.3:244
8270 "On 4.3BSD, the B<signal>() function provided reliable semantics (as when "
8271 "calling B<sigvec>() with I<vec.sv_mask> equal to 0). On System V, "
8272 "B<signal>() provides unreliable semantics. POSIX.1-2001 leaves these "
8273 "aspects of B<signal>() unspecified. See B<signal>(2) for further details."
8277 #: build/C/man3/sigvec.3:262
8279 "B<kill>(2), B<pause>(2), B<sigaction>(2), B<signal>(2), B<sigprocmask>(2), "
8280 "B<raise>(3), B<sigpause>(3), B<sigset>(3), B<signal>(7)"
8284 #: build/C/man3/sigwait.3:26
8290 #: build/C/man3/sigwait.3:26 build/C/man2/sigwaitinfo.2:25
8296 #: build/C/man3/sigwait.3:29
8297 msgid "sigwait - wait for a signal"
8301 #: build/C/man3/sigwait.3:34
8303 msgid "B< int sigwait(const sigset_t *>I<set>B<, int *>I<sig>B<);>\n"
8307 #: build/C/man3/sigwait.3:44
8308 msgid "B<sigwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
8312 #: build/C/man3/sigwait.3:56
8314 "The B<sigwait>() function suspends execution of the calling thread until "
8315 "one of the signals specified in the signal set I<set> becomes pending. The "
8316 "function accepts the signal (removes it from the pending list of signals), "
8317 "and returns the signal number in I<sig>."
8321 #: build/C/man3/sigwait.3:62
8323 "The operation of B<sigwait>() is the same as B<sigwaitinfo>(2), except "
8328 #: build/C/man3/sigwait.3:67
8330 "B<sigwait>() returns only the signal number, rather than a I<siginfo_t> "
8331 "structure describing the signal."
8335 #: build/C/man3/sigwait.3:69
8336 msgid "The return values of the two functions are different."
8340 #: build/C/man3/sigwait.3:74
8342 "On success, B<sigwait>() returns 0. On error, it returns a positive error "
8343 "number (listed in ERRORS)."
8346 #. Does not occur for glibc.
8348 #: build/C/man3/sigwait.3:80
8349 msgid "I<set> contains an invalid signal number."
8353 #: build/C/man3/sigwait.3:86
8354 msgid "B<sigwait>() is implemented using B<sigtimedwait>(2)."
8358 #: build/C/man3/sigwait.3:89
8359 msgid "See B<pthread_sigmask>(3)."
8363 #: build/C/man3/sigwait.3:97
8365 "B<sigaction>(2), B<signalfd>(2), B<sigpending>(2), B<sigsuspend>(2), "
8366 "B<sigwaitinfo>(2), B<sigsetops>(3), B<signal>(7)"
8370 #: build/C/man2/sigwaitinfo.2:25
8376 #: build/C/man2/sigwaitinfo.2:28
8377 msgid "sigwaitinfo, sigtimedwait - synchronously wait for queued signals"
8381 #: build/C/man2/sigwaitinfo.2:33
8383 msgid "B<int sigwaitinfo(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<);>\n"
8387 #: build/C/man2/sigwaitinfo.2:36
8390 "B<int sigtimedwait(const sigset_t *>I<set>B<, siginfo_t *>I<info>B<, >\n"
8391 "B< const struct timespec *>I<timeout>B<);>\n"
8395 #: build/C/man2/sigwaitinfo.2:46
8396 msgid "B<sigwaitinfo>(), B<sigtimedwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8400 #: build/C/man2/sigwaitinfo.2:56
8402 "B<sigwaitinfo>() suspends execution of the calling thread until one of the "
8403 "signals in I<set> is pending (If one of the signals in I<set> is already "
8404 "pending for the calling thread, B<sigwaitinfo>() will return immediately.)"
8408 #: build/C/man2/sigwaitinfo.2:68
8410 "B<sigwaitinfo>() removes the signal from the set of pending signals and "
8411 "returns the signal number as its function result. If the I<info> argument "
8412 "is not NULL, then the buffer that it points to is used to return a structure "
8413 "of type I<siginfo_t> (see B<sigaction>(2)) containing information about the "
8418 #: build/C/man2/sigwaitinfo.2:76
8420 "If multiple signals in I<set> are pending for the caller, the signal that is "
8421 "retrieved by B<sigwaitinfo>() is determined according to the usual ordering "
8422 "rules; see B<signal>(7) for further details."
8426 #: build/C/man2/sigwaitinfo.2:88
8428 "B<sigtimedwait>() operates in exactly the same way as B<sigwaitinfo>() "
8429 "except that it has an additional argument, I<timeout>, which specifies a "
8430 "minimum interval for which the thread is suspended waiting for a signal. "
8431 "(This interval will be rounded up to the system clock granularity, and "
8432 "kernel scheduling delays mean that the interval may overrun by a small "
8433 "amount.) This argument is of the following type:"
8437 #: build/C/man2/sigwaitinfo.2:95
8440 "struct timespec {\n"
8441 " long tv_sec; /* seconds */\n"
8442 " long tv_nsec; /* nanoseconds */\n"
8447 #: build/C/man2/sigwaitinfo.2:105
8449 "If both fields of this structure are specified as 0, a poll is performed: "
8450 "B<sigtimedwait>() returns immediately, either with information about a "
8451 "signal that was pending for the caller, or with an error if none of the "
8452 "signals in I<set> was pending."
8456 #: build/C/man2/sigwaitinfo.2:114
8458 "On success, both B<sigwaitinfo>() and B<sigtimedwait>() return a signal "
8459 "number (i.e., a value greater than zero). On failure both calls return -1, "
8460 "with I<errno> set to indicate the error."
8464 #: build/C/man2/sigwaitinfo.2:123
8466 "No signal in I<set> was became pending within the I<timeout> period "
8467 "specified to B<sigtimedwait>()."
8471 #: build/C/man2/sigwaitinfo.2:129
8473 "The wait was interrupted by a signal handler; see B<signal>(7). (This "
8474 "handler was for a signal other than one of those in I<set>.)"
8478 #: build/C/man2/sigwaitinfo.2:133
8479 msgid "I<timeout> was invalid."
8483 #: build/C/man2/sigwaitinfo.2:153
8485 "In normal usage, the calling program blocks the signals in I<set> via a "
8486 "prior call to B<sigprocmask>(2) (so that the default disposition for these "
8487 "signals does not occur if they become pending between successive calls to "
8488 "B<sigwaitinfo>() or B<sigtimedwait>()) and does not establish handlers for "
8489 "these signals. In a multithreaded program, the signal should be blocked in "
8490 "all threads, in order to prevent the signal being treated according to its "
8491 "default disposition in a thread other than the one calling B<sigwaitinfo>() "
8492 "or B<sigtimedwait>())."
8496 #: build/C/man2/sigwaitinfo.2:158
8498 "The set of signals that is pending for a given thread is the union of the "
8499 "set of signals that is pending specifically for that thread and the set of "
8500 "signals that is pending for the process as a whole (see B<signal>(7))."
8504 #: build/C/man2/sigwaitinfo.2:164
8505 msgid "Attempts to wait for B<SIGKILL> and B<SIGSTOP> are silently ignored."
8509 #: build/C/man2/sigwaitinfo.2:173
8511 "If multiple threads of a process are blocked waiting for the same signal(s) "
8512 "in B<sigwaitinfo>() or B<sigtimedwait>(), then exactly one of the threads "
8513 "will actually receive the signal if it becomes pending for the process as a "
8514 "whole; which of the threads receives the signal is indeterminate."
8518 #: build/C/man2/sigwaitinfo.2:182
8520 "POSIX leaves the meaning of a NULL value for the I<timeout> argument of "
8521 "B<sigtimedwait>() unspecified, permitting the possibility that this has the "
8522 "same meaning as a call to B<sigwaitinfo>(), and indeed this is what is done "
8527 #: build/C/man2/sigwaitinfo.2:187
8529 "On Linux, B<sigwaitinfo>() is a library function implemented on top of "
8530 "B<sigtimedwait>()."
8534 #: build/C/man2/sigwaitinfo.2:199
8536 "B<kill>(2), B<sigaction>(2), B<signal>(2), B<signalfd>(2), B<sigpending>(2), "
8537 "B<sigprocmask>(2), B<sigqueue>(3), B<sigsetops>(3), B<sigwait>(3), "
8538 "B<signal>(7), B<time>(7)"
8542 #: build/C/man3/sysv_signal.3:25
8548 #: build/C/man3/sysv_signal.3:25
8554 #: build/C/man3/sysv_signal.3:28
8555 msgid "sysv_signal - signal handling with System V semantics"
8559 #: build/C/man3/sysv_signal.3:30
8560 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
8564 #: build/C/man3/sysv_signal.3:36
8565 msgid "B<sighandler_t sysv_signal(int >I<signum>B<, sighandler_t >I<handler>B<);>"
8569 #: build/C/man3/sysv_signal.3:41
8571 "The B<sysv_signal>() function takes the same arguments, and performs the "
8572 "same task, as B<signal>(2)."
8576 #: build/C/man3/sysv_signal.3:51
8578 "However B<sysv_signal>() provides the System V unreliable signal semantics, "
8579 "that is: a) the disposition of the signal is reset to the default when the "
8580 "handler is invoked; b) delivery of further instances of the signal is not "
8581 "blocked while the signal handler is executing; and c) if the handler "
8582 "interrupts (certain) blocking system calls, then the system call is not "
8583 "automatically restarted."
8587 #: build/C/man3/sysv_signal.3:57
8589 "The B<sysv_signal>() function returns the previous value of the signal "
8590 "handler, or B<SIG_ERR> on error."
8594 #: build/C/man3/sysv_signal.3:62
8595 msgid "This function is nonstandard."
8599 #: build/C/man3/sysv_signal.3:68
8600 msgid "Use of B<sysv_signal>() should be avoided; use B<sigaction>(2) instead."
8604 #: build/C/man3/sysv_signal.3:79
8606 "On older Linux systems, B<sysv_signal>() and B<signal>(2) were "
8607 "equivalent. But on newer systems, B<signal>(2) provides reliable signal "
8608 "semantics; see B<signal>(2) for details."
8612 #: build/C/man3/sysv_signal.3:92
8613 msgid "B<sigaction>(2), B<signal>(2), B<bsd_signal>(3), B<signal>(7)"
8617 #: build/C/man2/timer_create.2:31
8619 msgid "TIMER_CREATE"
8623 #: build/C/man2/timer_create.2:31
8629 #: build/C/man2/timer_create.2:34
8630 msgid "timer_create - create a POSIX per-process timer"
8634 #: build/C/man2/timer_create.2:38
8637 "B<#include E<lt>signal.hE<gt>>\n"
8638 "B<#include E<lt>time.hE<gt>>\n"
8642 #: build/C/man2/timer_create.2:41
8645 "B<int timer_create(clockid_t >I<clockid>B<, struct sigevent *>I<sevp>B<,>\n"
8646 "B< timer_t *>I<timerid>B<);>\n"
8650 #: 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
8651 msgid "Link with I<-lrt>."
8655 #: build/C/man2/timer_create.2:52
8656 msgid "B<timer_create>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
8660 #: build/C/man2/timer_create.2:60
8662 "B<timer_create>() creates a new per-process interval timer. The ID of the "
8663 "new timer is returned in the buffer pointed to by I<timerid>, which must be "
8664 "a non-NULL pointer. This ID is unique within the process, until the timer "
8665 "is deleted. The new timer is initially disarmed."
8669 #: build/C/man2/timer_create.2:65
8671 "The I<clockid> argument specifies the clock that the new timer uses to "
8672 "measure time. It can be specified as one of the following values:"
8676 #: build/C/man2/timer_create.2:65
8678 msgid "B<CLOCK_REALTIME>"
8682 #: build/C/man2/timer_create.2:68
8683 msgid "A settable system-wide real-time clock."
8687 #: build/C/man2/timer_create.2:68
8689 msgid "B<CLOCK_MONOTONIC>"
8692 #. Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime()
8693 #. in 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009
8695 #: build/C/man2/timer_create.2:75
8697 "A nonsettable monotonically increasing clock that measures time from some "
8698 "unspecified point in the past that does not change after system startup."
8702 #: build/C/man2/timer_create.2:75
8704 msgid "B<CLOCK_PROCESS_CPUTIME_ID> (since Linux 2.6.12)"
8708 #: build/C/man2/timer_create.2:79
8710 "A clock that measures (user and system) CPU time consumed by (all of the "
8711 "threads in) the calling process."
8715 #: build/C/man2/timer_create.2:79
8717 msgid "B<CLOCK_THREAD_CPUTIME_ID> (since Linux 2.6.12)"
8720 #. The CLOCK_MONOTONIC_RAW that was added in 2.6.28 can't be used
8721 #. to create a timer -- mtk, Feb 2009
8723 #: build/C/man2/timer_create.2:85
8725 "A clock that measures (user and system) CPU time consumed by the calling "
8730 #: build/C/man2/timer_create.2:94
8732 "As well as the above values, I<clockid> can be specified as the I<clockid> "
8733 "returned by a call to B<clock_getcpuclockid>(3) or "
8734 "B<pthread_getcpuclockid>(3)."
8738 #: build/C/man2/timer_create.2:103
8740 "The I<sevp> argument points to a I<sigevent> structure that specifies how "
8741 "the caller should be notified when the timer expires. For the definition "
8742 "and general details of this structure, see B<sigevent>(7)."
8746 #: build/C/man2/timer_create.2:107
8747 msgid "The I<sevp.sigev_notify> field can have the following values:"
8751 #: build/C/man2/timer_create.2:112
8753 "Don't asynchronously notify when the timer expires. Progress of the timer "
8754 "can be monitored using B<timer_gettime>(2)."
8758 #: build/C/man2/timer_create.2:130
8760 "Upon timer expiration, generate the signal I<sigev_signo> for the process. "
8761 "See B<sigevent>(7) for general details. The I<si_code> field of the "
8762 "I<siginfo_t> structure will be set to B<SI_TIMER>. At any point in time, at "
8763 "most one signal is queued to the process for a given timer; see "
8764 "B<timer_getoverrun>(2) for more details."
8768 #: build/C/man2/timer_create.2:138
8770 "Upon timer expiration, invoke I<sigev_notify_function> as if it were the "
8771 "start function of a new thread. See B<sigevent>(7) for details."
8775 #: build/C/man2/timer_create.2:152
8777 "As for B<SIGEV_SIGNAL>, but the signal is targeted at the thread whose ID is "
8778 "given in I<sigev_notify_thread_id>, which must be a thread in the same "
8779 "process as the caller. The I<sigev_notify_thread_id> field specifies a "
8780 "kernel thread ID, that is, the value returned by B<clone>(2) or "
8781 "B<gettid>(2). This flag is intended only for use by threading libraries."
8785 #: build/C/man2/timer_create.2:167
8787 "Specifying I<sevp> as NULL is equivalent to specifying a pointer to a "
8788 "I<sigevent> structure in which I<sigev_notify> is B<SIGEV_SIGNAL>, "
8789 "I<sigev_signo> is B<SIGALRM>, and I<sigev_value.sival_int> is the timer ID."
8793 #: build/C/man2/timer_create.2:175
8795 "On success, B<timer_create>() returns 0, and the ID of the new timer is "
8796 "placed in I<*timerid>. On failure, -1 is returned, and I<errno> is set to "
8797 "indicate the error."
8801 #: build/C/man2/timer_create.2:179
8802 msgid "Temporary error during kernel allocation of timer structures."
8806 #: build/C/man2/timer_create.2:187
8808 "Clock ID, I<sigev_notify>, I<sigev_signo>, or I<sigev_notify_thread_id> is "
8812 #. glibc layer: malloc()
8814 #: build/C/man2/timer_create.2:191
8815 msgid "Could not allocate memory."
8819 #: build/C/man2/timer_create.2:193 build/C/man2/timer_delete.2:67 build/C/man2/timer_getoverrun.2:97
8820 msgid "This system call is available since Linux 2.6."
8824 #: build/C/man2/timer_create.2:198
8825 msgid "A program may create multiple interval timers using B<timer_create>()."
8829 #: build/C/man2/timer_create.2:203
8831 "Timers are not inherited by the child of a B<fork>(2), and are disarmed and "
8832 "deleted during an B<execve>(2)."
8836 #: build/C/man2/timer_create.2:211
8838 "The kernel preallocates a \"queued real-time signal\" for each timer created "
8839 "using B<timer_create>(). Consequently, the number of timers is limited by "
8840 "the B<RLIMIT_SIGPENDING> resource limit (see B<setrlimit>(2))."
8844 #: build/C/man2/timer_create.2:216
8846 "The timers created by B<timer_create>() are commonly known as \"POSIX "
8847 "(interval) timers\". The POSIX timers API consists of the following "
8852 #: build/C/man2/timer_create.2:219
8853 msgid "B<timer_create>(): Create a timer."
8857 #: build/C/man2/timer_create.2:222
8858 msgid "B<timer_settime>(2): Arm (start) or disarm (stop) a timer."
8862 #: build/C/man2/timer_create.2:226
8864 "B<timer_gettime>(2): Fetch the time remaining until the next expiration of a "
8865 "timer, along with the interval setting of the timer."
8869 #: build/C/man2/timer_create.2:229
8871 "B<timer_getoverrun>(2): Return the overrun count for the last timer "
8876 #: build/C/man2/timer_create.2:232
8877 msgid "B<timer_delete>(2): Disarm and delete a timer."
8881 #: build/C/man2/timer_create.2:235
8883 "Part of the implementation of the POSIX timers API is provided by glibc. In "
8888 #: build/C/man2/timer_create.2:239
8890 "The functionality for B<SIGEV_THREAD> is implemented within glibc, rather "
8894 #. See the glibc source file kernel-posix-timers.h for the structure
8895 #. that glibc uses to map user-space timer IDs to kernel timer IDs
8896 #. The kernel-level timer ID is exposed via siginfo.si_tid.
8898 #: build/C/man2/timer_create.2:245
8900 "The timer IDs presented at user level are maintained by glibc, which maps "
8901 "these IDs to the timer IDs employed by the kernel."
8905 #: build/C/man2/timer_create.2:253
8907 "The POSIX timers system calls first appeared in Linux 2.6. Prior to this, "
8908 "glibc provided an incomplete user-space implementation (B<CLOCK_REALTIME> "
8909 "timers only) using POSIX threads, and current glibc falls back to this "
8910 "implementation on systems running pre-2.6 Linux kernels."
8914 #: build/C/man2/timer_create.2:265
8916 "The program below takes two arguments: a sleep period in seconds, and a "
8917 "timer frequency in nanoseconds. The program establishes a handler for the "
8918 "signal it uses for the timer, blocks that signal, creates and arms a timer "
8919 "that expires with the given frequency, sleeps for the specified number of "
8920 "seconds, and then unblocks the timer signal. Assuming that the timer "
8921 "expired at least once while the program slept, the signal handler will be "
8922 "invoked, and the handler displays some information about the timer "
8923 "notification. The program terminates after one invocation of the signal "
8928 #: build/C/man2/timer_create.2:270
8930 "In the following example run, the program sleeps for 1 second, after "
8931 "creating a timer that has a frequency of 100 nanoseconds. By the time the "
8932 "signal is unblocked and delivered, there have been around ten million "
8937 #: build/C/man2/timer_create.2:282
8940 "$ B<./a.out 1 100>\n"
8941 "Establishing handler for signal 34\n"
8942 "Blocking signal 34\n"
8943 "timer ID is 0x804c008\n"
8944 "Sleeping for 1 seconds\n"
8945 "Unblocking signal 34\n"
8946 "Caught signal 34\n"
8947 " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
8948 " overrun count = 10004886\n"
8952 #: build/C/man2/timer_create.2:292
8955 "#include E<lt>stdlib.hE<gt>\n"
8956 "#include E<lt>unistd.hE<gt>\n"
8957 "#include E<lt>stdio.hE<gt>\n"
8958 "#include E<lt>signal.hE<gt>\n"
8959 "#include E<lt>time.hE<gt>\n"
8963 #: build/C/man2/timer_create.2:295
8966 "#define CLOCKID CLOCK_REALTIME\n"
8967 "#define SIG SIGRTMIN\n"
8971 #: build/C/man2/timer_create.2:298
8974 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
8979 #: build/C/man2/timer_create.2:304
8983 "print_siginfo(siginfo_t *si)\n"
8990 #: build/C/man2/timer_create.2:306
8992 msgid " tidp = si-E<gt>si_value.sival_ptr;\n"
8996 #: build/C/man2/timer_create.2:309
8999 " printf(\" sival_ptr = %p; \", si-E<gt>si_value.sival_ptr);\n"
9000 " printf(\" *sival_ptr = 0x%lx\\en\", (long) *tidp);\n"
9004 #: build/C/man2/timer_create.2:316
9007 " or = timer_getoverrun(*tidp);\n"
9009 " errExit(\"timer_getoverrun\");\n"
9011 " printf(\" overrun count = %d\\en\", or);\n"
9016 #: build/C/man2/timer_create.2:323
9020 "handler(int sig, siginfo_t *si, void *uc)\n"
9022 " /* Note: calling printf() from a signal handler is not\n"
9023 " strictly correct, since printf() is not async-signal-safe;\n"
9024 " see signal(7) */\n"
9028 #: build/C/man2/timer_create.2:328
9031 " printf(\"Caught signal %d\\en\", sig);\n"
9032 " print_siginfo(si);\n"
9033 " signal(sig, SIG_IGN);\n"
9038 #: build/C/man2/timer_create.2:338
9042 "main(int argc, char *argv[])\n"
9044 " timer_t timerid;\n"
9045 " struct sigevent sev;\n"
9046 " struct itimerspec its;\n"
9047 " long long freq_nanosecs;\n"
9049 " struct sigaction sa;\n"
9053 #: build/C/man2/timer_create.2:344
9056 " if (argc != 3) {\n"
9057 " fprintf(stderr, \"Usage: %s E<lt>sleep-secsE<gt> "
9058 "E<lt>freq-nanosecsE<gt>\\en\",\n"
9060 " exit(EXIT_FAILURE);\n"
9065 #: build/C/man2/timer_create.2:346
9067 msgid " /* Establish handler for timer signal */\n"
9071 #: build/C/man2/timer_create.2:353
9074 " printf(\"Establishing handler for signal %d\\en\", SIG);\n"
9075 " sa.sa_flags = SA_SIGINFO;\n"
9076 " sa.sa_sigaction = handler;\n"
9077 " sigemptyset(&sa.sa_mask);\n"
9078 " if (sigaction(SIG, &sa, NULL) == -1)\n"
9079 " errExit(\"sigaction\");\n"
9083 #: build/C/man2/timer_create.2:355
9085 msgid " /* Block timer signal temporarily */\n"
9089 #: build/C/man2/timer_create.2:361
9092 " printf(\"Blocking signal %d\\en\", SIG);\n"
9093 " sigemptyset(&mask);\n"
9094 " sigaddset(&mask, SIG);\n"
9095 " if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)\n"
9096 " errExit(\"sigprocmask\");\n"
9100 #: build/C/man2/timer_create.2:363
9102 msgid " /* Create the timer */\n"
9106 #: build/C/man2/timer_create.2:369
9109 " sev.sigev_notify = SIGEV_SIGNAL;\n"
9110 " sev.sigev_signo = SIG;\n"
9111 " sev.sigev_value.sival_ptr = &timerid;\n"
9112 " if (timer_create(CLOCKID, &sev, &timerid) == -1)\n"
9113 " errExit(\"timer_create\");\n"
9117 #: build/C/man2/timer_create.2:371
9119 msgid " printf(\"timer ID is 0x%lx\\en\", (long) timerid);\n"
9123 #: build/C/man2/timer_create.2:373
9125 msgid " /* Start the timer */\n"
9129 #: build/C/man2/timer_create.2:379
9132 " freq_nanosecs = atoll(argv[2]);\n"
9133 " its.it_value.tv_sec = freq_nanosecs / 1000000000;\n"
9134 " its.it_value.tv_nsec = freq_nanosecs % 1000000000;\n"
9135 " its.it_interval.tv_sec = its.it_value.tv_sec;\n"
9136 " its.it_interval.tv_nsec = its.it_value.tv_nsec;\n"
9140 #: build/C/man2/timer_create.2:382
9143 " if (timer_settime(timerid, 0, &its, NULL) == -1)\n"
9144 " errExit(\"timer_settime\");\n"
9148 #: build/C/man2/timer_create.2:385
9151 " /* Sleep for a while; meanwhile, the timer may expire\n"
9152 " multiple times */\n"
9156 #: build/C/man2/timer_create.2:388
9159 " printf(\"Sleeping for %d seconds\\en\", atoi(argv[1]));\n"
9160 " sleep(atoi(argv[1]));\n"
9164 #: build/C/man2/timer_create.2:391
9167 " /* Unlock the timer signal, so that timer notification\n"
9168 " can be delivered */\n"
9172 #: build/C/man2/timer_create.2:395
9175 " printf(\"Unblocking signal %d\\en\", SIG);\n"
9176 " if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)\n"
9177 " errExit(\"sigprocmask\");\n"
9181 #: build/C/man2/timer_create.2:398 build/C/man2/timerfd_create.2:540
9184 " exit(EXIT_SUCCESS);\n"
9189 #: build/C/man2/timer_create.2:414
9191 "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
9192 "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
9193 "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
9194 "B<sigevent>(7), B<signal>(7), B<time>(7)"
9198 #: build/C/man2/timer_delete.2:26
9200 msgid "TIMER_DELETE"
9204 #: build/C/man2/timer_delete.2:26 build/C/man2/timer_getoverrun.2:26
9210 #: build/C/man2/timer_delete.2:29
9211 msgid "timer_delete - delete a POSIX per-process timer"
9215 #: build/C/man2/timer_delete.2:32 build/C/man2/timer_getoverrun.2:32 build/C/man2/timer_settime.2:33
9217 msgid "B<#include E<lt>time.hE<gt>>\n"
9221 #: build/C/man2/timer_delete.2:34
9223 msgid "B<int timer_delete(timer_t >I<timerid>B<);>\n"
9227 #: build/C/man2/timer_delete.2:45
9228 msgid "B<timer_delete>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9232 #: build/C/man2/timer_delete.2:53
9234 "B<timer_delete>() deletes the timer whose ID is given in I<timerid>. If "
9235 "the timer was armed at the time of this call, it is disarmed before being "
9236 "deleted. The treatment of any pending signal generated by the deleted timer "
9241 #: build/C/man2/timer_delete.2:60
9243 "On success, B<timer_delete>() returns 0. On failure, -1 is returned, and "
9244 "I<errno> is set to indicate the error."
9248 #: build/C/man2/timer_delete.2:65 build/C/man2/timer_getoverrun.2:95
9249 msgid "I<timerid> is not a valid timer ID."
9253 #: build/C/man2/timer_delete.2:75
9255 "B<clock_gettime>(2), B<timer_create>(2), B<timer_getoverrun>(2), "
9256 "B<timer_settime>(2), B<time>(7)"
9260 #: build/C/man2/timer_getoverrun.2:26
9262 msgid "TIMER_GETOVERRUN"
9266 #: build/C/man2/timer_getoverrun.2:29
9267 msgid "timer_getoverrun - get overrun count for a POSIX per-process timer"
9271 #: build/C/man2/timer_getoverrun.2:34
9273 msgid "B<int timer_getoverrun(timer_t >I<timerid>B<);>\n"
9277 #: build/C/man2/timer_getoverrun.2:45
9278 msgid "B<timer_getoverrun>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9282 #: build/C/man2/timer_getoverrun.2:56
9284 "B<timer_getoverrun>() returns the \"overrun count\" for the timer referred "
9285 "to by I<timerid>. An application can use the overrun count to accurately "
9286 "calculate the number of timer expirations that would have occurred over a "
9287 "given time interval. Timer overruns can occur both when receiving "
9288 "expiration notifications via signals (B<SIGEV_SIGNAL>), and via threads "
9289 "(B<SIGEV_THREAD>)."
9293 #: build/C/man2/timer_getoverrun.2:76
9295 "When expiration notifications are delivered via a signal, overruns can occur "
9296 "as follows. Regardless of whether or not a real-time signal is used for "
9297 "timer notifications, the system queues at most one signal per timer. (This "
9298 "is the behavior specified by POSIX.1-2001. The alternative, queuing one "
9299 "signal for each timer expiration, could easily result in overflowing the "
9300 "allowed limits for queued signals on the system.) Because of system "
9301 "scheduling delays, or because the signal may be temporarily blocked, there "
9302 "can be a delay between the time when the notification signal is generated "
9303 "and the time when it is delivered (e.g., caught by a signal handler) or "
9304 "accepted (e.g., using B<sigwaitinfo>(2)). In this interval, further timer "
9305 "expirations may occur. The timer overrun count is the number of additional "
9306 "timer expirations that occurred between the time when the signal was "
9307 "generated and when it was delivered or accepted."
9311 #: build/C/man2/timer_getoverrun.2:82
9313 "Timer overruns can also occur when expiration notifications are delivered "
9314 "via invocation of a thread, since there may be an arbitrary delay between an "
9315 "expiration of the timer and the invocation of the notification thread, and "
9316 "in that delay interval, additional timer expirations may occur"
9320 #: build/C/man2/timer_getoverrun.2:90
9322 "On success, B<timer_getoverrun>() returns the overrun count of the "
9323 "specified timer; this count may be 0 if no overruns have occurred. On "
9324 "failure, -1 is returned, and I<errno> is set to indicate the error."
9328 #: build/C/man2/timer_getoverrun.2:111
9330 "When timer notifications are delivered via signals (B<SIGEV_SIGNAL>), on "
9331 "Linux it is also possible to obtain the overrun count via the I<si_overrun> "
9332 "field of the I<siginfo_t> structure (see B<sigaction>(2)). This allows an "
9333 "application to avoid the overhead of making a system call to obtain the "
9334 "overrun count, but is a nonportable extension to POSIX.1-2001."
9337 #. FIXME . Austin bug filed, 11 Feb 09
9339 #: build/C/man2/timer_getoverrun.2:115
9341 "POSIX.1-2001 discusses timer overruns only in the context of timer "
9342 "notifications using signals."
9345 #. Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665
9346 #. http://thread.gmane.org/gmane.linux.kernel/113276/
9348 #: build/C/man2/timer_getoverrun.2:128
9350 "POSIX.1-2001 specifies that if the timer overrun count is equal to or "
9351 "greater than an implementation-defined maximum, B<DELAYTIMER_MAX>, then "
9352 "B<timer_getoverrun>() should return B<DELAYTIMER_MAX>. However, Linux does "
9353 "not implement this feature: instead, if the timer overrun value exceeds the "
9354 "maximum representable integer, the counter cycles, starting once more from "
9359 #: build/C/man2/timer_getoverrun.2:131 build/C/man2/timer_settime.2:212
9360 msgid "See B<timer_create>(2)."
9364 #: build/C/man2/timer_getoverrun.2:141
9366 "B<clock_gettime>(2), B<sigaction>(2), B<signalfd>(2), B<sigwaitinfo>(2), "
9367 "B<timer_create>(2), B<timer_delete>(2), B<timer_settime>(2), B<signal>(7), "
9372 #: build/C/man2/timer_settime.2:26
9374 msgid "TIMER_SETTIME"
9378 #: build/C/man2/timer_settime.2:26
9384 #: build/C/man2/timer_settime.2:30
9386 "timer_settime, timer_gettime - arm/disarm and fetch state of POSIX "
9391 #: build/C/man2/timer_settime.2:38
9394 "B<int timer_settime(timer_t >I<timerid>B<, int >I<flags>B<,>\n"
9395 "B< const struct itimerspec *>I<new_value>B<,>\n"
9396 "B< struct itimerspec * >I<old_value>B<);>\n"
9397 "B<int timer_gettime(timer_t >I<timerid>B<, struct itimerspec "
9398 "*>I<curr_value>B<);>\n"
9402 #: build/C/man2/timer_settime.2:50
9403 msgid "B<timer_settime>(), B<timer_gettime>(): _POSIX_C_SOURCE\\ E<gt>=\\ 199309L"
9407 #: build/C/man2/timer_settime.2:63
9409 "B<timer_settime>() arms or disarms the timer identified by I<timerid>. The "
9410 "I<new_value> argument is pointer to an I<itimerspec> structure that "
9411 "specifies the new initial value and the new interval for the timer. The "
9412 "I<itimerspec> structure is defined as follows:"
9416 #: build/C/man2/timer_settime.2:70 build/C/man2/timerfd_create.2:128
9419 "struct timespec {\n"
9420 " time_t tv_sec; /* Seconds */\n"
9421 " long tv_nsec; /* Nanoseconds */\n"
9426 #: build/C/man2/timer_settime.2:75
9429 "struct itimerspec {\n"
9430 " struct timespec it_interval; /* Timer interval */\n"
9431 " struct timespec it_value; /* Initial expiration */\n"
9436 #: build/C/man2/timer_settime.2:87
9438 "Each of the substructures of the I<itimerspec> structure is a I<timespec> "
9439 "structure that allows a time value to be specified in seconds and "
9440 "nanoseconds. These time values are measured according to the clock that was "
9441 "specified when the timer was created by B<timer_create>(2)"
9445 #: build/C/man2/timer_settime.2:101
9447 "If I<new_value-E<gt>it_value> specifies a nonzero value (i.e., either "
9448 "subfield is nonzero), then B<timer_settime>() arms (starts) the timer, "
9449 "setting it to initially expire at the given time. (If the timer was already "
9450 "armed, then the previous settings are overwritten.) If "
9451 "I<new_value-E<gt>it_value> specifies a zero value (i.e., both subfields are "
9452 "zero), then the timer is disarmed."
9456 #: build/C/man2/timer_settime.2:113
9458 "The I<new_value-E<gt>it_interval> field specifies the period of the timer, "
9459 "in seconds and nanoseconds. If this field is nonzero, then each time that "
9460 "an armed timer expires, the timer is reloaded from the value specified in "
9461 "I<new_value-E<gt>it_interval>. If I<new_value-E<gt>it_interval> specifies a "
9462 "zero value then the timer expires just once, at the time specified by "
9466 #. By experiment: the overrun count is set correctly, for CLOCK_REALTIME.
9468 #: build/C/man2/timer_settime.2:134
9470 "By default, the initial expiration time specified in "
9471 "I<new_value-E<gt>it_value> is interpreted relative to the current time on "
9472 "the timer's clock at the time of the call. This can be modified by "
9473 "specifying B<TIMER_ABSTIME> in I<flags>, in which case "
9474 "I<new_value-E<gt>it_value> is interpreted as an absolute value as measured "
9475 "on the timer's clock; that is, the timer will expire when the clock value "
9476 "reaches the value specified by I<new_value-E<gt>it_value>. If the specified "
9477 "absolute time has already passed, then the timer expires immediately, and "
9478 "the overrun count (see B<timer_getoverrun>(2)) will be set correctly."
9481 #. Similar remarks might apply with respect to process and thread CPU time
9482 #. clocks, but these clocks are not currently (2.6.28) settable on Linux.
9484 #: build/C/man2/timer_settime.2:144
9486 "If the value of the B<CLOCK_REALTIME> clock is adjusted while an absolute "
9487 "timer based on that clock is armed, then the expiration of the timer will be "
9488 "appropriately adjusted. Adjustments to the B<CLOCK_REALTIME> clock have no "
9489 "effect on relative timers based on that clock."
9493 #: build/C/man2/timer_settime.2:153
9495 "If I<old_value> is not NULL, then it points to a buffer that is used to "
9496 "return the previous interval of the timer (in I<old_value-E<gt>it_interval>) "
9497 "and the amount of time until the timer would previously have next expired "
9498 "(in I<old_value-E<gt>it_value>)."
9502 #: build/C/man2/timer_settime.2:173
9504 "B<timer_gettime>() returns the time until next expiration, and the "
9505 "interval, for the timer specified by I<timerid>, in the buffer pointed to by "
9506 "I<curr_value>. The time remaining until the next timer expiration is "
9507 "returned in I<curr_value-E<gt>it_value>; this is always a relative value, "
9508 "regardless of whether the B<TIMER_ABSTIME> flag was used when arming the "
9509 "timer. If the value returned in I<curr_value-E<gt>it_value> is zero, then "
9510 "the timer is currently disarmed. The timer interval is returned in "
9511 "I<curr_value-E<gt>it_interval>. If the value returned in "
9512 "I<curr_value-E<gt>it_interval> is zero, then this is a \"one-shot\" timer."
9516 #: build/C/man2/timer_settime.2:182
9518 "On success, B<timer_settime>() and B<timer_gettime>() return 0. On error, "
9519 "-1 is returned, and I<errno> is set to indicate the error."
9523 #: build/C/man2/timer_settime.2:184
9524 msgid "These functions may fail with the following errors:"
9528 #: build/C/man2/timer_settime.2:191
9529 msgid "I<new_value>, I<old_value>, or I<curr_value> is not a valid pointer."
9532 #. FIXME . eventually: invalid value in flags
9534 #: build/C/man2/timer_settime.2:196
9535 msgid "I<timerid> is invalid."
9539 #: build/C/man2/timer_settime.2:199
9540 msgid "B<timer_settime>() may fail with the following errors:"
9544 #: build/C/man2/timer_settime.2:205
9546 "I<new_value.it_value> is negative; or I<new_value.it_value.tv_nsec> is "
9547 "negative or greater than 999,999,999."
9551 #: build/C/man2/timer_settime.2:207
9552 msgid "These system calls are available since Linux 2.6."
9556 #: build/C/man2/timer_settime.2:216
9557 msgid "B<timer_create>(2), B<timer_getoverrun>(2), B<time>(7)"
9561 #: build/C/man2/timerfd_create.2:21
9563 msgid "TIMERFD_CREATE"
9567 #: build/C/man2/timerfd_create.2:21
9573 #: build/C/man2/timerfd_create.2:25
9575 "timerfd_create, timerfd_settime, timerfd_gettime - timers that notify via "
9580 #: build/C/man2/timerfd_create.2:28
9582 msgid "B<#include E<lt>sys/timerfd.hE<gt>>\n"
9586 #: build/C/man2/timerfd_create.2:30
9588 msgid "B<int timerfd_create(int >I<clockid>B<, int >I<flags>B<);>\n"
9592 #: build/C/man2/timerfd_create.2:34
9595 "B<int timerfd_settime(int >I<fd>B<, int >I<flags>B<,>\n"
9596 "B< const struct itimerspec *>I<new_value>B<,>\n"
9597 "B< struct itimerspec *>I<old_value>B<);>\n"
9601 #: build/C/man2/timerfd_create.2:36
9603 msgid "B<int timerfd_gettime(int >I<fd>B<, struct itimerspec *>I<curr_value>B<);>\n"
9607 #: build/C/man2/timerfd_create.2:49
9609 "These system calls create and operate on a timer that delivers timer "
9610 "expiration notifications via a file descriptor. They provide an alternative "
9611 "to the use of B<setitimer>(2) or B<timer_create>(2), with the advantage "
9612 "that the file descriptor may be monitored by B<select>(2), B<poll>(2), and "
9617 #: build/C/man2/timerfd_create.2:61
9619 "The use of these three system calls is analogous to the use of "
9620 "B<timer_create>(2), B<timer_settime>(2), and B<timer_gettime>(2). (There is "
9621 "no analog of B<timer_getoverrun>(2), since that functionality is provided by "
9622 "B<read>(2), as described below.)"
9626 #: build/C/man2/timerfd_create.2:61
9628 msgid "timerfd_create()"
9632 #: build/C/man2/timerfd_create.2:80
9634 "B<timerfd_create>() creates a new timer object, and returns a file "
9635 "descriptor that refers to that timer. The I<clockid> argument specifies the "
9636 "clock that is used to mark the progress of the timer, and must be either "
9637 "B<CLOCK_REALTIME> or B<CLOCK_MONOTONIC>. B<CLOCK_REALTIME> is a settable "
9638 "system-wide clock. B<CLOCK_MONOTONIC> is a nonsettable clock that is not "
9639 "affected by discontinuous changes in the system clock (e.g., manual changes "
9640 "to system time). The current value of each of these clocks can be retrieved "
9641 "using B<clock_gettime>(2)."
9645 #: build/C/man2/timerfd_create.2:85
9647 "Starting with Linux 2.6.27, the following values may be bitwise ORed in "
9648 "I<flags> to change the behavior of B<timerfd_create>():"
9652 #: build/C/man2/timerfd_create.2:85
9654 msgid "B<TFD_NONBLOCK>"
9658 #: build/C/man2/timerfd_create.2:93
9660 msgid "B<TFD_CLOEXEC>"
9664 #: build/C/man2/timerfd_create.2:107
9666 "In Linux versions up to and including 2.6.26, I<flags> must be specified as "
9671 #: build/C/man2/timerfd_create.2:107
9673 msgid "timerfd_settime()"
9677 #: build/C/man2/timerfd_create.2:112
9679 "B<timerfd_settime>() arms (starts) or disarms (stops) the timer referred "
9680 "to by the file descriptor I<fd>."
9684 #: build/C/man2/timerfd_create.2:121
9686 "The I<new_value> argument specifies the initial expiration and interval for "
9687 "the timer. The I<itimer> structure used for this argument contains two "
9688 "fields, each of which is in turn a structure of type I<timespec>:"
9692 #: build/C/man2/timerfd_create.2:133
9695 "struct itimerspec {\n"
9696 " struct timespec it_interval; /* Interval for periodic timer */\n"
9697 " struct timespec it_value; /* Initial expiration */\n"
9702 #: build/C/man2/timerfd_create.2:145
9704 "I<new_value.it_value> specifies the initial expiration of the timer, in "
9705 "seconds and nanoseconds. Setting either field of I<new_value.it_value> to a "
9706 "nonzero value arms the timer. Setting both fields of I<new_value.it_value> "
9707 "to zero disarms the timer."
9711 #: build/C/man2/timerfd_create.2:154
9713 "Setting one or both fields of I<new_value.it_interval> to nonzero values "
9714 "specifies the period, in seconds and nanoseconds, for repeated timer "
9715 "expirations after the initial expiration. If both fields of "
9716 "I<new_value.it_interval> are zero, the timer expires just once, at the time "
9717 "specified by I<new_value.it_value>."
9721 #: build/C/man2/timerfd_create.2:170
9723 "The I<flags> argument is either 0, to start a relative timer "
9724 "(I<new_value.it_value> specifies a time relative to the current value of the "
9725 "clock specified by I<clockid>), or B<TFD_TIMER_ABSTIME>, to start an "
9726 "absolute timer (I<new_value.it_value> specifies an absolute time for the "
9727 "clock specified by I<clockid>; that is, the timer will expire when the value "
9728 "of that clock reaches the value specified in I<new_value.it_value>)."
9732 #: build/C/man2/timerfd_create.2:181
9734 "If the I<old_value> argument is not NULL, then the I<itimerspec> structure "
9735 "that it points to is used to return the setting of the timer that was "
9736 "current at the time of the call; see the description of B<timerfd_gettime>() "
9741 #: build/C/man2/timerfd_create.2:181
9743 msgid "timerfd_gettime()"
9747 #: build/C/man2/timerfd_create.2:190
9749 "B<timerfd_gettime>() returns, in I<curr_value>, an I<itimerspec> structure "
9750 "that contains the current setting of the timer referred to by the file "
9755 #: build/C/man2/timerfd_create.2:200
9757 "The I<it_value> field returns the amount of time until the timer will next "
9758 "expire. If both fields of this structure are zero, then the timer is "
9759 "currently disarmed. This field always contains a relative value, regardless "
9760 "of whether the B<TFD_TIMER_ABSTIME> flag was specified when setting the "
9765 #: build/C/man2/timerfd_create.2:207
9767 "The I<it_interval> field returns the interval of the timer. If both fields "
9768 "of this structure are zero, then the timer is set to expire just once, at "
9769 "the time specified by I<curr_value.it_value>."
9773 #: build/C/man2/timerfd_create.2:207
9775 msgid "Operating on a timer file descriptor"
9779 #: build/C/man2/timerfd_create.2:211
9781 "The file descriptor returned by B<timerfd_create>() supports the following "
9786 #: build/C/man2/timerfd_create.2:225
9788 "If the timer has already expired one or more times since its settings were "
9789 "last modified using B<timerfd_settime>(), or since the last successful "
9790 "B<read>(2), then the buffer given to B<read>(2) returns an unsigned 8-byte "
9791 "integer (I<uint64_t>) containing the number of expirations that have "
9792 "occurred. (The returned value is in host byte order, i.e., the native byte "
9793 "order for integers on the host machine.)"
9797 #: build/C/man2/timerfd_create.2:238
9799 "If no timer expirations have occurred at the time of the B<read>(2), then "
9800 "the call either blocks until the next timer expiration, or fails with the "
9801 "error B<EAGAIN> if the file descriptor has been made nonblocking (via the "
9802 "use of the B<fcntl>(2) B<F_SETFL> operation to set the B<O_NONBLOCK> flag)."
9806 #: build/C/man2/timerfd_create.2:244
9808 "A B<read>(2) will fail with the error B<EINVAL> if the size of the supplied "
9809 "buffer is less than 8 bytes."
9813 #: build/C/man2/timerfd_create.2:255
9815 "The file descriptor is readable (the B<select>(2) I<readfds> argument; the "
9816 "B<poll>(2) B<POLLIN> flag) if one or more timer expirations have occurred."
9820 #: build/C/man2/timerfd_create.2:262
9822 "The file descriptor also supports the other file-descriptor multiplexing "
9823 "APIs: B<pselect>(2), B<ppoll>(2), and B<epoll>(7)."
9827 #: build/C/man2/timerfd_create.2:269
9829 "When the file descriptor is no longer required it should be closed. When "
9830 "all file descriptors associated with the same timer object have been closed, "
9831 "the timer is disarmed and its resources are freed by the kernel."
9835 #: build/C/man2/timerfd_create.2:281
9837 "After a B<fork>(2), the child inherits a copy of the file descriptor created "
9838 "by B<timerfd_create>(). The file descriptor refers to the same underlying "
9839 "timer object as the corresponding file descriptor in the parent, and "
9840 "B<read>(2)s in the child will return information about expirations of the "
9845 #: build/C/man2/timerfd_create.2:287
9847 "A file descriptor created by B<timerfd_create>() is preserved across "
9848 "B<execve>(2), and continues to generate timer expirations if the timer was "
9853 #: build/C/man2/timerfd_create.2:294
9855 "On success, B<timerfd_create>() returns a new file descriptor. On error, "
9856 "-1 is returned and I<errno> is set to indicate the error."
9860 #: build/C/man2/timerfd_create.2:302
9862 "B<timerfd_settime>() and B<timerfd_gettime>() return 0 on success; on "
9863 "error they return -1, and set I<errno> to indicate the error."
9867 #: build/C/man2/timerfd_create.2:305
9868 msgid "B<timerfd_create>() can fail with the following errors:"
9872 #: build/C/man2/timerfd_create.2:313
9873 msgid "The I<clockid> argument is neither B<CLOCK_MONOTONIC> nor B<CLOCK_REALTIME>;"
9877 #: build/C/man2/timerfd_create.2:333
9878 msgid "There was insufficient kernel memory to create the timer."
9882 #: build/C/man2/timerfd_create.2:338
9884 "B<timerfd_settime>() and B<timerfd_gettime>() can fail with the following "
9889 #: build/C/man2/timerfd_create.2:342
9890 msgid "I<fd> is not a valid file descriptor."
9894 #: build/C/man2/timerfd_create.2:353
9895 msgid "I<fd> is not a valid timerfd file descriptor."
9899 #: build/C/man2/timerfd_create.2:356
9900 msgid "B<timerfd_settime>() can also fail with the following errors:"
9904 #: build/C/man2/timerfd_create.2:362
9906 "I<new_value> is not properly initialized (one of the I<tv_nsec> falls "
9907 "outside the range zero to 999,999,999)."
9910 #. This case only checked since 2.6.29, and 2.2.2[78].some-stable-version.
9911 #. In older kernel versions, no check was made for invalid flags.
9913 #: build/C/man2/timerfd_create.2:368
9914 msgid "I<flags> is invalid."
9918 #: build/C/man2/timerfd_create.2:371
9920 "These system calls are available on Linux since kernel 2.6.25. Library "
9921 "support is provided by glibc since version 2.8."
9926 #: build/C/man2/timerfd_create.2:379
9928 "Currently, B<timerfd_create>() supports fewer types of clock IDs than "
9929 "B<timer_create>(2)."
9933 #: build/C/man2/timerfd_create.2:388
9935 "The following program creates a timer and then monitors its progress. The "
9936 "program accepts up to three command-line arguments. The first argument "
9937 "specifies the number of seconds for the initial expiration of the timer. "
9938 "The second argument specifies the interval for the timer, in seconds. The "
9939 "third argument specifies the number of times the program should allow the "
9940 "timer to expire before terminating. The second and third command-line "
9941 "arguments are optional."
9945 #: build/C/man2/timerfd_create.2:390 build/C/man2/wait.2:555
9946 msgid "The following shell session demonstrates the use of the program:"
9950 #: build/C/man2/timerfd_create.2:405
9953 "$B< a.out 3 1 100>\n"
9954 "0.000: timer started\n"
9955 "3.000: read: 1; total=1\n"
9956 "4.000: read: 1; total=2\n"
9957 "B<^Z > # type control-Z to suspend the program\n"
9958 "[1]+ Stopped ./timerfd3_demo 3 1 100\n"
9959 "$ B<fg> # Resume execution after a few seconds\n"
9961 "9.660: read: 5; total=7\n"
9962 "10.000: read: 1; total=8\n"
9963 "11.000: read: 1; total=9\n"
9964 "B<^C > # type control-C to suspend the program\n"
9967 #. The commented out code here is what we currently need until
9968 #. the required stuff is in glibc
9971 #. /* Link with -lrt */
9972 #. #define _GNU_SOURCE
9973 #. #include <sys/syscall.h>
9974 #. #include <unistd.h>
9975 #. #include <time.h>
9976 #. #if defined(__i386__)
9977 #. #define __NR_timerfd_create 322
9978 #. #define __NR_timerfd_settime 325
9979 #. #define __NR_timerfd_gettime 326
9983 #. timerfd_create(int clockid, int flags)
9985 #. return syscall(__NR_timerfd_create, clockid, flags);
9989 #. timerfd_settime(int fd, int flags, struct itimerspec *new_value,
9990 #. struct itimerspec *curr_value)
9992 #. return syscall(__NR_timerfd_settime, fd, flags, new_value,
9997 #. timerfd_gettime(int fd, struct itimerspec *curr_value)
9999 #. return syscall(__NR_timerfd_gettime, fd, curr_value);
10002 #. #define TFD_TIMER_ABSTIME (1 << 0)
10004 #. ////////////////////////////////////////////////////////////
10005 #. type: Plain text
10006 #: build/C/man2/timerfd_create.2:454
10009 "#include E<lt>sys/timerfd.hE<gt>\n"
10010 "#include E<lt>time.hE<gt>\n"
10011 "#include E<lt>unistd.hE<gt>\n"
10012 "#include E<lt>stdlib.hE<gt>\n"
10013 "#include E<lt>stdio.hE<gt>\n"
10014 "#include E<lt>stdint.hE<gt> /* Definition of uint64_t */\n"
10017 #. type: Plain text
10018 #: build/C/man2/timerfd_create.2:457
10021 "#define handle_error(msg) \\e\n"
10022 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
10025 #. type: Plain text
10026 #: build/C/man2/timerfd_create.2:465
10030 "print_elapsed_time(void)\n"
10032 " static struct timespec start;\n"
10033 " struct timespec curr;\n"
10034 " static int first_call = 1;\n"
10035 " int secs, nsecs;\n"
10038 #. type: Plain text
10039 #: build/C/man2/timerfd_create.2:471
10042 " if (first_call) {\n"
10043 " first_call = 0;\n"
10044 " if (clock_gettime(CLOCK_MONOTONIC, &start) == -1)\n"
10045 " handle_error(\"clock_gettime\");\n"
10049 #. type: Plain text
10050 #: build/C/man2/timerfd_create.2:474
10053 " if (clock_gettime(CLOCK_MONOTONIC, &curr) == -1)\n"
10054 " handle_error(\"clock_gettime\");\n"
10057 #. type: Plain text
10058 #: build/C/man2/timerfd_create.2:483
10061 " secs = curr.tv_sec - start.tv_sec;\n"
10062 " nsecs = curr.tv_nsec - start.tv_nsec;\n"
10063 " if (nsecs E<lt> 0) {\n"
10065 " nsecs += 1000000000;\n"
10067 " printf(\"%d.%03d: \", secs, (nsecs + 500000) / 1000000);\n"
10071 #. type: Plain text
10072 #: build/C/man2/timerfd_create.2:492
10076 "main(int argc, char *argv[])\n"
10078 " struct itimerspec new_value;\n"
10079 " int max_exp, fd;\n"
10080 " struct timespec now;\n"
10081 " uint64_t exp, tot_exp;\n"
10085 #. type: Plain text
10086 #: build/C/man2/timerfd_create.2:498
10089 " if ((argc != 2) && (argc != 4)) {\n"
10090 " fprintf(stderr, \"%s init-secs [interval-secs max-exp]\\en\",\n"
10092 " exit(EXIT_FAILURE);\n"
10096 #. type: Plain text
10097 #: build/C/man2/timerfd_create.2:501
10100 " if (clock_gettime(CLOCK_REALTIME, &now) == -1)\n"
10101 " handle_error(\"clock_gettime\");\n"
10104 #. type: Plain text
10105 #: build/C/man2/timerfd_create.2:504
10108 " /* Create a CLOCK_REALTIME absolute timer with initial\n"
10109 " expiration and interval as specified in command line */\n"
10112 #. type: Plain text
10113 #: build/C/man2/timerfd_create.2:515
10116 " new_value.it_value.tv_sec = now.tv_sec + atoi(argv[1]);\n"
10117 " new_value.it_value.tv_nsec = now.tv_nsec;\n"
10118 " if (argc == 2) {\n"
10119 " new_value.it_interval.tv_sec = 0;\n"
10122 " new_value.it_interval.tv_sec = atoi(argv[2]);\n"
10123 " max_exp = atoi(argv[3]);\n"
10125 " new_value.it_interval.tv_nsec = 0;\n"
10128 #. type: Plain text
10129 #: build/C/man2/timerfd_create.2:519
10132 " fd = timerfd_create(CLOCK_REALTIME, 0);\n"
10134 " handle_error(\"timerfd_create\");\n"
10137 #. type: Plain text
10138 #: build/C/man2/timerfd_create.2:522
10141 " if (timerfd_settime(fd, TFD_TIMER_ABSTIME, &new_value, NULL) == -1)\n"
10142 " handle_error(\"timerfd_settime\");\n"
10145 #. type: Plain text
10146 #: build/C/man2/timerfd_create.2:525
10149 " print_elapsed_time();\n"
10150 " printf(\"timer started\\en\");\n"
10153 #. type: Plain text
10154 #: build/C/man2/timerfd_create.2:530
10157 " for (tot_exp = 0; tot_exp E<lt> max_exp;) {\n"
10158 " s = read(fd, &exp, sizeof(uint64_t));\n"
10159 " if (s != sizeof(uint64_t))\n"
10160 " handle_error(\"read\");\n"
10163 #. type: Plain text
10164 #: build/C/man2/timerfd_create.2:537
10167 " tot_exp += exp;\n"
10168 " print_elapsed_time();\n"
10169 " printf(\"read: %llu; total=%llu\\en\",\n"
10170 " (unsigned long long) exp,\n"
10171 " (unsigned long long) tot_exp);\n"
10175 #. type: Plain text
10176 #: build/C/man2/timerfd_create.2:553
10178 "B<eventfd>(2), B<poll>(2), B<read>(2), B<select>(2), B<setitimer>(2), "
10179 "B<signalfd>(2), B<timer_create>(2), B<timer_gettime>(2), "
10180 "B<timer_settime>(2), B<epoll>(7), B<time>(7)"
10184 #: build/C/man2/tkill.2:29
10189 #. type: Plain text
10190 #: build/C/man2/tkill.2:32
10191 msgid "tkill, tgkill - send a signal to a thread"
10194 #. type: Plain text
10195 #: build/C/man2/tkill.2:35
10197 msgid "B<int tkill(int >I<tid>B<, int >I<sig>B<);>\n"
10200 #. type: Plain text
10201 #: build/C/man2/tkill.2:37
10203 msgid "B<int tgkill(int >I<tgid>B<, int >I<tid>B<, int >I<sig>B<);>\n"
10206 #. type: Plain text
10207 #: build/C/man2/tkill.2:54
10209 "B<tgkill>() sends the signal I<sig> to the thread with the thread ID I<tid> "
10210 "in the thread group I<tgid>. (By contrast, B<kill>(2) can be used to send "
10211 "a signal only to a process (i.e., thread group) as a whole, and the signal "
10212 "will be delivered to an arbitrary thread within that process.)"
10215 #. FIXME: Maybe say something about the following:
10216 #. http://sourceware.org/bugzilla/show_bug.cgi?id=12889
10217 #. Rich Felker <bugdal@aerifal.cx>
10218 #. There is a race condition in pthread_kill: it is possible that,
10219 #. between the time pthread_kill reads the pid/tid from the target
10220 #. thread descriptor and the time it makes the tgkill syscall,
10221 #. the target thread terminates and the same tid gets assigned
10222 #. to a new thread in the same process.
10224 #. (The tgkill syscall was designed to eliminate a similar race
10225 #. condition in tkill, but it only succeeded in eliminating races
10226 #. where the tid gets reused in a different process, and does not
10227 #. help if the same tid gets assigned to a new thread in the
10230 #. The only solution I can see is to introduce a mutex that ensures
10231 #. that a thread cannot exit while pthread_kill is being called on it.
10233 #. Note that in most real-world situations, like almost all race
10234 #. conditions, this one will be extremely rare. To make it
10235 #. measurable, one could exhaust all but 1-2 available pid values,
10236 #. possibly by lowering the max pid parameter in /proc, forcing
10237 #. the same tid to be reused rapidly.
10238 #. type: Plain text
10239 #: build/C/man2/tkill.2:85
10241 "B<tkill>() is an obsolete predecessor to B<tgkill>(). It allows only the "
10242 "target thread ID to be specified, which may result in the wrong thread being "
10243 "signaled if a thread terminates and its thread ID is recycled. Avoid using "
10244 "this system call."
10247 #. type: Plain text
10248 #: build/C/man2/tkill.2:92
10249 msgid "If I<tgid> is specified as -1, B<tgkill>() is equivalent to B<tkill>()."
10252 #. type: Plain text
10253 #: build/C/man2/tkill.2:95
10255 "These are the raw system call interfaces, meant for internal thread library "
10259 #. type: Plain text
10260 #: build/C/man2/tkill.2:103
10261 msgid "An invalid thread ID, thread group ID, or signal was specified."
10264 #. type: Plain text
10265 #: build/C/man2/tkill.2:108
10266 msgid "Permission denied. For the required permissions, see B<kill>(2)."
10269 #. type: Plain text
10270 #: build/C/man2/tkill.2:111
10271 msgid "No process with the specified thread ID (and thread group ID) exists."
10274 #. type: Plain text
10275 #: build/C/man2/tkill.2:116
10277 "B<tkill>() is supported since Linux 2.4.19 / 2.5.4. B<tgkill>() was added "
10281 #. type: Plain text
10282 #: build/C/man2/tkill.2:122
10284 "B<tkill>() and B<tgkill>() are Linux-specific and should not be used in "
10285 "programs that are intended to be portable."
10288 #. type: Plain text
10289 #: build/C/man2/tkill.2:128
10291 "See the description of B<CLONE_THREAD> in B<clone>(2) for an explanation of "
10295 #. type: Plain text
10296 #: build/C/man2/tkill.2:131
10298 "Glibc does not provide wrappers for these system calls; call them using "
10302 #. type: Plain text
10303 #: build/C/man2/tkill.2:136
10304 msgid "B<clone>(2), B<gettid>(2), B<kill>(2), B<rt_sigqueueinfo>(2)"
10308 #: build/C/man2/wait.2:49
10314 #: build/C/man2/wait.2:49
10319 #. type: Plain text
10320 #: build/C/man2/wait.2:52
10321 msgid "wait, waitpid, waitid - wait for process to change state"
10324 #. type: Plain text
10325 #: build/C/man2/wait.2:54
10326 msgid "B<#include E<lt>sys/types.hE<gt>>"
10329 #. type: Plain text
10330 #: build/C/man2/wait.2:56
10331 msgid "B<#include E<lt>sys/wait.hE<gt>>"
10334 #. type: Plain text
10335 #: build/C/man2/wait.2:58
10336 msgid "B<pid_t wait(int *>I<status>B<);>"
10339 #. type: Plain text
10340 #: build/C/man2/wait.2:60
10341 msgid "B<pid_t waitpid(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<);>"
10344 #. type: Plain text
10345 #: build/C/man2/wait.2:63
10347 "B<int waitid(idtype_t >I<idtype>B<, id_t >I<id>B<, siginfo_t *>I<infop>B<, "
10348 "int >I<options>B<);>"
10351 #. type: Plain text
10352 #: build/C/man2/wait.2:72
10353 msgid "B<waitid>():"
10356 #. type: Plain text
10357 #: build/C/man2/wait.2:76
10359 "_SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
10360 "_XOPEN_SOURCE_EXTENDED"
10363 #. type: Plain text
10364 #: build/C/man2/wait.2:91
10366 "All of these system calls are used to wait for state changes in a child of "
10367 "the calling process, and obtain information about the child whose state has "
10368 "changed. A state change is considered to be: the child terminated; the "
10369 "child was stopped by a signal; or the child was resumed by a signal. In the "
10370 "case of a terminated child, performing a wait allows the system to release "
10371 "the resources associated with the child; if a wait is not performed, then "
10372 "the terminated child remains in a \"zombie\" state (see NOTES below)."
10375 #. type: Plain text
10376 #: build/C/man2/wait.2:103
10378 "If a child has already changed state, then these calls return immediately. "
10379 "Otherwise they block until either a child changes state or a signal handler "
10380 "interrupts the call (assuming that system calls are not automatically "
10381 "restarted using the B<SA_RESTART> flag of B<sigaction>(2)). In the "
10382 "remainder of this page, a child whose state has changed and which has not "
10383 "yet been waited upon by one of these system calls is termed I<waitable>."
10387 #: build/C/man2/wait.2:103
10389 msgid "wait() and waitpid()"
10392 #. type: Plain text
10393 #: build/C/man2/wait.2:111
10395 "The B<wait>() system call suspends execution of the calling process until "
10396 "one of its children terminates. The call I<wait(&status)> is equivalent to:"
10399 #. type: Plain text
10400 #: build/C/man2/wait.2:114
10402 msgid " waitpid(-1, &status, 0);\n"
10405 #. type: Plain text
10406 #: build/C/man2/wait.2:128
10408 "The B<waitpid>() system call suspends execution of the calling process "
10409 "until a child specified by I<pid> argument has changed state. By default, "
10410 "B<waitpid>() waits only for terminated children, but this behavior is "
10411 "modifiable via the I<options> argument, as described below."
10414 #. type: Plain text
10415 #: build/C/man2/wait.2:132
10416 msgid "The value of I<pid> can be:"
10420 #: build/C/man2/wait.2:132
10425 #. type: Plain text
10426 #: build/C/man2/wait.2:136
10428 "meaning wait for any child process whose process group ID is equal to the "
10429 "absolute value of I<pid>."
10433 #: build/C/man2/wait.2:136
10438 #. type: Plain text
10439 #: build/C/man2/wait.2:138
10440 msgid "meaning wait for any child process."
10444 #: build/C/man2/wait.2:138
10449 #. type: Plain text
10450 #: build/C/man2/wait.2:141
10452 "meaning wait for any child process whose process group ID is equal to that "
10453 "of the calling process."
10457 #: build/C/man2/wait.2:141
10462 #. type: Plain text
10463 #: build/C/man2/wait.2:145
10464 msgid "meaning wait for the child whose process ID is equal to the value of I<pid>."
10467 #. type: Plain text
10468 #: build/C/man2/wait.2:149
10469 msgid "The value of I<options> is an OR of zero or more of the following constants:"
10473 #: build/C/man2/wait.2:149 build/C/man2/wait.2:278
10478 #. type: Plain text
10479 #: build/C/man2/wait.2:152
10480 msgid "return immediately if no child has exited."
10484 #: build/C/man2/wait.2:152
10486 msgid "B<WUNTRACED>"
10489 #. type: Plain text
10490 #: build/C/man2/wait.2:161
10492 "also return if a child has stopped (but not traced via B<ptrace>(2)). "
10493 "Status for I<traced> children which have stopped is provided even if this "
10494 "option is not specified."
10498 #: build/C/man2/wait.2:161
10500 msgid "B<WCONTINUED> (since Linux 2.6.10)"
10503 #. type: Plain text
10504 #: build/C/man2/wait.2:165
10505 msgid "also return if a stopped child has been resumed by delivery of B<SIGCONT>."
10508 #. type: Plain text
10509 #: build/C/man2/wait.2:167
10510 msgid "(For Linux-only options, see below.)"
10513 #. type: Plain text
10514 #: build/C/man2/wait.2:181
10516 "If I<status> is not NULL, B<wait>() and B<waitpid>() store status "
10517 "information in the I<int> to which it points. This integer can be inspected "
10518 "with the following macros (which take the integer itself as an argument, not "
10519 "a pointer to it, as is done in B<wait>() and B<waitpid>()!):"
10523 #: build/C/man2/wait.2:181
10525 msgid "B<WIFEXITED(>I<status>B<)>"
10528 #. type: Plain text
10529 #: build/C/man2/wait.2:189
10531 "returns true if the child terminated normally, that is, by calling "
10532 "B<exit>(3) or B<_exit>(2), or by returning from main()."
10536 #: build/C/man2/wait.2:189
10538 msgid "B<WEXITSTATUS(>I<status>B<)>"
10541 #. type: Plain text
10542 #: build/C/man2/wait.2:202
10544 "returns the exit status of the child. This consists of the least "
10545 "significant 8 bits of the I<status> argument that the child specified in a "
10546 "call to B<exit>(3) or B<_exit>(2) or as the argument for a return "
10547 "statement in main(). This macro should be employed only if B<WIFEXITED> "
10552 #: build/C/man2/wait.2:202
10554 msgid "B<WIFSIGNALED(>I<status>B<)>"
10557 #. type: Plain text
10558 #: build/C/man2/wait.2:205
10559 msgid "returns true if the child process was terminated by a signal."
10563 #: build/C/man2/wait.2:205
10565 msgid "B<WTERMSIG(>I<status>B<)>"
10568 #. type: Plain text
10569 #: build/C/man2/wait.2:212
10571 "returns the number of the signal that caused the child process to "
10572 "terminate. This macro should be employed only if B<WIFSIGNALED> returned "
10577 #: build/C/man2/wait.2:212
10579 msgid "B<WCOREDUMP(>I<status>B<)>"
10582 #. type: Plain text
10583 #: build/C/man2/wait.2:221
10585 "returns true if the child produced a core dump. This macro should be "
10586 "employed only if B<WIFSIGNALED> returned true. This macro is not specified "
10587 "in POSIX.1-2001 and is not available on some UNIX implementations (e.g., "
10588 "AIX, SunOS). Only use this enclosed in #ifdef WCOREDUMP ... #endif."
10592 #: build/C/man2/wait.2:221
10594 msgid "B<WIFSTOPPED(>I<status>B<)>"
10597 #. type: Plain text
10598 #: build/C/man2/wait.2:228
10600 "returns true if the child process was stopped by delivery of a signal; this "
10601 "is possible only if the call was done using B<WUNTRACED> or when the child "
10602 "is being traced (see B<ptrace>(2))."
10606 #: build/C/man2/wait.2:228
10608 msgid "B<WSTOPSIG(>I<status>B<)>"
10611 #. type: Plain text
10612 #: build/C/man2/wait.2:234
10614 "returns the number of the signal which caused the child to stop. This macro "
10615 "should be employed only if B<WIFSTOPPED> returned true."
10619 #: build/C/man2/wait.2:234
10621 msgid "B<WIFCONTINUED(>I<status>B<)>"
10624 #. type: Plain text
10625 #: build/C/man2/wait.2:239
10627 "(since Linux 2.6.10) returns true if the child process was resumed by "
10628 "delivery of B<SIGCONT>."
10632 #: build/C/man2/wait.2:239
10637 #. type: Plain text
10638 #: build/C/man2/wait.2:244
10640 "The B<waitid>() system call (available since Linux 2.6.9) provides more "
10641 "precise control over which child state changes to wait for."
10644 #. type: Plain text
10645 #: build/C/man2/wait.2:250
10647 "The I<idtype> and I<id> arguments select the child(ren) to wait for, as "
10652 #: build/C/man2/wait.2:250
10654 msgid "I<idtype> == B<P_PID>"
10657 #. type: Plain text
10658 #: build/C/man2/wait.2:253
10659 msgid "Wait for the child whose process ID matches I<id>."
10663 #: build/C/man2/wait.2:253
10665 msgid "I<idtype> == B<P_PGID>"
10668 #. type: Plain text
10669 #: build/C/man2/wait.2:256
10670 msgid "Wait for any child whose process group ID matches I<id>."
10674 #: build/C/man2/wait.2:256
10676 msgid "I<idtype> == B<P_ALL>"
10679 #. type: Plain text
10680 #: build/C/man2/wait.2:260
10681 msgid "Wait for any child; I<id> is ignored."
10684 #. type: Plain text
10685 #: build/C/man2/wait.2:264
10687 "The child state changes to wait for are specified by ORing one or more of "
10688 "the following flags in I<options>:"
10692 #: build/C/man2/wait.2:264
10697 #. type: Plain text
10698 #: build/C/man2/wait.2:267
10699 msgid "Wait for children that have terminated."
10703 #: build/C/man2/wait.2:267
10705 msgid "B<WSTOPPED>"
10708 #. type: Plain text
10709 #: build/C/man2/wait.2:270
10710 msgid "Wait for children that have been stopped by delivery of a signal."
10714 #: build/C/man2/wait.2:270
10716 msgid "B<WCONTINUED>"
10719 #. type: Plain text
10720 #: build/C/man2/wait.2:275
10722 "Wait for (previously stopped) children that have been resumed by delivery of "
10726 #. type: Plain text
10727 #: build/C/man2/wait.2:278
10728 msgid "The following flags may additionally be ORed in I<options>:"
10731 #. type: Plain text
10732 #: build/C/man2/wait.2:282
10733 msgid "As for B<waitpid>()."
10737 #: build/C/man2/wait.2:282
10742 #. type: Plain text
10743 #: build/C/man2/wait.2:286
10745 "Leave the child in a waitable state; a later wait call can be used to again "
10746 "retrieve the child status information."
10749 #. type: Plain text
10750 #: build/C/man2/wait.2:293
10752 "Upon successful return, B<waitid>() fills in the following fields of the "
10753 "I<siginfo_t> structure pointed to by I<infop>:"
10756 #. type: Plain text
10757 #: build/C/man2/wait.2:296
10758 msgid "The process ID of the child."
10761 #. type: Plain text
10762 #: build/C/man2/wait.2:300
10764 "The real user ID of the child. (This field is not set on most other "
10765 "implementations.)"
10768 #. type: Plain text
10769 #: build/C/man2/wait.2:304
10770 msgid "Always set to B<SIGCHLD>."
10774 #: build/C/man2/wait.2:304
10776 msgid "I<si_status>"
10779 #. type: Plain text
10780 #: build/C/man2/wait.2:314
10782 "Either the exit status of the child, as given to B<_exit>(2) (or "
10783 "B<exit>(3)), or the signal that caused the child to terminate, stop, or "
10784 "continue. The I<si_code> field can be used to determine how to interpret "
10788 #. type: Plain text
10789 #: build/C/man2/wait.2:331
10791 "Set to one of: B<CLD_EXITED> (child called B<_exit>(2)); B<CLD_KILLED> "
10792 "(child killed by signal); B<CLD_DUMPED> (child killed by signal, and dumped "
10793 "core); B<CLD_STOPPED> (child stopped by signal); B<CLD_TRAPPED> (traced "
10794 "child has trapped); or B<CLD_CONTINUED> (child continued by B<SIGCONT>)."
10797 #. POSIX.1-2001 leaves this possibility unspecified; most
10798 #. implementations (including Linux) zero out the structure
10799 #. in this case, but at least one implementation (AIX 5.1)
10800 #. does not -- MTK Nov 04
10801 #. type: Plain text
10802 #: build/C/man2/wait.2:353
10804 "If B<WNOHANG> was specified in I<options> and there were no children in a "
10805 "waitable state, then B<waitid>() returns 0 immediately and the state of the "
10806 "I<siginfo_t> structure pointed to by I<infop> is unspecified. To "
10807 "distinguish this case from that where a child was in a waitable state, zero "
10808 "out the I<si_pid> field before the call and check for a nonzero value in "
10809 "this field after the call returns."
10812 #. type: Plain text
10813 #: build/C/man2/wait.2:357
10815 "B<wait>(): on success, returns the process ID of the terminated child; on "
10816 "error, -1 is returned."
10819 #. type: Plain text
10820 #: build/C/man2/wait.2:366
10822 "B<waitpid>(): on success, returns the process ID of the child whose state "
10823 "has changed; if B<WNOHANG> was specified and one or more child(ren) "
10824 "specified by I<pid> exist, but have not yet changed state, then 0 is "
10825 "returned. On error, -1 is returned."
10828 #. FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid()
10829 #. returns the PID of the child. Either this is a bug, or it is intended
10830 #. behavior that needs to be documented. See my Jan 2009 LKML mail
10831 #. "waitid() return value strangeness when infop is NULL".
10832 #. type: Plain text
10833 #: build/C/man2/wait.2:382
10835 "B<waitid>(): returns 0 on success or if B<WNOHANG> was specified and no "
10836 "child(ren) specified by I<id> has yet changed state; on error, -1 is "
10837 "returned. Each of these calls sets I<errno> to an appropriate value in the "
10838 "case of an error."
10842 #: build/C/man2/wait.2:383 build/C/man2/wait.2:388
10847 #. type: Plain text
10848 #: build/C/man2/wait.2:388
10850 "(for B<wait>()) The calling process does not have any unwaited-for "
10854 #. type: Plain text
10855 #: build/C/man2/wait.2:408
10857 "(for B<waitpid>() or B<waitid>()) The process specified by I<pid> "
10858 "(B<waitpid>()) or I<idtype> and I<id> (B<waitid>()) does not exist or is "
10859 "not a child of the calling process. (This can happen for one's own child if "
10860 "the action for B<SIGCHLD> is set to B<SIG_IGN>. See also the I<Linux Notes> "
10861 "section about threads.)"
10864 #. type: Plain text
10865 #: build/C/man2/wait.2:415
10867 "B<WNOHANG> was not set and an unblocked signal or a B<SIGCHLD> was caught; "
10868 "see B<signal>(7)."
10871 #. type: Plain text
10872 #: build/C/man2/wait.2:420
10873 msgid "The I<options> argument was invalid."
10876 #. type: Plain text
10877 #: build/C/man2/wait.2:435
10879 "A child that terminates, but has not been waited for becomes a \"zombie\". "
10880 "The kernel maintains a minimal set of information about the zombie process "
10881 "(PID, termination status, resource usage information) in order to allow the "
10882 "parent to later perform a wait to obtain information about the child. As "
10883 "long as a zombie is not removed from the system via a wait, it will consume "
10884 "a slot in the kernel process table, and if this table fills, it will not be "
10885 "possible to create further processes. If a parent process terminates, then "
10886 "its \"zombie\" children (if any) are adopted by B<init>(8), which "
10887 "automatically performs a wait to remove the zombies."
10890 #. type: Plain text
10891 #: build/C/man2/wait.2:476
10893 "POSIX.1-2001 specifies that if the disposition of B<SIGCHLD> is set to "
10894 "B<SIG_IGN> or the B<SA_NOCLDWAIT> flag is set for B<SIGCHLD> (see "
10895 "B<sigaction>(2)), then children that terminate do not become zombies and a "
10896 "call to B<wait>() or B<waitpid>() will block until all children have "
10897 "terminated, and then fail with I<errno> set to B<ECHILD>. (The original "
10898 "POSIX standard left the behavior of setting B<SIGCHLD> to B<SIG_IGN> "
10899 "unspecified. Note that even though the default disposition of B<SIGCHLD> is "
10900 "\"ignore\", explicitly setting the disposition to B<SIG_IGN> results in "
10901 "different treatment of zombie process children.) Linux 2.6 conforms to this "
10902 "specification. However, Linux 2.4 (and earlier) does not: if a B<wait>() "
10903 "or B<waitpid>() call is made while B<SIGCHLD> is being ignored, the call "
10904 "behaves just as though B<SIGCHLD> were not being ignored, that is, the call "
10905 "blocks until the next child terminates and then returns the process ID and "
10906 "status of that child."
10909 #. type: Plain text
10910 #: build/C/man2/wait.2:492
10912 "In the Linux kernel, a kernel-scheduled thread is not a distinct construct "
10913 "from a process. Instead, a thread is simply a process that is created using "
10914 "the Linux-unique B<clone>(2) system call; other routines such as the "
10915 "portable B<pthread_create>(3) call are implemented using B<clone>(2). "
10916 "Before Linux 2.4, a thread was just a special case of a process, and as a "
10917 "consequence one thread could not wait on the children of another thread, "
10918 "even when the latter belongs to the same thread group. However, POSIX "
10919 "prescribes such functionality, and since Linux 2.4 a thread can, and by "
10920 "default will, wait on children of other threads in the same thread group."
10923 #. type: Plain text
10924 #: build/C/man2/wait.2:499
10926 "The following Linux-specific I<options> are for use with children created "
10927 "using B<clone>(2); they cannot be used with B<waitid>():"
10931 #: build/C/man2/wait.2:499
10933 msgid "B<__WCLONE>"
10937 #. type: Plain text
10938 #: build/C/man2/wait.2:510
10940 "Wait for \"clone\" children only. If omitted then wait for \"non-clone\" "
10941 "children only. (A \"clone\" child is one which delivers no signal, or a "
10942 "signal other than B<SIGCHLD> to its parent upon termination.) This option "
10943 "is ignored if B<__WALL> is also specified."
10947 #: build/C/man2/wait.2:510
10949 msgid "B<__WALL> (since Linux 2.4)"
10952 #. since patch-2.3.48
10953 #. type: Plain text
10954 #: build/C/man2/wait.2:515
10955 msgid "Wait for all children, regardless of type (\"clone\" or \"non-clone\")."
10959 #: build/C/man2/wait.2:515
10961 msgid "B<__WNOTHREAD> (since Linux 2.4)"
10964 #. since patch-2.4.0-test8
10965 #. type: Plain text
10966 #: build/C/man2/wait.2:521
10968 "Do not wait for children of other threads in the same thread group. This "
10969 "was the default before Linux 2.4."
10972 #. type: Plain text
10973 #: build/C/man2/wait.2:536
10975 "According to POSIX.1-2008, an application calling B<waitid>() must ensure "
10976 "that I<infop> points to a I<siginfo_t> structure (i.e., that it is a "
10977 "non-NULL pointer). On Linux, if I<infop> is NULL, B<waitid>() succeeds, "
10978 "and returns the process ID of the waited-for child. Applications should "
10979 "avoid relying on this inconsistent, nonstandard, and unnecessary feature."
10982 #. fork.2 refers to this example program.
10983 #. type: Plain text
10984 #: build/C/man2/wait.2:553
10986 "The following program demonstrates the use of B<fork>(2) and B<waitpid>(). "
10987 "The program creates a child process. If no command-line argument is "
10988 "supplied to the program, then the child suspends its execution using "
10989 "B<pause>(2), to allow the user to send signals to the child. Otherwise, if "
10990 "a command-line argument is supplied, then the child exits immediately, using "
10991 "the integer supplied on the command line as the exit status. The parent "
10992 "process executes a loop that monitors the child using B<waitpid>(), and uses "
10993 "the W*() macros described above to analyze the wait status value."
10996 #. type: Plain text
10997 #: build/C/man2/wait.2:569
11001 "Child PID is 32360\n"
11003 "$B< kill -STOP 32360>\n"
11004 "stopped by signal 19\n"
11005 "$B< kill -CONT 32360>\n"
11007 "$B< kill -TERM 32360>\n"
11008 "killed by signal 15\n"
11009 "[1]+ Done ./a.out\n"
11013 #. type: Plain text
11014 #: build/C/man2/wait.2:578
11017 "#include E<lt>sys/wait.hE<gt>\n"
11018 "#include E<lt>stdlib.hE<gt>\n"
11019 "#include E<lt>unistd.hE<gt>\n"
11020 "#include E<lt>stdio.hE<gt>\n"
11023 #. type: Plain text
11024 #: build/C/man2/wait.2:584
11028 "main(int argc, char *argv[])\n"
11030 " pid_t cpid, w;\n"
11034 #. type: Plain text
11035 #: build/C/man2/wait.2:590
11038 " cpid = fork();\n"
11039 " if (cpid == -1) {\n"
11040 " perror(\"fork\");\n"
11041 " exit(EXIT_FAILURE);\n"
11045 #. type: Plain text
11046 #: build/C/man2/wait.2:596
11049 " if (cpid == 0) { /* Code executed by child */\n"
11050 " printf(\"Child PID is %ld\\en\", (long) getpid());\n"
11051 " if (argc == 1)\n"
11052 " pause(); /* Wait for signals */\n"
11053 " _exit(atoi(argv[1]));\n"
11056 #. type: Plain text
11057 #: build/C/man2/wait.2:604
11060 " } else { /* Code executed by parent */\n"
11062 " w = waitpid(cpid, &status, WUNTRACED | WCONTINUED);\n"
11063 " if (w == -1) {\n"
11064 " perror(\"waitpid\");\n"
11065 " exit(EXIT_FAILURE);\n"
11069 #. type: Plain text
11070 #: build/C/man2/wait.2:618
11073 " if (WIFEXITED(status)) {\n"
11074 " printf(\"exited, status=%d\\en\", WEXITSTATUS(status));\n"
11075 " } else if (WIFSIGNALED(status)) {\n"
11076 " printf(\"killed by signal %d\\en\", WTERMSIG(status));\n"
11077 " } else if (WIFSTOPPED(status)) {\n"
11078 " printf(\"stopped by signal %d\\en\", WSTOPSIG(status));\n"
11079 " } else if (WIFCONTINUED(status)) {\n"
11080 " printf(\"continued\\en\");\n"
11082 " } while (!WIFEXITED(status) && !WIFSIGNALED(status));\n"
11083 " exit(EXIT_SUCCESS);\n"
11088 #. type: Plain text
11089 #: build/C/man2/wait.2:631
11091 "B<_exit>(2), B<clone>(2), B<fork>(2), B<kill>(2), B<ptrace>(2), "
11092 "B<sigaction>(2), B<signal>(2), B<wait4>(2), B<pthread_create>(3), "
11093 "B<credentials>(7), B<signal>(7)"
11097 #: build/C/man2/wait4.2:33
11103 #: build/C/man2/wait4.2:33
11108 #. type: Plain text
11109 #: build/C/man2/wait4.2:36
11110 msgid "wait3, wait4 - wait for process to change state, BSD style"
11113 #. type: Plain text
11114 #: build/C/man2/wait4.2:42
11117 "B<#include E<lt>sys/types.hE<gt>>\n"
11118 "B<#include E<lt>sys/time.hE<gt>>\n"
11119 "B<#include E<lt>sys/resource.hE<gt>>\n"
11120 "B<#include E<lt>sys/wait.hE<gt>>\n"
11123 #. type: Plain text
11124 #: build/C/man2/wait4.2:45
11127 "B<pid_t wait3(int *>I<status>B<, int >I<options>B<,>\n"
11128 "B< struct rusage *>I<rusage>B<);>\n"
11131 #. type: Plain text
11132 #: build/C/man2/wait4.2:48
11135 "B<pid_t wait4(pid_t >I<pid>B<, int *>I<status>B<, int >I<options>B<,>\n"
11136 "B< struct rusage *>I<rusage>B<);>\n"
11139 #. type: Plain text
11140 #: build/C/man2/wait4.2:57
11141 msgid "B<wait3>():"
11144 #. type: Plain text
11145 #: build/C/man2/wait4.2:63
11146 msgid "B<wait4>():"
11149 #. type: Plain text
11150 #: build/C/man2/wait4.2:65
11151 msgid "_BSD_SOURCE"
11154 #. type: Plain text
11155 #: build/C/man2/wait4.2:73
11157 "These functions are obsolete; use B<waitpid>(2) or B<waitid>(2) in new "
11161 #. type: Plain text
11162 #: build/C/man2/wait4.2:83
11164 "The B<wait3>() and B<wait4>() system calls are similar to B<waitpid>(2), "
11165 "but additionally return resource usage information about the child in the "
11166 "structure pointed to by I<rusage>."
11169 #. type: Plain text
11170 #: build/C/man2/wait4.2:89
11172 "Other than the use of the I<rusage> argument, the following B<wait3>() "
11176 #. type: Plain text
11177 #: build/C/man2/wait4.2:92
11179 msgid " wait3(status, options, rusage);\n"
11182 #. type: Plain text
11183 #: build/C/man2/wait4.2:95 build/C/man2/wait4.2:109
11184 msgid "is equivalent to:"
11187 #. type: Plain text
11188 #: build/C/man2/wait4.2:98
11190 msgid " waitpid(-1, status, options);\n"
11193 #. type: Plain text
11194 #: build/C/man2/wait4.2:103
11195 msgid "Similarly, the following B<wait4>() call:"
11198 #. type: Plain text
11199 #: build/C/man2/wait4.2:106
11201 msgid " wait4(pid, status, options, rusage);\n"
11204 #. type: Plain text
11205 #: build/C/man2/wait4.2:112
11207 msgid " waitpid(pid, status, options);\n"
11210 #. type: Plain text
11211 #: build/C/man2/wait4.2:122
11213 "In other words, B<wait3>() waits of any child, while B<wait4>() can be "
11214 "used to select a specific child, or children, on which to wait. See "
11215 "B<wait>(2) for further details."
11218 #. type: Plain text
11219 #: build/C/man2/wait4.2:132
11221 "If I<rusage> is not NULL, the I<struct rusage> to which it points will be "
11222 "filled with accounting information about the child. See B<getrusage>(2) "
11226 #. type: Plain text
11227 #: build/C/man2/wait4.2:135 build/C/man2/wait4.2:138
11228 msgid "As for B<waitpid>(2)."
11231 #. type: Plain text
11232 #: build/C/man2/wait4.2:140
11236 #. type: Plain text
11237 #: build/C/man2/wait4.2:147
11239 "SUSv1 included a specification of B<wait3>(); SUSv2 included B<wait3>(), but "
11240 "marked it LEGACY; SUSv3 removed it."
11243 #. type: Plain text
11244 #: build/C/man2/wait4.2:159
11246 "Including I<E<lt>sys/time.hE<gt>> is not required these days, but increases "
11247 "portability. (Indeed, I<E<lt>sys/resource.hE<gt>> defines the I<rusage> "
11248 "structure with fields of type I<struct timeval> defined in "
11249 "I<E<lt>sys/time.hE<gt>>.)"
11252 #. type: Plain text
11253 #: build/C/man2/wait4.2:165
11255 "On Linux, B<wait3>() is a library function implemented on top of the "
11256 "B<wait4>() system call."
11259 #. type: Plain text
11260 #: build/C/man2/wait4.2:172
11262 "B<fork>(2), B<getrusage>(2), B<sigaction>(2), B<signal>(2), B<wait>(2), "