siginfoh.inc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. type
  2. Psigval = ^sigval;
  3. sigval = record
  4. case longint of
  5. 0 : ( sival_int : longint );
  6. 1 : ( sival_ptr : pointer );
  7. end;
  8. sigval_t = sigval;
  9. Psigval_t = ^sigval_t;
  10. const
  11. __SI_MAX_SIZE = 128;
  12. __SI_PAD_SIZE = (__SI_MAX_SIZE div sizeof (Integer)) - 3;
  13. type
  14. Psiginfo = ^siginfo;
  15. siginfo = record
  16. si_signo : longint;
  17. si_errno : longint;
  18. si_code : longint;
  19. _sifields : record
  20. case longint of
  21. 0 : ( _pad : array[0..(__SI_PAD_SIZE)-1] of longint );
  22. 1 : ( _kill : record
  23. si_pid : __pid_t;
  24. si_uid : __uid_t;
  25. end );
  26. 2 : ( _timer : record
  27. _timer1 : dword;
  28. _timer2 : dword;
  29. end );
  30. 3 : ( _rt : record
  31. si_pid : __pid_t;
  32. si_uid : __uid_t;
  33. si_sigval : sigval_t;
  34. end );
  35. 4 : ( _sigchld : record
  36. si_pid : __pid_t;
  37. si_uid : __uid_t;
  38. si_status : longint;
  39. si_utime : __clock_t;
  40. si_stime : __clock_t;
  41. end );
  42. 5 : ( _sigfault : record
  43. si_addr : pointer;
  44. end );
  45. 6 : ( _sigpoll : record
  46. si_band : longint;
  47. si_fd : longint;
  48. end );
  49. end;
  50. end;
  51. siginfo_t = siginfo;
  52. Psiginfo_t = ^siginfo_t;
  53. Tsiginfo_t = siginfo_t;
  54. Const
  55. SI_ASYNCNL = -(6);
  56. SI_SIGIO = (-(6))+1;
  57. SI_ASYNCIO = (-(6))+2;
  58. SI_MESGQ = (-(6))+3;
  59. SI_TIMER = (-(6))+4;
  60. SI_QUEUE = (-(6))+5;
  61. SI_USER = (-(6))+6;
  62. SI_KERNEL = $80;
  63. ILL_ILLOPC = 1;
  64. ILL_ILLOPN = 2;
  65. ILL_ILLADR = 3;
  66. ILL_ILLTRP = 4;
  67. ILL_PRVOPC = 5;
  68. ILL_PRVREG = 6;
  69. ILL_COPROC = 7;
  70. ILL_BADSTK = 8;
  71. FPE_INTDIV = 1;
  72. FPE_INTOVF = 2;
  73. FPE_FLTDIV = 3;
  74. FPE_FLTOVF = 4;
  75. FPE_FLTUND = 5;
  76. FPE_FLTRES = 6;
  77. FPE_FLTINV = 7;
  78. FPE_FLTSUB = 8;
  79. SEGV_MAPERR = 1;
  80. SEGV_ACCERR = 2;
  81. BUS_ADRALN = 1;
  82. BUS_ADRERR = 2;
  83. BUS_OBJERR = 3;
  84. TRAP_BRKPT = 1;
  85. TRAP_TRACE = 2;
  86. CLD_EXITED = 1;
  87. CLD_KILLED = 2;
  88. CLD_DUMPED = 3;
  89. CLD_TRAPPED = 4;
  90. CLD_STOPPED = 5;
  91. CLD_CONTINUED = 6;
  92. POLL_IN = 1;
  93. POLL_OUT = 2;
  94. POLL_MSG = 3;
  95. POLL_ERR = 4;
  96. POLL_PRI = 5;
  97. POLL_HUP = 6;
  98. __SIGEV_MAX_SIZE = 64;
  99. __SIGEV_PAD_SIZE = (__SIGEV_MAX_SIZE div SizeOf(Integer)) - 3;
  100. type
  101. // Glue structures.
  102. _se_pad = packed array[0..__SIGEV_PAD_SIZE-1] of Integer;
  103. TSignalEventStartProc = procedure(Param: sigval_t); cdecl;
  104. _se_sigev_thread = {packed} record
  105. _function: TSignalEventStartProc; { Function to start. }
  106. _attribute: Pointer; { Really pthread_attr_t. }
  107. end;
  108. Psigevent = ^sigevent;
  109. sigevent = record
  110. sigev_value : sigval_t;
  111. sigev_signo : longint;
  112. sigev_notify : longint;
  113. _sigev_un : record
  114. case longint of
  115. 0 : ( _pad : array[0..(__SIGEV_PAD_SIZE)-1] of longint );
  116. 1 : ( _sigev_thread :_se_sigev_thread;);
  117. end;
  118. end;
  119. sigevent_t = sigevent;
  120. Psigevent_t = ^sigevent_t;
  121. Const
  122. SIGEV_SIGNAL = 0;
  123. SIGEV_NONE = 1;
  124. SIGEV_THREAD = 2;
  125. { ---------------------------------------------------------------------
  126. Borland compatibility types
  127. ---------------------------------------------------------------------}
  128. Type
  129. TSigval = sigval_t;
  130. TSigInfo = siginfo;
  131. TSigEvent = sigevent;