#ifndef __SIGINFO_LOADED #define __SIGINFO_LOADED 1 /**************************************************************************** ** ** - Signal Handling ** ***************************************************************************** ** ** Copyright 2003 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries required for possession, use, or copying. ** ** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, ** Computer Software Documentation, and Technical Data for Commercial ** Items are licensed to the U.S. Government under vendor's standard ** commercial license. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ /* ** This header is provided as part of the signal.h header. Meaning that ** signal.h #includes . This header should never provide any ** function prototype, structure, union or datatype that signal.h is not ** supposed to provide. */ #pragma __nostandard #include #if __CRTL_VER >= 70320000 #ifdef __cplusplus extern "C" { #endif /* ** Naturally align data structures */ #pragma __member_alignment __save #pragma __member_alignment #ifndef __UID_T # define __UID_T 1 typedef __uid_t uid_t; #endif #ifndef __PID_T # define __PID_T 1 typedef __pid_t pid_t; #endif #ifndef __CLOCK_T # define __CLOCK_T 1 #ifdef __NAMESPACE_STD namespace std { #endif typedef long int clock_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::clock_t; #endif #endif union sigval { int sival_int; /* integer signal value */ #if __INITIAL_POINTER_SIZE == 64 __void_ptr64 sival_ptr; /* pad to 64 bits */ #else __void_ptr32 sival_ptr; /* pointer signal value */ __void_ptr32 _sival_fill[2];/* pad to 64 bits */ #endif }; /* * Max siginfo size -- 128 bytes altogether (used to pad siginfo _sifields) */ #define SI_MAX_SIZE (128) #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4) #ifndef __SIGINFO_T #define __SIGINFO_T 1 typedef struct __siginfo { int si_signo; /* signal number */ int si_errno; /* error number */ int si_code; /* signal code */ union { int _sipad[SI_PAD_SIZE]; /* reserve space for new fields */ /* kill() or SIGCHLD */ struct { pid_t _pid; /* sender's pid */ union { /* kill() */ struct { __uid_t _uid;/* sender's uid */ } _kill; /* SIGCHLD */ struct { int _status;/* exitcode/signal */ clock_t _utime; clock_t _stime; } _sigchld; } _pinfo; /* POSIX.1b signals */ struct { /* application-defined value */ union sigval _sigval; } _sigrt; } _sigproc; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ struct { #if __INITIAL_POINTER_SIZE == 64 __void_ptr64 _addr; /* faulting instruction/memory ref. */ #else __void_ptr32 _addr; /* faulting instruction/memory ref. */ __void_ptr32 _addr_fill; /* padding to 64 bits */ #endif } _sigfault; /* SIGPOLL */ struct { long _band; /* POLL_IN, POLL_OUT, POLL_MSG */ /* fd not currently available for SIGPOLL */ int _fd; /* file descriptor */ } _sigpoll; } _sifields; } siginfo_t; #endif /* #ifndef __SIGINFO_T */ /* * This is how users expect to access these fields. */ #define si_pid _sifields._sigproc._pid #define si_uid _sifields._sigproc._pinfo._kill._uid #define si_status _sifields._sigproc._pinfo._sigchld._status #define si_utime _sifields._sigproc._pinfo._sigchld._utime #define si_stime _sifields._sigproc._pinfo._sigchld._stime #define si_value _sifields._sigproc._sigrt._sigval #define si_int _sifields._sigproc._sigrt._sigval.sival_int #define si_ptr _sifields._sigproc._sigrt._sigval.sival_ptr #define si_addr _sifields._sigfault._addr #define si_band _sifields._sigpoll._band #define si_fd _sifields._sigpoll._fd #define si_anonval _sifields._siganon._siganonval #define si_anonint _sifields._siganon._siganonval.sival_int #define si_anonptr _sifields._siganon._siganonval.sival_ptr /* * values of si_code */ /* negative si_codes are reserved for user-generated signals */ #define SI_QUEUE -1 /* signal sent by sigqueue() */ #define SI_USER 0 /* signal sent by kill, sigsend, raise, etc. */ #define SI_TIMER 0x10 /* signal generated by expiration of a timer set by timer_settime() */ #define SI_ASYNCIO 0x20 /* signal generated by completion of an asynchronous I/O request */ #define SI_MESGQ 0x40 /* signal generated by arrival of a message on an empty message queue */ /* SIGILL si_codes */ #define ILL_ILLOPC 1 /* illegal opcode */ #define ILL_ILLOPN 2 /* illegal operand */ #define ILL_ILLADR 3 /* illegal addressing mode */ #define ILL_ILLTRP 4 /* illegal trap */ #define ILL_PRVOPC 5 /* privileged opcode */ #define ILL_PRVREG 6 /* privileged register */ #define ILL_COPROC 7 /* coprocessor error */ #define ILL_BADSTK 8 /* internal stack error */ #define NSIGILL 8 /* SIGFPE si_codes */ #define FPE_INTDIV 1 /* integer divide by zero */ #define FPE_INTOVF 2 /* integer overflow */ #define FPE_FLTDIV 3 /* floating point divide by zero */ #define FPE_FLTOVF 4 /* floating point overflow */ #define FPE_FLTUND 5 /* floating point underflow */ #define FPE_FLTRES 6 /* floating point inexact result */ #define FPE_FLTINV 7 /* invalid floating point operation */ #define FPE_FLTSUB 8 /* subscript out of range */ #define NSIGFPE 8 /* SIGSEGV si_codes */ #define SEGV_MAPERR 1 /* address not mapped to object */ #define SEGV_ACCERR 2 /* invalid permissions for mapped object */ #define SEGV_STKOVF 3 /* stack overflow */ #define NSIGSEGV 3 /* SIGBUS si_codes */ #define BUS_ADRALN 1 /* invalid address alignment */ #define BUS_ADRERR 2 /* non-existent physical address */ #define BUS_OBJERR 3 /* object specific hardware error */ #define NSIGBUS 3 /* SIGTRAP si_codes */ #define TRAP_BRKPT 1 /* process breakpoint */ #define TRAP_TRACE 2 /* process trace trap */ #define NSIGTRAP 2 /* SIGCHLD si_codes */ #define CLD_EXITED 1 /* child has exited */ #define CLD_KILLED 2 /* child was killed */ #define CLD_DUMPED 3 /* child terminated abnormally */ #define CLD_TRAPPED 4 /* traced child has trapped */ #define CLD_STOPPED 5 /* child has stopped */ #define CLD_CONTINUED 6 /* stopped child has continued */ #define CLD_SIGEXITING 7 /* child is exiting via a fatal signal */ #define NSIGCLD 7 /* SIGPOLL si_codes */ #define POLL_IN 1 /* data input available */ #define POLL_OUT 2 /* output buffers available */ #define POLL_MSG 3 /* input message available */ #define POLL_ERR 4 /* I/O error */ #define POLL_PRI 5 /* high priority input available */ #define POLL_HUP 6 /* device disconnected */ #define NSIGPOLL 6 #ifdef __cplusplus } #endif #pragma __member_alignment __restore #endif /* if __CRTL_VER */ #pragma __standard #endif /* __SIGINFO_LOADED */