signal.inc 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Free Pascal development team
  5. This file implements all the types/constants related
  6. to signal for Solaris.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. const
  14. {************************ signals *****************************}
  15. { more can be provided. Herein are only included the required }
  16. { values. }
  17. {**************************************************************}
  18. SIGABRT = 6; { abnormal termination }
  19. SIGALRM = 14; { alarm clock (used with alarm() }
  20. SIGFPE = 8; { illegal arithmetic operation }
  21. SIGHUP = 1; { Hangup }
  22. SIGILL = 4; { Illegal instruction }
  23. SIGINT = 2; { Interactive attention signal }
  24. SIGKILL = 9; { Kill, cannot be caught }
  25. SIGPIPE = 13; { Broken pipe signal }
  26. SIGQUIT = 3; { Interactive termination signal }
  27. SIGSEGV = 11; { Detection of invalid memory reference }
  28. SIGTERM = 15; { Termination request }
  29. SIGUSR1 = 16; { Application defined signal 1 }
  30. SIGUSR2 = 17; { Application defined signal 2 }
  31. SIGCHLD = 18; { Child process terminated / stopped }
  32. SIGCONT = 25; { Continue if stopped }
  33. SIGSTOP = 23; { Stop signal. cannot be cuaght }
  34. SIGSTP = 24; { Interactive stop signal }
  35. SIGTTIN = 26; { Background read from TTY }
  36. SIGTTOU = 27; { Background write to TTY }
  37. SIGBUS = 10; { Access to undefined memory }
  38. { Solaris specific signals }
  39. SIGTRAP = 5; { trace trap (not reset when caught) }
  40. SIGIOT = 6; { IOT instruction }
  41. SIGEMT = 7; { EMT instruction }
  42. SIGSYS = 12; { bad argument to system call }
  43. SIGCLD = 18; { child status change }
  44. SIGPWR = 19; { power-fail restart }
  45. SIGWINCH = 20; { window size change }
  46. SIGURG = 21; { urgent socket condition }
  47. SIGPOLL = 22; { pollable event occured }
  48. SIGIO = SIGPOLL;{ socket I/O possible (SIGPOLL alias) }
  49. SIGVTALRM = 28; { virtual timer expired }
  50. SIGPROF = 29; { profiling timer expired }
  51. SIGXCPU = 30; { exceeded cpu limit }
  52. SIGXFSZ = 31; { exceeded file size limit }
  53. SIGWAITING = 32; { process's lwps are blocked }
  54. SIGLWP = 33; { special signal used by thread library }
  55. SIGFREEZE = 34; { special signal used by CPR }
  56. SIGTHAW = 35; { special signal used by CPR }
  57. SIGCANCEL = 36; { thread cancellation signal used by libthread }
  58. SIGLOST = 37; { resource lost (eg, record-lock lost) }
  59. SIG_BLOCK = 0;
  60. SIG_UNBLOCK = 1;
  61. SIG_SETMASK = 2;
  62. SIG_DFL = 0 ;
  63. SIG_IGN = 1 ;
  64. SIG_ERR = -1 ;
  65. { definitions for the sa_flags field }
  66. SA_ONSTACK = $00000001;
  67. SA_RESETHAND = $00000002;
  68. SA_RESTART = $00000004;
  69. SA_SIGINFO = $00000008;
  70. SA_NODEFER = $00000010;
  71. SA_NOCLDWAIT = $00010000;
  72. SA_WAITSIG = $00010000;
  73. {$ifdef cpu64}
  74. SI_PAD_SIZE = ((256 div sizeof(cint)) - 4);
  75. {$else}
  76. SI_PAD_SIZE = ((128 div sizeof(cint)) - 3);
  77. {$endif}
  78. type
  79. SigSet = array[0..wordsinsigset-1] of cint;
  80. sigset_t= SigSet;
  81. PSigSet = ^SigSet;
  82. psigset_t=psigset;
  83. TSigSet = SigSet;
  84. psiginfo = ^tsiginfo;
  85. tsiginfo = record
  86. si_signo : cint;
  87. si_errno : cint;
  88. si_code : cint;
  89. {$ifdef cpu64}
  90. si_pad : cint;
  91. {$endif cpu64}
  92. _sifields : record
  93. case longint of
  94. 0 : ( _pad : array[0..(SI_PAD_SIZE)-1] of longint );
  95. 1 : ( _kill : record
  96. _pid : pid_t;
  97. _uid : uid_t;
  98. end );
  99. 2 : ( _timer : record
  100. _timer1 : dword;
  101. _timer2 : dword;
  102. end );
  103. 3 : ( _rt : record
  104. _pid : pid_t;
  105. _uid : uid_t;
  106. _sigval : pointer;
  107. end );
  108. 4 : ( _sigchld : record
  109. _pid : pid_t;
  110. _uid : uid_t;
  111. _status : longint;
  112. _utime : clock_t;
  113. _stime : clock_t;
  114. end );
  115. 5 : ( _sigfault : record
  116. _addr : pointer;
  117. _trapno : cint;
  118. _pc : pointer;
  119. end );
  120. 6 : ( _sigpoll : record
  121. _band : longint;
  122. _fd : longint;
  123. end );
  124. end;
  125. end;
  126. { CPU dependent TSigContext }
  127. {$i sighndh.inc}
  128. type
  129. SignalHandler = Procedure(Sig : Longint);cdecl;
  130. PSignalHandler = ^SignalHandler;
  131. SignalRestorer = Procedure;cdecl;
  132. PSignalRestorer = ^SignalRestorer;
  133. SigActionHandler = procedure(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);cdecl;
  134. SigActionRec = packed record // this is temporary for the migration
  135. Sa_Flags : cuint;
  136. sa_handler : SigActionHandler;
  137. Sa_Mask : SigSet;
  138. sa_resv : array[1..2] of cint; { for non-_LP64 platforms only }
  139. end;
  140. TSigActionRec = SigActionRec;
  141. PSigActionRec = ^SigActionRec;
  142. {
  143. $Log$
  144. Revision 1.5 2005-02-14 17:13:31 peter
  145. * truncate log
  146. Revision 1.4 2005/02/14 16:32:41 peter
  147. * solaris updates
  148. Revision 1.3 2005/02/13 22:13:20 peter
  149. * get solaris back in shape
  150. Revision 1.2 2005/02/10 17:30:54 peter
  151. * renamed to solaris
  152. }