2011-01-19 07:33:13 +03:00
|
|
|
.\" $NetBSD: signal.7,v 1.16 2011/01/19 04:33:13 uwe Exp $
|
1999-10-06 21:05:42 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2009-02-27 16:44:45 +03:00
|
|
|
.Dd February 27, 2009
|
1999-10-06 21:05:42 +04:00
|
|
|
.Dt SIGNAL 7
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm signal
|
|
|
|
.Nd signal facilities
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
2010-03-22 21:58:31 +03:00
|
|
|
.In signal.h
|
1999-10-06 21:05:42 +04:00
|
|
|
header file defines the following signals:
|
|
|
|
.Pp
|
2011-01-19 07:33:13 +03:00
|
|
|
.Bl -column ".Sy Value" ".Dv SIGVTALARM" "terminate process" -compact
|
|
|
|
.It Sy "Value" Ta Sy "Name" Ta Sy "Default Action" Ta Sy "Description"
|
|
|
|
.It 1 Ta Dv SIGHUP Ta "terminate process" Ta "terminal line hangup"
|
|
|
|
.It 2 Ta Dv SIGINT Ta "terminate process" Ta "interrupt program"
|
|
|
|
.It 3 Ta Dv SIGQUIT Ta "create core image" Ta "quit program"
|
|
|
|
.It 4 Ta Dv SIGILL Ta "create core image" Ta "illegal instruction"
|
|
|
|
.It 5 Ta Dv SIGTRAP Ta "create core image" Ta "trace trap"
|
|
|
|
.It 6 Ta Dv SIGABRT Ta "create core image" Ta Xr abort 3
|
1999-10-06 21:05:42 +04:00
|
|
|
call (formerly
|
|
|
|
.Dv SIGIOT )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 7 Ta Dv SIGEMT Ta "create core image" Ta "emulate instruction executed"
|
|
|
|
.It 8 Ta Dv SIGFPE Ta "create core image" Ta "floating-point exception"
|
|
|
|
.It 9 Ta Dv SIGKILL Ta "terminate process" Ta "kill program (cannot be caught or ignored)"
|
|
|
|
.It 10 Ta Dv SIGBUS Ta "create core image" Ta "bus error"
|
|
|
|
.It 11 Ta Dv SIGSEGV Ta "create core image" Ta "segmentation violation"
|
|
|
|
.It 12 Ta Dv SIGSYS Ta "create core image" Ta "invalid system call argument"
|
|
|
|
.It 13 Ta Dv SIGPIPE Ta "terminate process" Ta "write to a pipe with no reader"
|
|
|
|
.It 14 Ta Dv SIGALRM Ta "terminate process" Ta "real-time timer expired"
|
|
|
|
.It 15 Ta Dv SIGTERM Ta "terminate process" Ta "software termination signal"
|
|
|
|
.It 16 Ta Dv SIGURG Ta "discard signal" Ta "urgent condition present on socket"
|
|
|
|
.It 17 Ta Dv SIGSTOP Ta "stop process" Ta "stop (cannot be caught or ignored)"
|
|
|
|
.It 18 Ta Dv SIGTSTP Ta "stop process" Ta "stop signal generated from keyboard"
|
|
|
|
.It 19 Ta Dv SIGCONT Ta "discard signal" Ta "continue after stop (even if blocked or ignored)"
|
|
|
|
.It 20 Ta Dv SIGCHLD Ta "discard signal" Ta "child status has changed"
|
|
|
|
.It 21 Ta Dv SIGTTIN Ta "stop process" Ta "background read attempted from control terminal"
|
|
|
|
.It 22 Ta Dv SIGTTOU Ta "stop process" Ta "background write attempted to control terminal"
|
|
|
|
.It 23 Ta Dv SIGIO Ta "discard signal" Ta "I/O is possible on a descriptor (see"
|
1999-10-06 21:05:42 +04:00
|
|
|
.Xr fcntl 2 )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 24 Ta Dv SIGXCPU Ta "terminate process" Ta "CPU time limit exceeded (see"
|
1999-10-06 21:05:42 +04:00
|
|
|
.Xr setrlimit 2 )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 25 Ta Dv SIGXFSZ Ta "terminate process" Ta "file size limit exceeded (see"
|
1999-10-06 21:05:42 +04:00
|
|
|
.Xr setrlimit 2 )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 26 Ta Dv SIGVTALRM Ta "terminate process" Ta "virtual time alarm (see"
|
1999-10-06 21:05:42 +04:00
|
|
|
.Xr setitimer 2 )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 27 Ta Dv SIGPROF Ta "terminate process" Ta "profiling timer alarm (see"
|
1999-10-06 21:05:42 +04:00
|
|
|
.Xr setitimer 2 )
|
2011-01-19 07:33:13 +03:00
|
|
|
.It 28 Ta Dv SIGWINCH Ta "discard signal" Ta "window size change"
|
|
|
|
.It 29 Ta Dv SIGINFO Ta "discard signal" Ta "status request from keyboard"
|
|
|
|
.It 30 Ta Dv SIGUSR1 Ta "terminate process" Ta "user-defined signal 1"
|
|
|
|
.It 31 Ta Dv SIGUSR2 Ta "terminate process" Ta "user-defined signal 2"
|
|
|
|
.It 32 Ta Dv SIGPWR Ta "discard signal" Ta "power failure/restart"
|
1999-10-06 21:05:42 +04:00
|
|
|
.El
|
2004-06-13 23:17:06 +04:00
|
|
|
.Pp
|
2004-07-01 14:38:28 +04:00
|
|
|
A function that is async-signal-safe is either reentrant or
|
2005-01-15 01:33:15 +03:00
|
|
|
non-interruptible by signals.
|
|
|
|
This means that they can be used in
|
2004-06-13 23:17:06 +04:00
|
|
|
signal handlers
|
|
|
|
and in the child of threaded programs after doing
|
|
|
|
.Xr fork 2 .
|
|
|
|
.Pp
|
2005-01-15 01:33:15 +03:00
|
|
|
The following functions are async-signal-safe.
|
|
|
|
Any function not listed
|
2004-06-13 23:17:06 +04:00
|
|
|
below is unsafe to use in signal handlers.
|
|
|
|
.Pp
|
|
|
|
.Xr _Exit 2 ,
|
|
|
|
.Xr _exit 2 ,
|
|
|
|
.Xr abort 3 ,
|
|
|
|
.Xr accept 2 ,
|
|
|
|
.Xr access 2 ,
|
2006-03-28 23:13:04 +04:00
|
|
|
.\" .Xr aio_error
|
2004-06-13 23:17:06 +04:00
|
|
|
.\" .Xr aio_return
|
|
|
|
.\" .Xr aio_suspend
|
|
|
|
.Xr alarm 3 ,
|
|
|
|
.Xr bind 2 ,
|
|
|
|
.Xr cfgetispeed 3 ,
|
|
|
|
.Xr cfgetospeed 3 ,
|
|
|
|
.Xr cfsetispeed 3 ,
|
|
|
|
.Xr cfsetospeed 3 ,
|
|
|
|
.Xr chdir 2 ,
|
|
|
|
.Xr chmod 2 ,
|
|
|
|
.Xr chown 2 ,
|
|
|
|
.Xr clock_gettime 2 ,
|
|
|
|
.Xr close 2 ,
|
|
|
|
.Xr connect 2 ,
|
|
|
|
.Xr creat 3 ,
|
|
|
|
.Xr dup 2 ,
|
|
|
|
.Xr dup2 2 ,
|
|
|
|
.Xr execle 3 ,
|
2006-03-28 23:13:04 +04:00
|
|
|
.Xr execve 2 ,
|
2004-06-13 23:17:06 +04:00
|
|
|
.Xr fchmod 2 ,
|
|
|
|
.Xr fchown 2 ,
|
|
|
|
.Xr fcntl 2 ,
|
|
|
|
.Xr fdatasync 2 ,
|
|
|
|
.Xr fork 2 ,
|
|
|
|
.Xr fpathconf 2 ,
|
|
|
|
.Xr fstat 2 ,
|
|
|
|
.Xr fsync 2 ,
|
|
|
|
.Xr ftruncate 2 ,
|
|
|
|
.Xr getegid 2 ,
|
|
|
|
.Xr geteuid 2 ,
|
|
|
|
.Xr getgid 2 ,
|
|
|
|
.Xr getgroups 2 ,
|
|
|
|
.Xr getpeername 2 ,
|
|
|
|
.Xr getpgrp 2 ,
|
|
|
|
.Xr getpid 2 ,
|
|
|
|
.Xr getppid 2 ,
|
|
|
|
.Xr getsockname 2 ,
|
|
|
|
.Xr getsockopt 2 ,
|
|
|
|
.Xr getuid 2 ,
|
|
|
|
.Xr kill 2 ,
|
|
|
|
.Xr link 2 ,
|
|
|
|
.Xr listen 2 ,
|
|
|
|
.Xr lseek 2 ,
|
|
|
|
.Xr lstat 2 ,
|
|
|
|
.Xr mkdir 2 ,
|
|
|
|
.Xr mkfifo 2 ,
|
|
|
|
.Xr open 2 ,
|
|
|
|
.Xr pathconf 2 ,
|
|
|
|
.Xr pause 3 ,
|
|
|
|
.Xr pipe 2 ,
|
|
|
|
.Xr poll 2 ,
|
|
|
|
.\" .Xr posix_trace_event 2
|
|
|
|
.\" .Xr pselect 2
|
|
|
|
.Xr raise 3 ,
|
|
|
|
.Xr read 2 ,
|
|
|
|
.Xr readlink 2 ,
|
|
|
|
.Xr recv 2 ,
|
|
|
|
.Xr recvfrom 2 ,
|
|
|
|
.Xr recvmsg 2 ,
|
|
|
|
.Xr rename 2 ,
|
2006-03-28 23:13:04 +04:00
|
|
|
.Xr rmdir 2 ,
|
2004-06-13 23:17:06 +04:00
|
|
|
.Xr select 2 ,
|
|
|
|
.Xr sem_post 3 ,
|
|
|
|
.Xr send 2 ,
|
|
|
|
.Xr sendmsg 2 ,
|
|
|
|
.Xr sendto 2 ,
|
|
|
|
.Xr setgid 2 ,
|
|
|
|
.Xr setpgid 2 ,
|
|
|
|
.Xr setsid 2 ,
|
|
|
|
.Xr setsockopt 2 ,
|
|
|
|
.Xr setuid 2 ,
|
|
|
|
.Xr shutdown 2 ,
|
|
|
|
.Xr sigaction 2 ,
|
|
|
|
.Xr sigaddset 3 ,
|
|
|
|
.Xr sigdelset 3 ,
|
|
|
|
.Xr sigemptyset 3 ,
|
|
|
|
.Xr sigfillset 3 ,
|
|
|
|
.Xr sigismember 3 ,
|
|
|
|
.Xr sleep 3 ,
|
|
|
|
.Xr signal 3 ,
|
|
|
|
.Xr sigpause 3 ,
|
|
|
|
.Xr sigpending 2 ,
|
2006-03-28 23:13:04 +04:00
|
|
|
.Xr sigprocmask 2 ,
|
|
|
|
.\" .Xr sigqueue
|
2004-06-13 23:17:06 +04:00
|
|
|
.Xr sigset 3 ,
|
|
|
|
.Xr sigsuspend 2 ,
|
2006-03-28 23:13:04 +04:00
|
|
|
.Xr sockatmark 3 ,
|
2004-06-13 23:17:06 +04:00
|
|
|
.Xr socket 2 ,
|
|
|
|
.Xr socketpair 2 ,
|
|
|
|
.Xr stat 2 ,
|
|
|
|
.Xr symlink 2 ,
|
|
|
|
.Xr sysconf 3 ,
|
|
|
|
.Xr tcdrain 3 ,
|
|
|
|
.Xr tcflow 3 ,
|
|
|
|
.Xr tcflush 3 ,
|
|
|
|
.Xr tcgetattr 3 ,
|
|
|
|
.Xr tcgetpgrp 3 ,
|
|
|
|
.Xr tcsendbreak 3 ,
|
|
|
|
.Xr tcsetattr 3 ,
|
|
|
|
.Xr tcsetpgrp 3 ,
|
|
|
|
.Xr time 3 ,
|
|
|
|
.Xr timer_getoverrun 2 ,
|
|
|
|
.Xr timer_gettime 2 ,
|
|
|
|
.Xr timer_settime 2 ,
|
|
|
|
.Xr times 3 ,
|
|
|
|
.Xr umask 2 ,
|
|
|
|
.Xr uname 3 ,
|
|
|
|
.Xr unlink 2 ,
|
|
|
|
.Xr utime 3 ,
|
|
|
|
.Xr wait 2 ,
|
|
|
|
.Xr waitpid 2 ,
|
|
|
|
.Xr write 2 .
|
2009-02-26 22:07:13 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr kill 1 ,
|
|
|
|
.Xr kill 2 ,
|
|
|
|
.Xr ptrace 2 ,
|
|
|
|
.Xr sigaction 2 ,
|
|
|
|
.Xr sigaltstack 2 ,
|
|
|
|
.Xr sigprocmask 2 ,
|
|
|
|
.Xr sigstack 2 ,
|
|
|
|
.Xr sigsuspend 2 ,
|
|
|
|
.Xr fpgetmask 3 ,
|
|
|
|
.Xr fpsetmask 3 ,
|
|
|
|
.Xr setjmp 3 ,
|
|
|
|
.Xr sigblock 3 ,
|
|
|
|
.Xr siginterrupt 3 ,
|
|
|
|
.Xr signal 3 ,
|
|
|
|
.Xr sigpause 3 ,
|
|
|
|
.Xr sigsetmask 3 ,
|
|
|
|
.Xr sigsetops 3 ,
|
|
|
|
.Xr tty 4
|
1999-10-06 21:05:42 +04:00
|
|
|
.Sh STANDARDS
|
2000-05-22 12:55:57 +04:00
|
|
|
These signals conform to
|
1999-10-06 21:05:42 +04:00
|
|
|
.St -p1003.1-90 ,
|
|
|
|
with the exception of
|
|
|
|
.Dv SIGTRAP ,
|
|
|
|
.Dv SIGEMT ,
|
|
|
|
.Dv SIGBUS ,
|
|
|
|
.Dv SIGSYS ,
|
|
|
|
.Dv SIGURG ,
|
|
|
|
.Dv SIGIO ,
|
|
|
|
.Dv SIGXCPU ,
|
|
|
|
.Dv SIGXFSZ ,
|
|
|
|
.Dv SIGVTALRM ,
|
|
|
|
.Dv SIGPROF ,
|
|
|
|
.Dv SIGWINCH ,
|
|
|
|
and
|
|
|
|
.Dv SIGINFO
|
|
|
|
which are Berkeley extensions (available on most
|
|
|
|
.Bx Ns \-derived
|
2000-05-22 12:55:57 +04:00
|
|
|
systems), and
|
1999-10-06 21:05:42 +04:00
|
|
|
.Dv SIGPWR
|
2000-05-22 12:55:57 +04:00
|
|
|
which comes from System V.
|
|
|
|
.Sh HISTORY
|
1999-10-06 21:05:42 +04:00
|
|
|
.Dv SIGPWR
|
2000-05-22 12:55:57 +04:00
|
|
|
was introduced in
|
|
|
|
.Nx 1.4 .
|
1999-10-06 21:05:42 +04:00
|
|
|
.Sh NOTES
|
2000-05-22 12:55:57 +04:00
|
|
|
The current
|
|
|
|
.Nx
|
|
|
|
kernel never generates the
|
1999-10-06 21:05:42 +04:00
|
|
|
.Dv SIGPWR
|
|
|
|
signal.
|