| SIGINFO(2) | System Calls Manual | SIGINFO(2) | 
siginfo —
#include <signal.h>
siginfo is a structure type which contains information
  about a signal delivered to a process.
siginfo includes the following
  members:
int si_signo; int si_errno; int si_code;
si_signo contains the signal number generated by the system.
If si_errno is non-zero, then it contains a system specific error number associated with this signal. This number is defined in errno(2).
If si_code is less than or equal to zero, the signal was generated by a user process or a user requested service:
siginfo structure contains the following
      additional members:
    
pid_t si_pid;
uid_t si_uid;
    
    The si_pid field contains the pid of the sending process and the si_uid field contains the user id of the sending process.
siginfo structure contains the following
      additional members:
    
pid_t si_pid;
uid_t si_uid;
sigval_t si_value;
    
    The si_pid field contains the pid of the sending process and the si_uid field contains the user id of the sending process. Finally, the si_value field contains the value sent via sigqueue(2).
siginfo structure contains the
      following additional members:
    
sigval_t si_value;
    
    The si_value field contains the value set via timer_create(2).
siginfo structure contains the following
      additional members:
    
int si_fd;
long si_band;
    
    The si_fd argument contains the file
        descriptor number on which the operation was completed and the
        si_band field contains the side and priority of
        the operation. If the operation was a normal read,
        si_band will contain
        POLLIN |
        POLLRDNORM;
        on an out-of-band read it will contain POLLPRI |
        POLLRDBAND;
        on a normal write it will contain POLLOUT |
        POLLWRNORM;
        on an out-of-band write it will contain POLLPRI
        |
        POLLWRBAND.
siginfo structure contains the following
      additional members:
    
pid_t si_pid;
uid_t si_uid;
    
    The si_pid field contains the pid of the sending process and the si_uid field contains the user id of the sending process.
If si_code is positive, then it contains a signal specific reason why the signal was generated:
For SIGILL,
    SIGFPE, SIGBUS and
    SIGSEGV the siginfo
    structure contains the following additional members:
void *si_addr; int si_trap;
si_addr contains the address of the faulting instruction or data and si_trap contains a hardware specific reason.
For SIGTRAP and
    TRAP_BRKPT, TRAP_TRACE or
    TRAP_DBREG the siginfo
    structure contains the following additional members:
void *si_addr; int si_trap;
si_addr contains the address of the faulting data and si_trap contains a hardware specific reason.
For SIGTRAP and
    TRAP_SCE or TRAP_SCX the
    siginfo structure contains the following additional
    members:
int si_sysnum; int si_retval[2]; int si_error; uint64_t si_args[8];
si_sysnum contains the syscall number,
    si_retval contains the syscall return value
    (meaningful for TRAP_SCX only),
    si_error contains the syscall error value (meaningful
    for TRAP_SCX only) and
    si_args[8] contains the syscall arguments,
For SIGIO the
    siginfo structure contains the following additional
    members:
int si_fd; long si_band;
The si_fd argument contains the file descriptor number on which the operation was completed and the si_band field contains the side and priority of the operation as described above.
Finally, for SIGCHLD the
    siginfo structure contains the following additional
    members:
pid_t si_pid; uid_t si_uid; int si_status; clock_t si_utime; clock_t si_stime;
The si_pid field contains the pid of the
    process who's status changed, the si_uid field
    contains the user id of the that process, the
    si_status field contains either the exit code of the
    process (for CLD_EXITED), or the signal number
    received by the process.
    waitid(2),
    waitpid(2), and the
    si_utime and si_stime fields
    contain the user and system process accounting time.
siginfo type conforms to X/Open
  System Interfaces and Headers Issue 5 (“XSH5”).
Signals specifying SI_LWP or
    SI_NOINFO are NetBSD
    extensions.
The TRAP_CHLD,
    TRAP_DBREG, TRAP_EXEC,
    TRAP_LWP, TRAP_SCE and
    TRAP_SCX signal specific reasons of
    SIGTRAP are NetBSD
    extensions.
siginfo functionality first appeared in
  AT&T System V Release 4 UNIX.
TRAP_CHLD,
    TRAP_DBREG, TRAP_EXEC,
    TRAP_LWP, TRAP_SCE and
    TRAP_SCX first appeared in NetBSD
    8.
The additional parameters with syscall information in
    TRAP_SCE and TRAP_SCX first
    appeared in NetBSD 9.
| May 25, 2019 | NetBSD 9.3 |