2003-10-14 18:59:03 +04:00
|
|
|
.\" $NetBSD: siginfo.2,v 1.1 2003/10/14 14:59:04 wiz Exp $
|
2003-09-10 18:11:27 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Christos Zoulas.
|
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
|
|
|
.Dd September 10, 2003
|
2003-10-14 18:59:03 +04:00
|
|
|
.Dt SIGINFO 2
|
2003-09-10 18:11:27 +04:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm siginfo_t
|
|
|
|
.Nd signal information
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In signal.h
|
|
|
|
.Sh DESCRIPTION
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
|
|
|
is a structure type which contains information about a signal delivered
|
2003-09-10 18:11:27 +04:00
|
|
|
to a process.
|
|
|
|
.Pp
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
includes the following members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
int si_signo;
|
|
|
|
int si_errno;
|
|
|
|
int si_code;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
.Fa si_signo
|
|
|
|
contains the signal number generated by the system.
|
|
|
|
.Pp
|
2003-09-10 18:24:23 +04:00
|
|
|
If
|
2003-09-10 18:11:27 +04:00
|
|
|
.Fa si_errno
|
|
|
|
is non-zero, then it contains a system specific error number associated
|
2003-09-10 18:24:23 +04:00
|
|
|
with this signal.
|
|
|
|
This number is defined in
|
2003-09-10 18:11:27 +04:00
|
|
|
.Xr errno 2 .
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Fa si_code
|
|
|
|
is less than or equal to zero, the signal was generated by a user process
|
|
|
|
or a user requested service:
|
|
|
|
.Bl -tag -width SI_ASYNCIO
|
|
|
|
.It SI_USER
|
|
|
|
The signal was generated via
|
|
|
|
.Xr kill 2 .
|
|
|
|
The
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
pid_t si_pid;
|
|
|
|
uid_t si_uid;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fa si_pid
|
2003-09-10 18:24:23 +04:00
|
|
|
field contains the pid of the sending process and the
|
2003-09-10 18:11:27 +04:00
|
|
|
.Fa si_uid
|
|
|
|
field contains the user id of the sending process.
|
|
|
|
.\" .It SI_QUEUE
|
|
|
|
.\" The signal was generated via
|
|
|
|
.\" .Xr sigqueue 3 .
|
|
|
|
.\" The
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" .Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" structure contains the following additional members:
|
|
|
|
.\" .Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" pid_t si_pid;
|
|
|
|
.\" uid_t si_uid;
|
2003-09-14 13:04:12 +04:00
|
|
|
.\" sigval_t si_sigval;
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .Ed
|
|
|
|
.\" .Pp
|
|
|
|
.\" The
|
|
|
|
.\" .Fa si_pid
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" field contains the pid of the sending process and the
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .Fa si_uid
|
|
|
|
.\" field contains the user id of the sending process.
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" Finally, the
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .Fa si_sigval
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" field contains the value sent via
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .Xr sigqueue 3 .
|
2003-09-14 02:35:13 +04:00
|
|
|
.It SI_TIMER
|
|
|
|
The signal was generated because a timer set by
|
|
|
|
.Xr timer_settime 2
|
|
|
|
has expired.
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-14 13:04:12 +04:00
|
|
|
sigval_t si_sigval;
|
2003-09-14 02:35:13 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fa si_sigval
|
|
|
|
field contains the value set via
|
|
|
|
.Xr timer_create 2 .
|
2003-09-10 18:11:27 +04:00
|
|
|
.It SI_ASYNCIO
|
|
|
|
The signal was generated by completion of an asynchronous I/O operation.
|
|
|
|
The
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
int si_fd;
|
|
|
|
long si_band;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fa si_fd
|
|
|
|
argument contains the file descriptor number on which the operation was
|
|
|
|
completed and the
|
|
|
|
.Fa si_band
|
2003-09-10 18:24:23 +04:00
|
|
|
field contains the side and priority of the operation.
|
|
|
|
If the operation was a normal read,
|
2003-09-10 18:11:27 +04:00
|
|
|
.Fa si_band
|
2003-09-10 18:24:23 +04:00
|
|
|
will contain
|
2003-09-10 18:11:27 +04:00
|
|
|
.Dv POLLIN | POLLRDNORM ;
|
2003-09-10 18:24:23 +04:00
|
|
|
on an out-of-band read it will contain
|
2003-09-10 18:11:27 +04:00
|
|
|
.Dv POLLPRI | POLLRDBAND ;
|
|
|
|
on a normal write it will contain
|
|
|
|
.Dv POLLOUT | POLLWRNORM ;
|
2003-09-10 18:24:23 +04:00
|
|
|
on an out-of-band write it will contain
|
|
|
|
.Dv POLLPRI | POLLWRBAND .
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .It SI_MESGQ
|
2003-09-10 18:24:23 +04:00
|
|
|
.\" The signal was generated because of the arrival of a message on an empty
|
|
|
|
.\" message queue.
|
|
|
|
.\" See
|
2003-09-10 18:11:27 +04:00
|
|
|
.\" .Xr mq_notify 3 .
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
If
|
|
|
|
.Fa si_code
|
|
|
|
is positive, then it contains a signal specific reason
|
|
|
|
why the signal was generated:
|
|
|
|
.Bl -tag -width SIGCHLD
|
|
|
|
.It SIGILL
|
|
|
|
.Bl -tag -width ILL_ILLOPC
|
|
|
|
.It ILL_ILLOPC
|
|
|
|
Illegal opcode
|
|
|
|
.It ILL_ILLOPN
|
|
|
|
Illegal operand
|
|
|
|
.It ILL_ILLADR
|
|
|
|
Illegal addressing mode
|
|
|
|
.It ILL_ILLTRP
|
|
|
|
Illegal trap
|
|
|
|
.It ILL_PRVOPC
|
|
|
|
Privileged opcode
|
|
|
|
.It ILL_PRVREG
|
|
|
|
Privileged register
|
|
|
|
.It ILL_COPROC
|
|
|
|
Coprocessor error
|
|
|
|
.It ILL_BADSTK
|
|
|
|
Internal stack error
|
|
|
|
.El
|
|
|
|
.It SIGFPE
|
|
|
|
.Bl -tag -width FPE_INTDIV
|
|
|
|
.It FPE_INTDIV
|
|
|
|
Integer divide by zero
|
|
|
|
.It FPE_INTOVF
|
|
|
|
Integer overflow
|
|
|
|
.It FPE_FLTDIV
|
|
|
|
Floating point divide by zero
|
|
|
|
.It FPE_FLTOVF
|
|
|
|
Floating point overflow
|
|
|
|
.It FPE_FLTUND
|
|
|
|
Floating point underflow
|
|
|
|
.It FPE_FLTRES
|
|
|
|
Floating poing inexact result
|
|
|
|
.It FPE_FLTINV
|
|
|
|
Invalid Floating poing operation
|
|
|
|
.It FPE_FLTSUB
|
|
|
|
Subscript out of range
|
|
|
|
.El
|
|
|
|
.It SIGSEGV
|
|
|
|
.Bl -tag -width SEGV_MAPERR
|
|
|
|
.It SEGV_MAPERR
|
|
|
|
Address not mapped to object
|
|
|
|
.It SEGV_ACCERR
|
|
|
|
Invalid permissions for mapped object
|
|
|
|
.El
|
|
|
|
.It SIGBUS
|
|
|
|
.Bl -tag -width BUS_ADRALN
|
|
|
|
.It BUS_ADRALN
|
|
|
|
Invalid address alignment
|
|
|
|
.It BUS_ADRERR
|
|
|
|
Non-existant physical address
|
|
|
|
.It BUS_OBJERR
|
|
|
|
Object specific hardware error
|
|
|
|
.El
|
|
|
|
.It SIGTRAP
|
|
|
|
.Bl -tag -width TRAP_BRKPT
|
|
|
|
.It TRAP_BRKPT
|
|
|
|
Process breakpoint
|
|
|
|
.It TRAP_TRACE
|
|
|
|
Process trace trap
|
|
|
|
.El
|
|
|
|
.It SIGCHLD
|
|
|
|
.Bl -tag -width CLD_CONTINUED
|
|
|
|
.It CLD_EXITED
|
|
|
|
Child has exited
|
|
|
|
.It CLD_KILLED
|
|
|
|
Child has terminated abnormally but did not create a core file
|
|
|
|
.It CLD_DUMPED
|
|
|
|
Child has terminated abnormally and created a core file
|
|
|
|
.It CLD_TRAPPED
|
|
|
|
Traced child has trapped
|
|
|
|
.It CLD_STOPPED
|
|
|
|
Child has stopped
|
|
|
|
.It CLD_CONTINUED
|
|
|
|
Stopped child has continued
|
|
|
|
.El
|
|
|
|
.It SIGPOLL
|
|
|
|
.Bl -tag -width POLL_OUT
|
|
|
|
.It POLL_IN
|
|
|
|
Data input available
|
|
|
|
.It POLL_OUT
|
|
|
|
Output buffers available
|
|
|
|
.It POLL_MSG
|
|
|
|
Input message available
|
|
|
|
.It POLL_ERR
|
|
|
|
I/O Error
|
|
|
|
.It POLL_PRI
|
|
|
|
High priority input available
|
|
|
|
.It POLL_HUP
|
|
|
|
Device disconnected
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Dv SIGILL , SIGFPE ,
|
|
|
|
and
|
|
|
|
.Dv SIGTRAP
|
|
|
|
the
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
void *si_addr;
|
|
|
|
int si_trap;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
.Fa si_addr
|
|
|
|
contains the address of the faulting instruction and
|
|
|
|
.Fa si_trap
|
|
|
|
contains a hardware specific reason.
|
|
|
|
.Pp
|
|
|
|
For
|
2003-09-10 18:24:23 +04:00
|
|
|
.Dv SIGBUS
|
|
|
|
and
|
2003-09-10 18:11:27 +04:00
|
|
|
.Dv SIGSEGV
|
|
|
|
the
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
void *si_addr;
|
|
|
|
int si_trap;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
.Fa si_addr
|
|
|
|
contains the address of the faulting data and
|
|
|
|
.Fa si_trap
|
|
|
|
contains a hardware specific reason.
|
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Dv SIGPOLL
|
|
|
|
the
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
int si_fd;
|
|
|
|
long si_band;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fa si_fd
|
|
|
|
argument contains the file descriptor number on which the operation was
|
|
|
|
completed and the
|
|
|
|
.Fa si_band
|
2003-09-10 18:24:23 +04:00
|
|
|
field contains the side and priority of the operation as described above.
|
2003-09-10 18:11:27 +04:00
|
|
|
.Pp
|
|
|
|
Finally, for
|
|
|
|
.Dv SIGCHLD
|
|
|
|
the
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
structure contains the following additional members:
|
|
|
|
.Bd -literal -offset indent
|
2003-09-10 18:24:23 +04:00
|
|
|
pid_t si_pid;
|
|
|
|
uid_t si_uid;
|
|
|
|
int si_status;
|
|
|
|
clock_t si_utime;
|
|
|
|
clock_t si_stime;
|
2003-09-10 18:11:27 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fa si_pid
|
|
|
|
field contains the pid of the process who's status changed, the
|
|
|
|
.Fa si_uid
|
|
|
|
field contains the user id of the that process, the
|
|
|
|
.Fa si_status
|
|
|
|
field contains a status code described in
|
|
|
|
.Xr waitpid 2 ,
|
|
|
|
and the
|
|
|
|
.Fa si_utime
|
|
|
|
and
|
|
|
|
.Fa si_stime
|
|
|
|
fields contain the user and system process accounting time.
|
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
type conforms to
|
|
|
|
.St -xsh5 .
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2003-09-10 18:24:23 +04:00
|
|
|
.Nm
|
2003-09-10 18:11:27 +04:00
|
|
|
functionality first appeared in
|
|
|
|
.At V.4 .
|