Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144362365
D51055.id157641.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D51055.id157641.diff
View Options
diff --git a/lib/libsys/sigaction.2 b/lib/libsys/sigaction.2
--- a/lib/libsys/sigaction.2
+++ b/lib/libsys/sigaction.2
@@ -314,7 +314,11 @@
.It Dv SIGILL Ta create core image Ta illegal instruction
.It Dv SIGTRAP Ta create core image Ta trace trap
.It Dv SIGABRT Ta create core image Ta Xr abort 3 call (formerly Dv SIGIOT )
-.It Dv SIGEMT Ta create core image Ta emulate instruction executed
+.It Dv SIGEMT Ta create core image Ta Emulate instruction executed.
+.Dv SIGEMT
+is reserved for emulator traps and is currently unused by the
+.Fx kernel.
+It may be raised manually by applications or debugging tools.
.It Dv SIGFPE Ta create core image Ta floating-point exception
.It Dv SIGKILL Ta terminate process Ta kill program
.It Dv SIGBUS Ta create core image Ta bus error
@@ -350,7 +354,203 @@
or
.Dv SIGSTOP .
Any attempt to do so will be silently ignored.
+.Ss HANDLER PROTOTYPES
+There are three possible prototypes the handler may match:
+.Bl -tag -offset indent -width short
+.It Tn ANSI C :
+.Ft void
+.Fn handler int ;
+.It Traditional BSD style:
+.Ft void
+.Fn handler int "int code" "struct sigcontext *scp" ;
+.It Tn POSIX Dv SA_SIGINFO :
+.Ft void
+.Fn handler int "siginfo_t *info" "ucontext_t *uap" ;
+.El
.Pp
+The handler function should match the
+.Dv SA_SIGINFO
+prototype if the
+.Dv SA_SIGINFO
+bit is set in
+.Va sa_flags .
+It then should be pointed to by the
+.Va sa_sigaction
+member of
+.Vt "struct sigaction" .
+Note that you should not assign
+.Dv SIG_DFL
+or
+.Dv SIG_IGN
+this way.
+.Pp
+If the
+.Dv SA_SIGINFO
+flag is not set, the handler function should match
+either the
+.Tn ANSI C
+or traditional
+.Bx
+prototype and be pointed to by
+the
+.Va sa_handler
+member of
+.Vt "struct sigaction" .
+In practice,
+.Fx
+always sends the three arguments of the latter and since the
+.Tn ANSI C
+prototype is a subset, both will work.
+The
+.Va sa_handler
+member declaration in
+.Fx
+include files is that of
+.Tn ANSI C
+(as required by
+.Tn POSIX ) ,
+so a function pointer of a
+.Bx Ns -style
+function needs to be casted to
+compile without warning.
+The traditional
+.Bx
+style is not portable and since its capabilities
+are a full subset of a
+.Dv SA_SIGINFO
+handler,
+its use is deprecated.
+.Sh SI_CODE VALUES
+The
+.Va si_code
+field of the
+.Vt siginfo_t
+structure indicates the reason why the signal was delivered.
+Generic codes may be used across multiple signal types:
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv SI_USER
+Sent by a user process with
+.Fn kill .
+.It Dv SI_QUEUE
+Sent by
+.Fn sigqueue .
+.It Dv SI_TIMER
+Sent by expiration of a timer created with
+.Fn timer_create .
+.It Dv SI_ASYNCIO
+Sent by asynchronous I/O completion.
+.It Dv SI_MESGQ
+Sent by arrival of a message on an empty message queue.
+.It Dv SI_KERNEL
+Sent by the kernel for reasons not covered by other codes.
+.It Dv SI_NOINFO
+The operating system was unable to determine the source of the signal.
+No signal info besides si_signo.
+.El
+.Pp
+In addition to the generic codes, signal-specific
+.Va si_code
+values are defined:
+.Ss SIGILL
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv ILL_ILLOPC
+Illegal opcode.
+.It Dv ILL_ILLOPN
+Illegal operand.
+.It Dv ILL_ILLADR
+Illegal addressing mode.
+.It Dv ILL_ILLTRP
+Illegal trap.
+.It Dv ILL_PRVOPC
+Privileged opcode.
+.It Dv ILL_PRVREG
+Privileged register.
+.It Dv ILL_COPROC
+Coprocessor error.
+.It Dv ILL_BADSTK
+Internal stack error.
+.El
+.Ss SIGFPE
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv FPE_INTDIV
+Integer divide by zero.
+.It Dv FPE_INTOVF
+Integer overflow.
+.It Dv FPE_FLTDIV
+Floating-point divide by zero.
+.It Dv FPE_FLTOVF
+Floating-point overflow.
+.It Dv FPE_FLTUND
+Floating-point underflow.
+.It Dv FPE_FLTRES
+Floating-point inexact result.
+.It Dv FPE_FLTINV
+Invalid floating-point operation.
+.It Dv FPE_FLTSUB
+Subscript out of range.
+.It Dv FPE_FLTIDO
+Input denormal operation.
+.El
+.Ss SIGSEGV
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv SEGV_MAPERR
+Address not mapped to object.
+.It Dv SEGV_ACCERR
+Invalid permissions for mapped object.
+.It Dv SEGV_PKUERR
+Access denied by memory protection keys (PKU).
+.El
+.Ss SIGBUS
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv BUS_ADRALN
+Invalid address alignment.
+.It Dv BUS_ADRERR
+Nonexistent physical address.
+.It Dv BUS_OBJERR
+Object-specific hardware error.
+.El
+.Ss SIGTRAP
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv TRAP_BRKPT
+Process breakpoint.
+.It Dv TRAP_TRACE
+Process trace trap.
+.It Dv TRAP_DTRACE
+DTrace induced trap.
+This is
+.Fx specific.
+.El
+.Ss SIGCHLD
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv CLD_EXITED
+Child has exited.
+.It Dv CLD_KILLED
+Child has terminated abnormally and did not produce a core file.
+.It Dv CLD_DUMPED
+Child has terminated abnormally and produced a core file.
+.It Dv CLD_TRAPPED
+Traced child has trapped.
+.It Dv CLD_STOPPED
+Child has stopped.
+.It Dv CLD_CONTINUED
+Stopped child has continued.
+.El
+.Ss SIGPOLL
+.Bl -tag -width CLD_CONTINUED -compact
+.It Dv POLL_IN
+Data input available.
+.It Dv POLL_OUT
+Output buffers available.
+.It Dv POLL_MSG
+Input message available.
+.It Dv POLL_ERR
+I/O error.
+.It Dv POLL_PRI
+High priority input available.
+.It Dv POLL_HUP
+Device disconnected.
+.El
+.Sh ASYCHRONOUS FUNCTIONS AND SIGNAL SAFETY
The following functions are either reentrant or not interruptible
by signals and are async-signal safe.
Therefore applications may
@@ -602,72 +802,6 @@
being set by functions called from inside the signal handler.
.Sh RETURN VALUES
.Rv -std sigaction
-.Sh EXAMPLES
-There are three possible prototypes the handler may match:
-.Bl -tag -offset indent -width short
-.It Tn ANSI C :
-.Ft void
-.Fn handler int ;
-.It Traditional BSD style:
-.Ft void
-.Fn handler int "int code" "struct sigcontext *scp" ;
-.It Tn POSIX Dv SA_SIGINFO :
-.Ft void
-.Fn handler int "siginfo_t *info" "ucontext_t *uap" ;
-.El
-.Pp
-The handler function should match the
-.Dv SA_SIGINFO
-prototype if the
-.Dv SA_SIGINFO
-bit is set in
-.Va sa_flags .
-It then should be pointed to by the
-.Va sa_sigaction
-member of
-.Vt "struct sigaction" .
-Note that you should not assign
-.Dv SIG_DFL
-or
-.Dv SIG_IGN
-this way.
-.Pp
-If the
-.Dv SA_SIGINFO
-flag is not set, the handler function should match
-either the
-.Tn ANSI C
-or traditional
-.Bx
-prototype and be pointed to by
-the
-.Va sa_handler
-member of
-.Vt "struct sigaction" .
-In practice,
-.Fx
-always sends the three arguments of the latter and since the
-.Tn ANSI C
-prototype is a subset, both will work.
-The
-.Va sa_handler
-member declaration in
-.Fx
-include files is that of
-.Tn ANSI C
-(as required by
-.Tn POSIX ) ,
-so a function pointer of a
-.Bx Ns -style
-function needs to be casted to
-compile without warning.
-The traditional
-.Bx
-style is not portable and since its capabilities
-are a full subset of a
-.Dv SA_SIGINFO
-handler,
-its use is deprecated.
.Pp
The
.Fa sig
@@ -676,18 +810,6 @@
values from
.In signal.h .
.Pp
-The
-.Fa code
-argument of the
-.Bx Ns -style
-handler and the
-.Va si_code
-member of the
-.Fa info
-argument to a
-.Dv SA_SIGINFO
-handler contain a numeric code explaining the
-cause of the signal, usually one of the
.Dv SI_...
values from
.In sys/signal.h
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 1:29 AM (20 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28521156
Default Alt Text
D51055.id157641.diff (7 KB)
Attached To
Mode
D51055: Document si_code values for sigaction(2)
Attached
Detach File
Event Timeline
Log In to Comment