signal.inc 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. {$PACKRECORDS C}
  2. {
  3. $Id$
  4. Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  5. @APPLE_LICENSE_HEADER_START@
  6. The contents of this file constitute Original Code as defined in and
  7. are subject to the Apple Public Source License Version 1.1 (the
  8. "License"). You may not use this file except in compliance with the
  9. License. Please obtain a copy of the License at
  10. http://www.apple.com/publicsource and read it before using this file.
  11. This Original Code and all software distributed under the License are
  12. distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  13. EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  14. INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
  16. License for the specific language governing rights and limitations
  17. under the License.
  18. @APPLE_LICENSE_HEADER_END@
  19. }
  20. { Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved }
  21. {
  22. Copyright (c) 1982, 1986, 1989, 1991, 1993
  23. The Regents of the University of California. All rights reserved.
  24. (c) UNIX System Laboratories, Inc.
  25. All or some portions of this file are derived from material licensed
  26. to the University of California by American Telephone and Telegraph
  27. Co. or Unix System Laboratories, Inc. and are reproduced herein with
  28. the permission of UNIX System Laboratories, Inc.
  29. Redistribution and use in source and binary forms, with or without
  30. modification, are permitted provided that the following conditions
  31. are met:
  32. 1. Redistributions of source code must retain the above copyright
  33. notice, this list of conditions and the following disclaimer.
  34. 2. Redistributions in binary form must reproduce the above copyright
  35. notice, this list of conditions and the following disclaimer in the
  36. documentation and/or other materials provided with the distribution.
  37. 3. All advertising materials mentioning features or use of this software
  38. must display the following acknowledgement:
  39. This product includes software developed by the University of
  40. California, Berkeley and its contributors.
  41. 4. Neither the name of the University nor the names of its contributors
  42. may be used to endorse or promote products derived from this software
  43. without specific prior written permission.
  44. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  45. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  46. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  47. ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  48. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  49. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  50. OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  51. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  52. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  53. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  54. SUCH DAMAGE.
  55. @(#)signal.h 8.2 (Berkeley) 1/21/94
  56. }
  57. {$ifdef cpupowerpc}
  58. {$include powerpc/signal.inc} { sigcontext }
  59. {$else cpupowerpc}
  60. {$ifdef cpui386}
  61. {$include i386/signal.inc} { sigcontext }
  62. {$else cpui386}
  63. {$error Unsupported cpu type!}
  64. {$endif cpui386}
  65. {$endif cpupowerpc}
  66. const
  67. { hangup }
  68. SIGHUP = 1;
  69. { interrupt }
  70. SIGINT = 2;
  71. { quit }
  72. SIGQUIT = 3;
  73. { illegal instruction (not reset when caught) }
  74. SIGILL = 4;
  75. { trace trap (not reset when caught) }
  76. SIGTRAP = 5;
  77. { abort() }
  78. SIGABRT = 6;
  79. { compatibility }
  80. SIGIOT = SIGABRT;
  81. { EMT instruction }
  82. SIGEMT = 7;
  83. { floating point exception }
  84. SIGFPE = 8;
  85. { kill (cannot be caught or ignored) }
  86. SIGKILL = 9;
  87. { bus error }
  88. SIGBUS = 10;
  89. { segmentation violation }
  90. SIGSEGV = 11;
  91. { bad argument to system call }
  92. SIGSYS = 12;
  93. { write on a pipe with no one to read it }
  94. SIGPIPE = 13;
  95. { alarm clock }
  96. SIGALRM = 14;
  97. { software termination signal from kill }
  98. SIGTERM = 15;
  99. { urgent condition on IO channel }
  100. SIGURG = 16;
  101. { sendable stop signal not from tty }
  102. SIGSTOP = 17;
  103. { stop signal from tty }
  104. SIGTSTP = 18;
  105. { continue a stopped process }
  106. SIGCONT = 19;
  107. { to parent on child stop or exit }
  108. SIGCHLD = 20;
  109. { to readers pgrp upon background tty read }
  110. SIGTTIN = 21;
  111. { like TTIN for output if (tp->t_local&LTOSTOP) }
  112. SIGTTOU = 22;
  113. { input/output possible signal }
  114. SIGIO = 23;
  115. { exceeded CPU time limit }
  116. SIGXCPU = 24;
  117. { exceeded file size limit }
  118. SIGXFSZ = 25;
  119. { virtual time alarm }
  120. SIGVTALRM = 26;
  121. { profiling time alarm }
  122. SIGPROF = 27;
  123. { window size changes }
  124. SIGWINCH = 28;
  125. { information request }
  126. SIGINFO = 29;
  127. { user defined signal 1 }
  128. SIGUSR1 = 30;
  129. { user defined signal 2 }
  130. SIGUSR2 = 31;
  131. SIG_DFL = 0;
  132. SIG_IGN = 1;
  133. SIG_ERR = -1;
  134. type
  135. sigset_t = dword;
  136. SignalHandler = Procedure(Sig : Longint);cdecl;
  137. PSignalHandler = ^SignalHandler;
  138. SignalRestorer = Procedure;cdecl;
  139. PSignalRestorer = ^SignalRestorer;
  140. TSigAction = procedure(Sig: Longint; SigContext: SigContextRec;someptr:pointer);cdecl;
  141. Sigset=sigset_t;
  142. PSigSet = ^SigSet;
  143. SigActionRec = packed record
  144. {
  145. case byte of
  146. 0: (Sh: SignalHandler; Sa_Flags: longint; Sa_Mask: SigSet);
  147. 1: (sa_handler: TSigAction);
  148. }
  149. Sa_Handler: SignalHandler;
  150. Sa_Flags: longint;
  151. Sa_Mask: SigSet;
  152. end;
  153. const
  154. SA_ONSTACK = $0001;
  155. { restart system on signal return }
  156. SA_RESTART = $0002;
  157. { disable taking signals on alternate stack }
  158. SA_DISABLE = $0004;
  159. { do not bounce off kernel's sigtramp }
  160. SA_USERTRAMP = $0100;
  161. { do not generate SIGCHLD on child stop }
  162. SA_NOCLDSTOP = $0008;
  163. {
  164. Flags for sigprocmask:
  165. }
  166. { block specified signal set }
  167. SIG_BLOCK = 1;
  168. { unblock specified signal set }
  169. SIG_UNBLOCK = 2;
  170. { set specified signal set }
  171. SIG_SETMASK = 3;
  172. { type of signal function }
  173. {
  174. Structure used in sigaltstack call.
  175. }
  176. { signal stack base }
  177. { signal stack length }
  178. { SA_DISABLE and/or SA_ONSTACK }
  179. type
  180. sigaltstack = record
  181. ss_sp : ^char;
  182. ss_size : longint;
  183. ss_flags : longint;
  184. end;
  185. { minimum allowable stack }
  186. const
  187. MINSIGSTKSZ = 8192;
  188. { recommended stack size }
  189. SIGSTKSZ = MINSIGSTKSZ + 32768;
  190. {
  191. 4.3 compatibility:
  192. Signal vector "template" used in sigvec call.
  193. }
  194. { signal handler }
  195. { signal mask to apply }
  196. { see signal options below }
  197. type
  198. sigvec = record
  199. sv_handler : procedure ;
  200. sv_mask : longint;
  201. sv_flags : longint;
  202. end;
  203. const
  204. SV_ONSTACK = SA_ONSTACK;
  205. { same bit, opposite sense }
  206. SV_INTERRUPT = SA_RESTART;
  207. (*
  208. {
  209. Structure used in sigstack call.
  210. }
  211. { signal stack pointer }
  212. { current status }
  213. type
  214. sigstack = record
  215. ss_sp : ^char;
  216. ss_onstack : longint;
  217. end;
  218. *)
  219. {
  220. $Log$
  221. Revision 1.3 2003-08-21 22:25:17 olle
  222. - removed parameter from fpc_iocheck
  223. Revision 1.2 2003/05/25 12:59:57 jonas
  224. * several fixes, addition of Mach trap numbers (thye are simply syscalls
  225. with a negative number)
  226. Revision 1.1 2002/09/08 09:06:07 jonas
  227. + initial revision, h2pas of sys/signal.h
  228. }