1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _ASM_GENERIC_SIGINFO_H 13#define _ASM_GENERIC_SIGINFO_H 14 15#include <linux/compiler.h> 16#include <linux/types.h> 17 18typedef union sigval { 19 int sival_int; 20 void __user *sival_ptr; 21} sigval_t; 22 23#ifndef __ARCH_SI_PREAMBLE_SIZE 24#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) 25#endif 26 27#define SI_MAX_SIZE 128 28#ifndef SI_PAD_SIZE 29#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) 30#endif 31 32#ifndef __ARCH_SI_UID_T 33#define __ARCH_SI_UID_T uid_t 34#endif 35 36#ifndef __ARCH_SI_BAND_T 37#define __ARCH_SI_BAND_T long 38#endif 39 40#ifndef HAVE_ARCH_SIGINFO_T 41 42typedef struct siginfo { 43 int si_signo; 44 int si_errno; 45 int si_code; 46 47 union { 48 int _pad[SI_PAD_SIZE]; 49 50 struct { 51 pid_t _pid; 52 __ARCH_SI_UID_T _uid; 53 } _kill; 54 55 struct { 56 timer_t _tid; 57 int _overrun; 58 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; 59 sigval_t _sigval; 60 int _sys_private; 61 } _timer; 62 63 struct { 64 pid_t _pid; 65 __ARCH_SI_UID_T _uid; 66 sigval_t _sigval; 67 } _rt; 68 69 struct { 70 pid_t _pid; 71 __ARCH_SI_UID_T _uid; 72 int _status; 73 clock_t _utime; 74 clock_t _stime; 75 } _sigchld; 76 77 struct { 78 void __user *_addr; 79#ifdef __ARCH_SI_TRAPNO 80 int _trapno; 81#endif 82 } _sigfault; 83 84 struct { 85 __ARCH_SI_BAND_T _band; 86 int _fd; 87 } _sigpoll; 88 } _sifields; 89} siginfo_t; 90 91#endif 92 93#define si_pid _sifields._kill._pid 94#define si_uid _sifields._kill._uid 95#define si_tid _sifields._timer._tid 96#define si_overrun _sifields._timer._overrun 97#define si_sys_private _sifields._timer._sys_private 98#define si_status _sifields._sigchld._status 99#define si_utime _sifields._sigchld._utime 100#define si_stime _sifields._sigchld._stime 101#define si_value _sifields._rt._sigval 102#define si_int _sifields._rt._sigval.sival_int 103#define si_ptr _sifields._rt._sigval.sival_ptr 104#define si_addr _sifields._sigfault._addr 105#ifdef __ARCH_SI_TRAPNO 106#define si_trapno _sifields._sigfault._trapno 107#endif 108#define si_band _sifields._sigpoll._band 109#define si_fd _sifields._sigpoll._fd 110 111#define __SI_KILL 0 112#define __SI_TIMER 0 113#define __SI_POLL 0 114#define __SI_FAULT 0 115#define __SI_CHLD 0 116#define __SI_RT 0 117#define __SI_MESGQ 0 118#define __SI_CODE(T,N) (N) 119 120#define SI_USER 0 121#define SI_KERNEL 0x80 122#define SI_QUEUE -1 123#define SI_TIMER __SI_CODE(__SI_TIMER,-2) 124#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) 125#define SI_ASYNCIO -4 126#define SI_SIGIO -5 127#define SI_TKILL -6 128#define SI_DETHREAD -7 129 130#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) 131#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) 132 133#define ILL_ILLOPC (__SI_FAULT|1) 134#define ILL_ILLOPN (__SI_FAULT|2) 135#define ILL_ILLADR (__SI_FAULT|3) 136#define ILL_ILLTRP (__SI_FAULT|4) 137#define ILL_PRVOPC (__SI_FAULT|5) 138#define ILL_PRVREG (__SI_FAULT|6) 139#define ILL_COPROC (__SI_FAULT|7) 140#define ILL_BADSTK (__SI_FAULT|8) 141#define NSIGILL 8 142 143#define FPE_INTDIV (__SI_FAULT|1) 144#define FPE_INTOVF (__SI_FAULT|2) 145#define FPE_FLTDIV (__SI_FAULT|3) 146#define FPE_FLTOVF (__SI_FAULT|4) 147#define FPE_FLTUND (__SI_FAULT|5) 148#define FPE_FLTRES (__SI_FAULT|6) 149#define FPE_FLTINV (__SI_FAULT|7) 150#define FPE_FLTSUB (__SI_FAULT|8) 151#define NSIGFPE 8 152 153#define SEGV_MAPERR (__SI_FAULT|1) 154#define SEGV_ACCERR (__SI_FAULT|2) 155#define NSIGSEGV 2 156 157#define BUS_ADRALN (__SI_FAULT|1) 158#define BUS_ADRERR (__SI_FAULT|2) 159#define BUS_OBJERR (__SI_FAULT|3) 160#define NSIGBUS 3 161 162#define TRAP_BRKPT (__SI_FAULT|1) 163#define TRAP_TRACE (__SI_FAULT|2) 164#define NSIGTRAP 2 165 166#define CLD_EXITED (__SI_CHLD|1) 167#define CLD_KILLED (__SI_CHLD|2) 168#define CLD_DUMPED (__SI_CHLD|3) 169#define CLD_TRAPPED (__SI_CHLD|4) 170#define CLD_STOPPED (__SI_CHLD|5) 171#define CLD_CONTINUED (__SI_CHLD|6) 172#define NSIGCHLD 6 173 174#define POLL_IN (__SI_POLL|1) 175#define POLL_OUT (__SI_POLL|2) 176#define POLL_MSG (__SI_POLL|3) 177#define POLL_ERR (__SI_POLL|4) 178#define POLL_PRI (__SI_POLL|5) 179#define POLL_HUP (__SI_POLL|6) 180#define NSIGPOLL 6 181 182#define SIGEV_SIGNAL 0 183#define SIGEV_NONE 1 184#define SIGEV_THREAD 2 185#define SIGEV_THREAD_ID 4 186 187#ifndef __ARCH_SIGEV_PREAMBLE_SIZE 188#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t)) 189#endif 190 191#define SIGEV_MAX_SIZE 64 192#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) / sizeof(int)) 193 194typedef struct sigevent { 195 sigval_t sigev_value; 196 int sigev_signo; 197 int sigev_notify; 198 union { 199 int _pad[SIGEV_PAD_SIZE]; 200 int _tid; 201 202 struct { 203 void (*_function)(sigval_t); 204 void *_attribute; 205 } _sigev_thread; 206 } _sigev_un; 207} sigevent_t; 208 209#define sigev_notify_function _sigev_un._sigev_thread._function 210#define sigev_notify_attributes _sigev_un._sigev_thread._attribute 211#define sigev_notify_thread_id _sigev_un._tid 212 213#endif 214