1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
|
.\" Copyright (c) 1994,1995 Mike Battersby <mib@deakin.edu.au>
.\" based on work by faith@cs.unc.edu
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified, aeb, 960424
.\" Modified Fri Jan 31 17:31:20 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff.
.\" Modified Sat May 8 17:40:19 1999 by Matthew Wilcox - add POSIX.1b signals
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Mon Mar 3 23:23:40 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified Tue Aug 17 00:37:39 JST 1999
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.\"WORD: signal ʥ
.\"WORD: process ץ
.\"WORD: signal handler ʥ롦ϥɥ顼
.\"WORD: pointer ݥ
.\"WORD: mask ޥ
.\"WORD: block ػ(block)
.\"WORD: suspend (suspend)
.\"WORD: stop (stop)
.\"WORD: catch (catch)
.\"WORD: architecture ƥ㡼
.\"WORD: compatible ߴ
.\"WORD: pottable ܿ
.\"
.TH SIGACTION 2 "8 May 1999" "Linux 2.2" "Linux Programmer's Manual"
.SH ̾
sigaction, sigprocmask, sigpending, sigsuspend \- POSIX ʥ롦ؿ
.SH
.B #include <signal.h>
.sp 2
.BI "int sigaction(int " signum ", const struct sigaction *" act ","
.BI "struct sigaction *" oldact );
.sp
.BI "int sigprocmask(int " how ", const sigset_t *" set ", "
.BI "sigset_t *" oldset );
.sp
.BI "int sigpending(sigset_t *" set );
.sp
.BI "int sigsuspend(const sigset_t *" mask );
.SH
.B sigaction
ƥࡦΥʥ
ץưѹΤ˻Ѥ롣
.PP
.I signum
ϥʥꤹ
.B SIGKILL
.BR SIGSTOP
ʳƤͭʥʥ뤬Ǥ롣
.PP
.I act
NULL Ǥʤ
.I signum
ʥοưȤ
.IR act
ꤵ롣
.I oldact
NULL ǤʤкޤǤư
.IR oldact
˳Ǽ롣
.PP
.B sigaction
¤ΤϰʲΤ褦롣
.sp
.RS
.nf
struct sigaction {
void (*sa_handler)(int);
void (*sa_sigaction)(int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
void (*sa_restorer)(void);
}
.fi
.RE
.PP
.I sa_restorer
Ǥѻߤ줿ѤƤϤʤʤ
POSIX
.I sa_restorer
ǤϻꤷƤʤ
.PP
.I sa_handler
.I signum
ꤹưꤷ
ǥեȤưꤹ
.B SIG_DFL
䡢
Υʥ̵뤹
.B SIG_IGN
䡢ʥ롦ϥɥ顼ؿؤΥݥꤹ롣
.PP
.I sa_mask
ϥʥ롦ϥɥ顼¹˶ػ(block)٤ʥΥޥ
Ϳ롣äơ
.B SA_NODEFER
.B SA_NOMASK
ե饰Ѥʤ¤ϡϥɥ顼ƤӽФʥػߤ롣
.PP
.I sa_flags
ϥʥ롦ϥɥ顼ư뤿Υե饰νꤹ롣
ե饰ϰʲΥİʾΥե饰 ӥåOR ˤäɽ롣
.RS
.TP
.B SA_NOCLDSTOP
.I signum
.BR SIGCHLD
ǡҥץ(child process)(stop)
(㤨Сҥץ
.BR SIGSTOP ", " SIGTSTP ", " SIGTTIN ", " SIGTTOU
ʤ)
ʤ
.TP
.BR SA_ONESHOT " ޤ " SA_RESETHAND
١ʥ롦ϥɥ顼ƤФȥʥưǥեȤ᤹
(
.BR signal (2)
ƥࡦΥǥեȤưƱǤ)
.TP
.B SA_RESTART
ĤΥƥࡦʥۤƺƳǤ褦ˤ
뤳Ȥǡ BSD ʥ(semantics)ȸߴΤư롣
.TP
.BR SA_NOMASK " ޤ " SA_NODEFER
켫ȤΥʥ롦ϥɥ顼ˤǤ
ʥ˸ʤ褦ˤ롣
.TP
.B SA_SIGINFO
ʥ롦ϥɥ顼ϰĤǤϤʤĤΰġξ
.IR sa_handler
Τ
.I sa_sigaction
ꤷʤФʤʤ
(sa_sigaction եɤ Linux 2.1.86 ˲ä줿)
.RE
.PP
.I sa_sigaction
.I siginfo_t
ѥϰʲǤŤΤǤ
.sp
.RS
.nf
.ta 4 13 24
siginfo_t {
int si_signo; /* Signal number */
int si_errno; /* An errno value */
int si_code; /* Signal code */
pid_t si_pid; /* Sending process ID */
uid_t si_uid; /* Real user ID of sending process */
int si_status; /* Exit value or signal */
clock_t si_utime; /* User time consumed */
clock_t si_stime; /* System time consumed */
sigval_t si_value; /* Signal value */
int si_int; /* POSIX.1b signal */
void * si_ptr; /* POSIX.1b signal */
void * si_addr; /* Memory location which caused fault */
int si_band; /* Band event */
int si_fd; /* File descriptor */
}
.fi
.RE
.IR si_signo ", " si_errno ", " si_code
ƤΥʥƤ롣
.BR kill (2),
POSIX.1b ʥ SIGCHLD
.IR si_pid " " si_uid
ꤹ롣
.BR
SIGCHLD Ϥ
.IR si_status ", " si_utime ", " si_stime
ꤹ롣
.IR si_int " " si_ptr
POSIX.1b ʥԤˤäƻꤵ롣
.\" See
.\" .BR sigqueue (2)
.\" for more details.
SIGILL, SIGFPE, SIGSEGV, SIGBUS
.I si_addr
˥եȤɥ쥹ꤹ롣
SIGPOLL
.IR si_band " " si_fd
ꤹ롣
.I si_code
ϤΥʥ뤬줿ͳͤǤӥåȥޥǤϤʤ
ƤΥʥ˲ǽͤϰʲɽ˥ꥹȤƤ:
.TS
tab(:) allbox;
c s
l l.
\fIsi_code\fR
Value:Signal origin
SI_USER:kill, sigsend or raise
SI_KERNEL:The kernel
SI_QUEUE:sigqueue
SI_TIMER:timer expired
SI_MESGQ:mesq state changed
SI_ASYNCIO:AIO completed
SI_SIGIO:queued SIGIO
.TE
.TS
tab(:) allbox;
c s
l l.
SIGILL
ILL_ILLOPC:illegal opcode
ILL_ILLOPN:illegal operand
ILL_ILLADR:illegal addressing mode
ILL_ILLTRP:illegal trap
ILL_PRVOPC:privileged opcode
ILL_PRVREG:privileged register
ILL_COPROC:coprocessor error
ILL_BADSTK:internal stack error
.TE
.TS
tab(:) allbox;
c s
l l.
SIGFPE
FPE_INTDIV:integer divide by zero
FPE_INTOVF:integer overflow
FPE_FLTDIV:floating point divide by zero
FPE_FLTOVF:floating point overflow
FPE_FLTUND:floating point underflow
FPE_FLTRES:floating point inexact result
FPE_FLTINV:floating point invalid operation
FPE_FLTSUB:subscript out of range
.TE
.TS
tab(:) allbox;
c s
l l.
SIGSEGV
SEGV_MAPERR:address not mapped to object
SEGV_ACCERR:invalid permissions for mapped object
.TE
.TS
tab(:) allbox;
c s
l l.
SIGBUS
BUS_ADRALN:invalid address alignment
BUS_ADRERR:non-existant physical address
BUS_OBJERR:object specific hardware error
.TE
.TS
tab(:) allbox;
c s
l l.
SIGTRAP
TRAP_BRKPT:process breakpoint
TRAP_TRACE:process trace trap
.TE
.TS
tab(:) allbox;
c s
l l.
SIGCHLD
CLD_EXITED:child has exited
CLD_KILLED:child was killed
CLD_DUMPED:child terminated abnormally
CLD_TRAPPED:traced child has trapped
CLD_STOPPED:child has stopped
CLD_CONTINUED:stopped child has continued
.TE
.TS
tab(:) allbox;
c s
l l.
SIGPOLL
POLL_IN:data input available
POLL_OUT:output buffers available
POLL_MSG:input message available
POLL_ERR:i/o error
POLL_PRI:high priority input available
POLL_HUP:device disconnected
.TE
.PP
.B sigprocmask
ϸ߶ػ(block)Ƥ륷ʥΥꥹȤѹ롣
ư
.IR how
ͤ˰¸ʲΤ褦ˤʤ롣
.RS
.TP
.B SIG_BLOCK
ػߤ줿ʥνϸߤͤ
.I set
ꤵ줿ΤιȤʤ롣
.TP
.B SIG_UNBLOCK
߶ػߤƤ륷ʥν礫
.I set
ˤ륷ʥػߤƤʤʥ
ƤϤʤ
.TP
.B SIG_SETMASK
ػߤƤ륷ʥν
.IR set
ꤹ롣
.RE
.PP
.I oldset
NULL ǤʤСʥ롦ޥκޤǤͤ
.IR oldset
˳Ǽ롣
.PP
.B sigpending
Ե(pending)Υʥ(ػȯʥ)θ
ԤʤԵΥʥΥޥ
.IR set
˳Ǽ롣
.PP
.B sigsuspend
ϰŪ˥ץΥʥ롦ޥ
.I mask
Ϳ줿Τ֤
ʥޤǡץ(suspend)롣
.SH ֤
.BR sigaction ,
.BR sigprocmask ,
.B sigpending
.B sigsuspend
0顼ʤ \-1 ֤
.SH 顼
.TP
.B EINVAL
̵ʥʥ뤬ꤵ줿(catch)Ǥʤ
.BR SIGKILL " " SIGSTOP
ιưѹ褦Ȥˤȯ롣
.TP
.B EFAULT
.IR act ", " oldact ", " set
ޤ
.I oldset
λؤץΥɥ쥹֤ˤʤ
.TP
.B EINTR
ƥࡦ뤬ޤ줿
.SH
sigprocmask
.BR SIGKILL " " SIGSTOP
ػߤ뤳ȤϤǤʤΤ褦ʻߤۤä̵뤵롣
.PP
POSIX ˤȡ\fIkill()\fP \fIraise()\fP ؿǤʤ
SIGFPE, SIGILL, SIGSEGV ʥ̵(ignore)ư̤
롣ˤ껻η̤̤Ȥʤ롣
Υƥ㡼(architecture)ǤϤ SIGFPE ʥ롣
(Ʊͤκ \-1 dz SIGFPE 뤫⤷ʤ)
Υʥ̵뤹̵¥롼פ뤫⤷ʤ
.PP
POSIX (B.3.3.1.3) Ǥ SIGCHLD SIG_IGN ꤹ뤳ȤƤʤ
BSD SYSV ưϰۤäʤƤ롣SIGCHLD ư SIG_IGN ꤷƤ
BSD Υեȥ Linux ǤϼԤ롣
.PP
POSIX λͤǤ
.BR SA_NOCLDSTOP
ΤߤƤ롣
¾
.I sa_flags
ե饰Ѥ뤳Ȥϰܿ(portable)ʤ
.PP
.B SA_RESETHAND
ե饰 SVr4 Ʊ̾Υե饰ȸߴ(compatible)롣
.PP
The
.B SA_NODEFER
ե饰 1.3.9 ʹߤΥͥǤƱ̾ SVr4 Υե饰ȸߴ롣
ŤͥǤ Linux μǤϰĤǤʤƤΥʥ
뤳ȤƤ(ºݤˤ
.I sa_mask
ˤ̵ˤǤ)
.PP
SVr4 ȤθߴΤ̾դ줿
.BR SA_RESETHAND " " SA_NODEFER
ϥ饤֥ΥС 3.0.9 ʹߤ¸ߤ롣
.PP
.BR SA_SIGINFO
ե饰 POSIX.1b ˻ꤵƤ롣Linux 2.2 饵ݡȤ褦ˤʤä
.PP
.B sigaction
ϸߤΥʥ롦ϥɥ顼ǧ뤿ܤΰ NULL
ꤷƸƤӽФȤǤ롣ޤܤȻܤΰ NULL ˤ
ƤӽФȤˤäͿ줿ʥ뤬ߤΥޥǻȤ뤫ɤ
åǤ롣
.PP
ʥ뽸˴ؤƤܤ
.BR sigsetops (3)
Ȥ뤳
.SH
POSIX, SVr4. SVr4 ˤ EINTR ˤĤƤεҤϤʤ
.SH Ϣ
.BR kill (1),
.BR kill (2),
.BR killpg (2),
.BR pause (2),
.BR raise (3),
.BR siginterrupt (3),
.BR signal (2),
.BR signal (7),
.BR sigsetops (3),
.BR sigvec (2)
|