Changeset 1574
- Timestamp:
- Oct 10, 2004, 1:07:40 PM (21 years ago)
- Location:
- trunk/src/emx/include
- Files:
-
- 10 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/386/_limits.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1573 r1574 38 38 * FreeBSD 5.1 39 39 * @changed bird: max and min of off_t. 40 * @changed bird: added __RTSIG_MAX. 40 41 */ 41 42 … … 110 111 #define __WORD_BIT 32 111 112 113 /* bird: Real time signals. */ 114 #define __RTSIG_MAX 32 112 115 #endif /* !_MACHINE__LIMITS_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/backend.h
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r1573 r1574 48 48 * Initiatlize a new thread structure. 49 49 * 50 * @param pThrd Pointer to the thread structure. 51 */ 52 void __libc_Back_threadInit(__LIBC_PTHREAD pThrd); 50 * @param pThrd Pointer to the thread structure. 51 * @param pParentThrd Pointer to the thread structure for the parent thread. 52 * If NULL and thread id is 1 then inherit from parent process. 53 * If NULL and thread is not null or no record of parent then 54 * use defaults. 55 */ 56 void __libc_Back_threadInit(__LIBC_PTHREAD pThrd, const __LIBC_PTHREAD pParentThrd); 53 57 54 58 /** … … 401 405 /** @} */ 402 406 407 408 /** @defgroup __libc_Back_Signals LIBC Backend - Signals and Exceptions 409 * @{ */ 410 411 #if defined(END_OF_CHAIN) && defined(INCL_DOSEXCEPTIONS) 412 /** 413 * The LIBC Sys Backend exception handler. 414 * 415 * @returns XCPT_CONTINUE_SEARCH or XCPT_CONTINUE_EXECUTION. 416 * @param pXcptRepRec Report record. 417 * @param pXcptRegRec Registration record. 418 * @param pCtx Context record. 419 * @param pvWhatEver Not quite sure what this is... 420 */ 421 ULONG _System __libc_Back_exceptionHandler(PEXCEPTIONREPORTRECORD pXcptRepRec, 422 PEXCEPTIONREGISTRATIONRECORD pXcptRegRec, 423 PCONTEXTRECORD pCtx, 424 PVOID pvWhatEver); 425 #endif 426 427 /** @} */ 428 403 429 __END_DECLS 404 430 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/pathrewrite.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1573 r1574 2 2 /** @file 3 3 * 4 * LIBC SYS Backend- Path Rewrite.4 * InnoTek LIBC - Path Rewrite. 5 5 * 6 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/thread.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1573 r1574 67 67 /** Default regular heap. */ 68 68 struct _uheap * pRegularHeap; 69 /** Reference count. */ 70 unsigned cRefs; 71 /** Thread Id. */ 72 unsigned tid; 73 /** Pointer to next thread in the list. */ 74 struct __libc_thread *pNext; 75 /** New TLS variable array. */ 76 void *apvTLS[__LIBC_TLS_MAX]; 69 77 /** Old TLS variable. */ 70 78 void *pvThreadStoreVar; 71 /** New TLS variable array. */72 void *apvTLS[__LIBC_TLS_MAX];73 79 74 80 /** The nesting depth of the default logger. */ … … 91 97 char szTTYNameBuf[32]; 92 98 99 /** Pending signals. 100 * Protected by the signal semaphore. */ 101 sigset_t SigSetPending; 102 /** Blocked signals. 103 * Protected by the signal semaphore. */ 104 sigset_t SigSetBlocked; 105 /** Old Blocked signals. Used by sigsuspend(). 106 * sigsuspend() sets this and fSigSetBlockedOld. When a signal is to be 107 * delivered this member will be pushed on the stack for use on an eventual 108 * return. fSigSetBlockOld will be clared. 109 * Protected by the signal semaphore. */ 110 sigset_t SigSetBlockedOld; 111 112 /** Signals queued for delivery on this thread. 113 * Protected by the signal semaphore. */ 114 struct 115 { 116 struct SignalQueued *pHead; 117 struct SignalQueued *pTail; 118 } SigQueue; 119 120 /** Alternate signal stack block address. 121 * Protected by the signal semaphore. */ 122 void *pvSigStack; 123 /** Alternate signal stack block size. 124 * Protected by the signal semaphore. */ 125 size_t cbSigStack; 126 127 /** @defgroup libc_threadstruct_flags Thread Flags 128 * @todo checkup access safety here! 129 * @{ */ 130 /** If set SigSetBlockedOld should be used used to restore SigSetBlocked 131 * when returning from a signal handler. */ 132 unsigned fSigSetBlockedOld : 1; 133 /** If set the stack block pointed to by pvSigStack is in use. */ 134 unsigned fSigStackActive : 1; 135 /** If set the thread is internal. 136 * This means the thread will not receive signals. */ 137 unsigned fInternalThread : 1; 138 /** @} */ 139 140 /** Flags whether or not the thread is being forced to evaluate its 141 * pending signals. 142 * 143 * All updates of this variable must be done atomically and when owning 144 * the signal semaphore. The atomically requirement is because it's being 145 * read without owning the semaphore. 146 */ 147 unsigned fSigBeingPoked; 148 149 150 151 /** Thread status, chiefly used for the u member of the thread structure. */ 152 enum enmLIBCThreadStatus 153 { 154 /** The thread status must be queried from the OS. */ 155 enmLIBCThreadStatus_unknown = 0, 156 /** The thread status must be queried from the OS. */ 157 enmLIBCThreadStatus_startup, 158 /** The thread is in a sigwait(), sigwaitinfo(), or sigtimedwait() call. */ 159 enmLIBCThreadStatus_sigwait, 160 } enmStatus; 161 162 /** Data used in certain thread states. 163 * Use the enmStatus field to determin which way to read the data items here. 164 */ 165 union 166 { 167 /** enmLIBCThreadStatus_startup: Begin Thread Arguments. */ 168 struct __libc_thread_startup 169 { 170 /** Thread argument. */ 171 void *pvArg; 172 /** Thread routine. */ 173 void (*pfnStart)(void *pvArg); 174 } startup; 175 176 /** enmLIBCThreadStatus_sigwait: Thread blocked in sigwait(), sigwaitinfo() or sigtimedwait(). */ 177 struct __libc_thread_sigwait 178 { 179 /** The signals we're waiting for. */ 180 sigset_t SigSetWait; 181 /** The where to return signal info. */ 182 siginfo_t *pSigInfo; 183 } SigWait; 184 } u; 185 93 186 /** Data used by the backends. */ 94 187 union __libc_backend_data … … 96 189 struct __libc_sys 97 190 { 98 /** Blocked signal mask. */99 sigset_t sig_blocked;100 /** Pending signal mask. */101 sigset_t sig_pending;102 /** Signal actions. */103 struct sigaction signals[NSIG];104 105 191 /** Directory find data entry. 106 192 * Used by __findfirst() and __findnext(). */ … … 110 196 unsigned long hdir; 111 197 /** Type of buffer content. FIL_STANDARDL or FIL_STANDARD, 112 * i.e. FILEFINDBUF 3 or FILEFINDBUF3L. */198 * i.e. FILEFINDBUF4 or FILEFINDBUF4L. */ 113 199 unsigned long fType; 114 200 /** Number of files left in the buffer. */ … … 122 208 } b; 123 209 124 /** Data used in special periods of a threads life. */ 125 union 126 { 127 struct __libc_thread_startup 128 { 129 /** Thread argument. */ 130 void *pvArg; 131 /** Thread routine. */ 132 void (*pfnStart)(void *pvArg); 133 } startup; 134 } u; 210 135 211 } __LIBC_THREAD; 136 212 … … 187 263 * @returns pointer to current thread struct. 188 264 265 * @remark No reference counting here, current thread have a permanent 266 * reference to it self. 189 267 * @remark This API is considered to be internal to LIBC and is thus not 190 268 * exposed in the shared library version of LIBC. Please don't call it. … … 202 280 * @returns pointer to current thread struct. 203 281 282 * @remark No reference counting here, current thread have a permanent 283 * reference to it self. 204 284 * @remark This API is considered to be internal to LIBC and is thus not 205 285 * exposed in the shared library version of LIBC. Please don't call it. … … 217 297 * @returns NULL if not initiated. 218 298 * 299 * @remark No reference counting here, current thread have a permanent 300 * reference to it self. 219 301 * @remark This API is considered to be internal to LIBC and is thus not 220 302 * exposed in the shared library version of LIBC. Please don't call it. … … 225 307 226 308 /** 309 * Get the thread structure for the thread specified by it's thread identification. 310 * 311 * Used for instance by signal handling to change the signal properties of another 312 * thread. 313 * 314 * @returns Pointer to threads thread struct. 315 * The caller _must_ call __libc_threadRelease() when it's done using the 316 * thread structure. 317 * @returns NULL if the thread wasn't found. 318 * @param tid The Thread Id of the thread to find. 319 * @remark This API is considered to be internal to LIBC and is thus not 320 * exposed in the shared library version of LIBC. Please don't call it. 321 */ 322 __LIBC_PTHREAD __libc_threadLookup(unsigned tid); 323 324 325 /** 326 * Get the thread structure for a thread selected by a custom callback function. 327 * 328 * @returns Pointer to the selected thread. 329 * The caller _must_ call __libc_threadRelease() when it's done using the 330 * thread structure. 331 * @param pfnCallback Function which will to the thread selection. 332 * 333 * Returns 1 if the current thread should be returned. 334 * Returns 2 if the current thread should be returned immediately. 335 * Returns 0 if the current best thread should remain unchanged. 336 * Returns -1 if the enumeration should fail (immediately). 337 * 338 * pCur The current thread. 339 * pBest The current best thread. 340 * pvParam User parameter. 341 * 342 * @param pvParam User Parameter. 343 */ 344 __LIBC_PTHREAD __libc_threadLookup2(int (pfnCallback)(__LIBC_PTHREAD pCur, __LIBC_PTHREAD pBest, void *pvParam), void *pvParam); 345 346 347 /** 348 * Enumerates all the threads LIBC is aware of subjecting each of them to a 349 * caller specified callback function. 350 * 351 * @returns 0 on success. 352 * @returns -1 if pfnCallback returned -1. 353 * 354 * @param pfnCallback Function which will to the thread selection. 355 * 356 * Returns 0 if the enmeration should continue. 357 * Returns -1 if the enumeration should fail (immediately). 358 * 359 * pCur The current thread. 360 * pvParam User parameter. 361 * 362 * @param pvParam User Parameter. 363 */ 364 int __libc_threadEnum(int (pfnCallback)(__LIBC_PTHREAD pCur, void *pvParam), void *pvParam); 365 366 367 /** 227 368 * Allocate and initialize a thread structure for a thread which is yet 228 369 * to be created. 229 370 * 371 * The returned thread structure will have cRefs set to 1, thus 372 * use __libc_threadDereference() to free it. 373 * 230 374 * @returns Pointer to thread structure. 231 375 * @returns NULL on error. errno set. … … 235 379 236 380 /** 237 * Free a thread structure. 238 * 239 * @param pThrd Pointer to the thread structure to free. 240 * Must be valid. 241 * @remark If pThrd is for the current thread the thread must be 242 * in the very final termination stage. 243 */ 244 void __libc_threadFree(__LIBC_PTHREAD pThrd); 381 * Sets up the current thread to use the thread structure pThrd. 382 * 383 * @param pThrd Pointer to the thread structure this thread 384 * should be using. 385 */ 386 void __libc_threadUse(__LIBC_PTHREAD pThrd); 387 388 389 /** 390 * Dereferences a thread structure referenced by __libc_threadLookup() or 391 * __libc_threadLookup2(), or allocated by __libc_threadAlloc(). 392 * 393 * LIBC maintains reference counting on the thread structure so the thread 394 * structure will not be freed by the thread it represent while someone else 395 * is accessing it. However, the reference counting does not protect any of 396 * the structures members from writes or reads, that's left to the users of 397 * the members to synchronize between them. 398 * 399 * @returns pointer to threads thread struct. 400 * @returns NULL if the thread wasn't found. 401 * @param pThrd Pointer to thread structure returned by __libc_threadLookup(), 402 * __libc_threadLookup2() or __libc_threadAlloc(). 403 * @remark This API is considered to be internal to LIBC and is thus not 404 * exposed in the shared library version of LIBC. Please don't call it. 405 */ 406 void __libc_threadDereference(__LIBC_PTHREAD pThrd); 245 407 246 408 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/syscalls.h
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1573 r1574 5 5 6 6 #include <sys/types.h> 7 #ifdef __NEW_SIGNALS__ 8 #include <sys/_sigset.h> 9 #endif 7 10 8 11 #if defined (__cplusplus) … … 29 32 #define _SO_SIZE 0x00200000 30 33 34 #ifndef __NEW_SIGNALS__ 35 #include <sys/types.h> 31 36 /* For debugging of signal handlers. */ 32 37 #define _SIG_MAGIC1 0xfeed6666 … … 39 44 typedef unsigned long sigset_t; 40 45 #endif 46 #endif /* !__NEW_SIGNALS__ */ 47 41 48 42 49 struct hostent; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/signal.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1573 r1574 1 #ifdef __NEW_SIGNALS__ 2 /** @file 3 * FreeBSD 5.1 4 * @changed bird: Added sighold(), sigignore(), sigrelse(). Added wrapper 5 * between the two sigpause() APIs. 6 */ 7 8 /*- 9 * Copyright (c) 1991, 1993 10 * The Regents of the University of California. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 2. Redistributions in binary form must reproduce the above copyright 18 * notice, this list of conditions and the following disclaimer in the 19 * documentation and/or other materials provided with the distribution. 20 * 3. All advertising materials mentioning features or use of this software 21 * must display the following acknowledgement: 22 * This product includes software developed by the University of 23 * California, Berkeley and its contributors. 24 * 4. Neither the name of the University nor the names of its contributors 25 * may be used to endorse or promote products derived from this software 26 * without specific prior written permission. 27 * 28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 * SUCH DAMAGE. 39 * 40 * @(#)signal.h 8.3 (Berkeley) 3/30/94 41 * $FreeBSD: src/include/signal.h,v 1.24 2003/03/31 23:30:41 jeff Exp $ 42 */ 43 44 #ifndef _SIGNAL_H_ 45 #define _SIGNAL_H_ 46 47 #include <sys/cdefs.h> 48 #include <sys/_types.h> 49 #include <sys/signal.h> 50 51 #if __BSD_VISIBLE 52 /* 53 * XXX should enlarge these, if only to give empty names instead of bounds 54 * errors for large signal numbers. 55 */ 56 extern __const char *__const sys_signame[NSIG]; 57 extern __const char *__const sys_siglist[NSIG]; 58 extern __const int sys_nsig; 59 #endif 60 61 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 62 #ifndef _PID_T_DECLARED 63 typedef __pid_t pid_t; 64 #define _PID_T_DECLARED 65 #endif 66 #endif 67 68 __BEGIN_DECLS 69 int raise(int); 70 71 #if __POSIX_VISIBLE || __XSI_VISIBLE 72 int kill(__pid_t, int); 73 int sigaction(int, const struct sigaction * __restrict, 74 struct sigaction * __restrict); 75 int sigaddset(sigset_t *, int); 76 int sigdelset(sigset_t *, int); 77 int sigemptyset(sigset_t *); 78 int sigfillset(sigset_t *); 79 int sigismember(const sigset_t *, int); 80 int sigpending(sigset_t *); 81 int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); 82 int sigsuspend(const sigset_t *); 83 int sigwait(const sigset_t * __restrict, int * __restrict); 84 #endif 85 86 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 87 #if 0 88 /* 89 * PR: 35924 90 * XXX we don't actually have these. We set _POSIX_REALTIME_SIGNALS to 91 * -1 to show that we don't have them, but this symbol is not necessarily 92 * in scope (in the current implementation), so we can't use it here. 93 */ 94 int sigqueue(__pid_t, int, const union sigval); 95 #endif 96 struct timespec; 97 int sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict, 98 const struct timespec * __restrict); 99 int sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict); 100 #endif 101 102 #if __XSI_VISIBLE 103 int killpg(__pid_t, int); 104 int sigaltstack(const stack_t * __restrict, stack_t * __restrict); 105 int sigpause(int); 106 #endif 107 108 #if __POSIX_VISIBLE >= 200112 109 int siginterrupt(int, int); 110 #endif 111 112 #if __BSD_VISIBLE 113 int sigblock(int); 114 struct __ucontext; /* XXX spec requires a complete declaration. */ 115 int sigreturn(const struct __ucontext *); 116 int sigsetmask(int); 117 int sigstack(const struct sigstack *, struct sigstack *); 118 int sigvec(int, struct sigvec *, struct sigvec *); 119 void psignal(unsigned int, const char *); 120 #endif 121 122 /* bird: standard call which BSD doesn't prototype. */ 123 #if __XSI_VISIBLE 124 int sighold(int); 125 int sigignore(int); 126 int sigrelse(int); 127 #endif 128 #if __BSD_VISIBLE && !defined(_XOPEN_SOURCE) && !defined(sigpause) 129 int __sigpause_bsd(int); 130 #define sigpause(mask) __sigpause_bsd(mask) 131 #endif 132 /* bird: end */ 133 134 __END_DECLS 135 136 #endif /* !_SIGNAL_H_ */ 137 138 #else /* !__NEW_SIGNALS__ */ 139 1 140 /* signal.h (emx+gcc) */ 2 141 … … 18 157 19 158 #endif /* not _SIGNAL_H */ 159 160 #endif /* !__NEW_SIGNALS__ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/limits.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1573 r1574 36 36 /** @file 37 37 * FreeBSD 5.1 38 * @changed bird: added RTSIG_MAX (real time signals) 38 39 */ 39 40 … … 99 100 #endif 100 101 102 /* bird: realtime signals */ 103 #define RTSIG_MAX __RTSIG_MAX 104 101 105 #endif /* !_SYS_LIMITS_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/select.h
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1573 r1574 10 10 11 11 #include <sys/cdefs.h> 12 #ifdef __NEW_SIGNALS__ 13 #include <sys/_sigset.h> 14 15 #ifndef _SIGSET_T_DECLARED 16 #define _SIGSET_T_DECLARED 17 /** Signal set. */ 18 typedef __sigset_t sigset_t; 19 #endif 20 21 #else /* !__NEW_SIGNALS__ */ 12 22 13 23 /** Define sigset_t here for pselect(). */ … … 16 26 typedef unsigned long sigset_t; 17 27 #endif 28 29 #endif /* !__NEW_SIGNALS__ */ 30 18 31 19 32 /** Define the number of file handles in the select buffer. -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/signal.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1573 r1574 1 #ifdef __NEW_SIGNALS__ 2 /* $Id: $ */ 3 /** @file 4 * 5 * BSD compatible. 6 * 7 * 8 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net> 9 * 10 * 11 * This file is part of InnoTek LIBC. 12 * 13 * InnoTek LIBC is free software; you can redistribute it and/or modify 14 * it under the terms of the GNU Lesser General Public License as published 15 * by the Free Software Foundation; either version 2 of the License, or 16 * (at your option) any later version. 17 * 18 * InnoTek LIBC is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public License 24 * along with InnoTek LIBC; if not, write to the Free Software 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 * 27 */ 28 29 30 #ifndef _SYS_SIGNAL_H_ 31 #define _SYS_SIGNAL_H_ 32 33 /******************************************************************************* 34 * Header Files * 35 *******************************************************************************/ 36 #include <sys/cdefs.h> 37 #include <sys/_types.h> 38 #include <machine/signal.h> 39 40 41 /******************************************************************************* 42 * Defined Constants And Macros * 43 *******************************************************************************/ 44 /** @defgroup sys_signal_h_signo Signal numbers. 45 * @{ 46 */ 47 #if __XSI_VISIBLE || __POSIX_VISIBLE 48 #define SIGHUP 1 /** POSIX: Hangup */ 49 #endif 50 #define SIGINT 2 /** ANSI: Interrupt (Ctrl-C) */ 51 #if __XSI_VISIBLE || __POSIX_VISIBLE 52 #define SIGQUIT 3 /** POSIX: Quit */ 53 #endif 54 #define SIGILL 4 /** ANSI: Illegal instruction */ 55 #if __XSI_VISIBLE 56 #define SIGTRAP 5 /** POSIX: Single step (debugging) */ 57 #endif 58 #define SIGABRT 6 /** ANSI: abort () */ 59 #if __BSD_VISIBLE 60 #define SIGIOT SIGABRT /** BSD 4.2 */ 61 #define SIGEMT 7 /** BSD: EMT instruction */ 62 #endif 63 #define SIGFPE 8 /** ANSI: Floating point */ 64 #if __XSI_VISIBLE || __POSIX_VISIBLE 65 #define SIGKILL 9 /** POSIX: Kill process */ 66 #endif 67 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 68 #define SIGBUS 10 /** BSD 4.2: Bus error */ 69 #endif 70 #define SIGSEGV 11 /** ANSI: Segmentation fault */ 71 #if __BSD_VISIBLE 72 #define SIGSYS 12 /** Invalid argument to system call */ 73 #endif 74 #if __XSI_VISIBLE || __POSIX_VISIBLE 75 #define SIGPIPE 13 /** POSIX: Broken pipe. */ 76 #define SIGALRM 14 /** POSIX: Alarm. */ 77 #endif 78 #define SIGTERM 15 /** ANSI: Termination, process killed */ 79 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 80 #define SIGURG 16 /** POSIX/BSD: urgent condition on IO channel */ 81 #endif 82 #if __XSI_VISIBLE || __POSIX_VISIBLE 83 #define SIGSTOP 17 /** POSIX: Sendable stop signal not from tty. unblockable. */ 84 #define SIGTSTP 18 /** POSIX: Stop signal from tty. */ 85 #define SIGCONT 19 /** POSIX: Continue a stopped process. */ 86 #define SIGCHLD 20 /** POSIX: Death or stop of a child process. (EMX: 18) */ 87 #define SIGCLD SIGCHLD /** System V */ 88 #define SIGTTIN 21 /** POSIX: To readers pgrp upon background tty read. */ 89 #define SIGTTOU 22 /** POSIX: To readers pgrp upon background tty write. */ 90 #endif 91 #if __BSD_VISIBLE 92 #define SIGIO 23 /** BSD: Input/output possible signal. */ 93 #endif 94 #if __XSI_VISIBLE 95 #define SIGXCPU 24 /** BSD 4.2: Exceeded CPU time limit. */ 96 #define SIGXFSZ 25 /** BSD 4.2: Exceeded file size limit. */ 97 #define SIGVTALRM 26 /** BSD 4.2: Virtual time alarm. */ 98 #define SIGPROF 27 /** BSD 4.2: Profiling time alarm. */ 99 #endif 100 #if __BSD_VISIBLE 101 #define SIGWINCH 28 /** BSD 4.3: Window size change (not implemented). */ 102 #define SIGINFO 29 /** BSD 4.3: Information request. */ 103 #endif 104 #if __XSI_VISIBLE || __POSIX_VISIBLE 105 #define SIGUSR1 30 /** POSIX: User-defined signal #1 */ 106 #define SIGUSR2 31 /** POSIX: User-defined signal #2 */ 107 #endif 108 #define SIGBREAK 32 /** OS/2: Break (Ctrl-Break). (EMX: 21) */ 109 #if __BSD_VISIBLE 110 #define NSIG 33 /** Number of old style signals (counting zero). */ 111 #endif 112 113 #define SIGRTMIN 33 /** First real time signal. */ 114 #define SIGRTMAX 63 /** Last real time signal (inclusive) */ 115 /** @} */ 116 117 118 /** @defgroup sys_signal_h_sighnd Fake Signal Functions 119 * @{ 120 */ 121 #define SIG_ERR ((void (*)(int))-1) /** Failure. */ 122 #define SIG_DFL ((void (*)(int))0) /** Default action. */ 123 #define SIG_IGN ((void (*)(int))1) /** Ignore signal. */ 124 /* 2 is reserved for BSD internal use */ 125 #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 /** @todo check specs on SIG_HOLD. */ 126 #define SIG_HOLD ((void (*)(int))3) 127 #endif 128 #ifdef __BSD_VISIBLE 129 #define SIG_ACK ((void (*)(int))4) /** OS/2: Acknowledge a signal. */ 130 #endif 131 /** @} */ 132 133 134 /** @defgroup sys_signal_h_sigev Signal Event Notification Types. 135 * See struct sigevent. 136 * @{ 137 */ 138 #define SIGEV_NONE 0 /* No async notification */ 139 #define SIGEV_SIGNAL 1 /* Generate a queued signal */ 140 #define SIGEV_THREAD 2 /* Deliver via thread creation. */ 141 /** @} */ 142 143 144 /** @defgroup sys_signal_h_sigaction_flags Signal Action Flags. 145 * @{ 146 */ 147 #if __XSI_VISIBLE 148 /** Take signal on a registerd stack_t. */ 149 #define SA_ONSTACK 0x00000001 150 /** Restart system call on signal return. Not implemented on OS/2. */ 151 #define SA_RESTART 0x00000002 152 /** Reset signal handler to SIG_DFL when deliving the signal. */ 153 #define SA_RESETHAND 0x00000004 154 /** Don't mask the signal which is being delivered. */ 155 #define SA_NODEFER 0x00000010 156 /** Don't keep zombies around for wait*(). Not implmented on OS/2. */ 157 #define SA_NOCLDWAIT 0x00000020 158 /** Signal the handler with the full set of arguments. */ 159 #define SA_SIGINFO 0x00000040 160 #endif 161 #if __XSI_VISIBLE || __POSIX_VISIBLE 162 /** Do not generate SIGCHLD on child stop. */ 163 #define SA_NOCLDSTOP 0x00000008 164 #endif 165 /** Block the signal (OS/2 legacy mode). */ 166 #define SA_ACK 0x10000000 167 /** EMX compatibility. */ 168 #define SA_SYSV SA_RESETHAND 169 /** @} */ 170 171 172 #if __BSD_VISIBLE 173 /** #defgroup sys_signal_h_sigval_flags Signal Value Flags. 174 * BSD 4.3 compatibility. 175 * @{ 176 */ 177 #define SV_ONSTACK SA_ONSTACK 178 /** opposite sense. */ 179 #define SV_INTERRUPT SA_RESTART 180 #define SV_RESETHAND SA_RESETHAND 181 #define SV_NODEFER SA_NODEFER 182 #define SV_NOCLDSTOP SA_NOCLDSTOP 183 #define SV_SIGINFO SA_SIGINFO 184 /** @} */ 185 #endif 186 187 188 /** @defgroup sys_signal_h_stack_t_flags Signal Stack Flags. (ss_flags) 189 * @{ 190 */ 191 /** Deliver signal on alternate stack. */ 192 #define SS_ONSTACK 0x00000001 193 /** Do not take signal on alternate stack. */ 194 #define SS_DISABLE 0x00000004 195 /** @} */ 196 /** Recommended size for an alternate signal stack. (See stack_t) */ 197 #define SIGSTKSZ (0x10000) 198 199 200 201 #if __BSD_VISIBLE || __POSIX_VISIBLE > 0 && __POSIX_VISIBLE <= 200112 202 /** Convert signo to a signal mask for use with sigblock(). */ 203 #define sigmask(signo) (1 << ((signo) - 1)) 204 #endif 205 206 #if __BSD_VISIBLE 207 #define BADSIG SIG_ERR 208 #endif 209 210 #if __POSIX_VISIBLE || __XSI_VISIBLE 211 /* 212 * Flags for sigprocmask: 213 */ 214 /** @defgroup sys_signal_h_sigprocmask_flags Flags for sigprocmask(). 215 * @{ 216 */ 217 /** Block specified signal set. */ 218 #define SIG_BLOCK 1 219 /** Unblock specified signal set. */ 220 #define SIG_UNBLOCK 2 221 /** Set specified signal set. */ 222 #define SIG_SETMASK 3 223 #endif 224 225 226 227 /** @defgroup sys_signal_h_si_code siginfo_t.si_code values. 228 * @{ 229 */ 230 231 /** @defgroup sys_signal_h_si_code_sigill siginfo_t.si_code values - SIGILL 232 * @{ */ 233 /** Illegal opcode. */ 234 #define ILL_ILLOPC 0x80001001 235 /** Illegal operand. */ 236 #define ILL_ILLOPN 0x80001002 237 /** Illegal addressing mode. */ 238 #define ILL_ILLADR 0x80001003 239 /** Illegal trap. */ 240 #define ILL_ILLTRP 0x80001004 241 /** Privileged opcode. */ 242 #define ILL_PRVOPC 0x80001005 243 /** Privileged register. */ 244 #define ILL_PRVREG 0x80001006 245 /** Coprocessor error. */ 246 #define ILL_COPROC 0x80001007 247 /** Internal stack error. */ 248 #define ILL_BADSTK 0x80001008 249 /** @} */ 250 251 252 /** @defgroup sys_signal_h_si_code_sigfpe siginfo_t.si_code values - SIGILL 253 * @{ */ 254 /** see machine/trap.h. */ 255 /** @} */ 256 257 258 /** @defgroup sys_signal_h_si_code_sigsegv siginfo_t.si_code values - SIGSEGV 259 * @{ */ 260 /** Address not mapped to object. */ 261 #define SEGV_MAPERR 0x80003001 262 /** Invalid permissions for mapped object. */ 263 #define SEGV_ACCERR 0x80003002 264 /** @} */ 265 266 267 /** @defgroup sys_signal_h_si_code_sigbus siginfo_t.si_code values - SIGBUS 268 * @{ */ 269 /** Invalid address alignment. */ 270 #define BUS_ADRALN 0x80004001 271 /** Nonexistent physical address. */ 272 #define BUS_ADRERR 0x80004002 273 /** Object-specific hardware error. */ 274 #define BUS_OBJERR 0x80004003 275 /** @} */ 276 277 278 /** @defgroup sys_signal_h_si_code_sigtrap siginfo_t.si_code values - SIGTRAP 279 * @{ */ 280 /** Process breakpoint. */ 281 #define TRAP_BRKPT 0x80005001 282 /** Process trace trap. */ 283 #define TRAP_TRACE 0x80005002 284 /** @} */ 285 286 287 /** @defgroup sys_signal_h_si_code_sigchild siginfo_t.si_code values - SIGCHLD 288 * @{ */ 289 /** Child has exited. */ 290 #define CLD_EXITED 0x80006001 291 /** Child has terminated abnormally and did not create a core file. */ 292 #define CLD_KILLED 0x80006002 293 /** Child has terminated abnormally and created a core file. */ 294 #define CLD_DUMPED 0x80006003 295 /** Traced child has trapped. */ 296 #define CLD_TRAPPED 0x80006004 297 /** Child has stopped. */ 298 #define CLD_STOPPED 0x80006005 299 /** Stopped child has continued. */ 300 #define CLD_CONTINUED 0x80006006 301 /** @} */ 302 303 304 /** @defgroup sys_signal_h_si_code_sigpoll siginfo_t.si_code values - SIGPOLL 305 * @{ */ 306 /** Data input available. */ 307 #define POLL_IN 0x80007001 308 /** Output buffers available. */ 309 #define POLL_OUT 0x80007002 310 /** Input message available. */ 311 #define POLL_MSG 0x80007003 312 /** I/O error. */ 313 #define POLL_ERR 0x80007004 314 /** High priority input available. */ 315 #define POLL_PRI 0x80007005 316 /** Device disconnected. */ 317 #define POLL_HUP 0x80007006 318 /** @} */ 319 320 321 /** @defgroup sys_signal_h_siginfo_codes Signal Info Codes (si_code). 322 * @{ */ 323 #if __POSIX_VISIBLE || __XSI_VISIBLE 324 /** Sent by kill() or raise(). */ 325 #define SI_USER 0x00010001 326 /** Sent by sigqueue(). */ 327 #define SI_QUEUE 0x00010002 328 /** Sent cause a timer expired. */ 329 #define SI_TIMER 0x00010003 330 /** Sent upon AIO completion. */ 331 #define SI_ASYNCIO 0x00010004 332 /** Sent upon real time mesq state change. */ 333 #define SI_MESGQ 0x00010005 334 #endif 335 #if __BSD_VISIBLE 336 /** No idea. */ 337 #define SI_UNDEFINED 0x00000000 338 #endif 339 /** @} */ 340 341 /** @} */ 342 343 344 /******************************************************************************* 345 * Structures and Typedefs * 346 *******************************************************************************/ 347 #if __POSIX_VISIBLE || __XSI_VISIBLE 348 #ifndef _SIGSET_T_DECLARED 349 #define _SIGSET_T_DECLARED 350 /** Signal set. */ 351 typedef __sigset_t sigset_t; 352 #endif 353 #endif 354 355 356 #if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >= 500 357 /** Type for a value associated with a signal. */ 358 typedef union sigval 359 { 360 int sigval_int; 361 void *sigval_ptr; 362 } sigval_t; 363 #endif 364 365 366 #if __POSIX_VISIBLE >= 199309 367 /** Signal event. */ 368 typedef struct sigevent 369 { 370 /** Notification type. */ 371 int sigev_notify; 372 /** Signal number. */ 373 int sigev_signo; 374 /** Signal value. */ 375 union sigval sigev_value; 376 /** Thread Function. */ 377 void (*sigev_notify_function)(sigval_t); 378 /** Thread Attributes. */ 379 void *sigev_notify_attributes; 380 } sigevent_t; 381 #endif 382 383 384 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 199309 385 /** 386 * Signal info. 387 */ 388 typedef struct __siginfo 389 { 390 /** Signal number. */ 391 int si_signo; 392 /** Associated errno. */ 393 int si_errno; 394 /** Signal code. (See SI_* and FPE_* macros.) */ 395 int si_code; 396 /** Timestamp when the signal was generated - LIBC extension. */ 397 unsigned si_timestamp; 398 /** Process sending the signal. */ 399 __pid_t si_pid; 400 /** Thread sending the signal - LIBC extension. */ 401 unsigned si_tid; 402 /** User sending the signal (ruid). (Usually 0 for OS/2) */ 403 __uid_t si_uid; 404 /** Exit value. (SIGCHLD) */ 405 int si_status; 406 /** Pointer to the faulting instruction or memory reference. (SIGSEGV, SIGILL, SIGFPE, SIGBUS) */ 407 void *si_addr; 408 /** Signal value. */ 409 union sigval si_value; 410 /** Band event for SIGPOLL. */ 411 long si_band; 412 /** Filehandle for SIGPOLL. */ 413 int si_fd; 414 /** Reserve a little bit for future usage. */ 415 unsigned auReserved[4]; 416 } siginfo_t; 417 #endif 418 419 420 #if __POSIX_VISIBLE || __XSI_VISIBLE 421 struct __siginfo; 422 423 /** Signal action structure for sigaction(). */ 424 struct sigaction 425 { 426 /** Two handler prototypes, __sa_handler is the exposed one, 427 * while __sa_sigaction is the one used internally. The two extra 428 * arguments will not cause any trouble because of the nature of 429 * __cdecl on i386. 430 */ 431 union 432 { 433 /** New style handler. First arg is signal number, second is signal 434 * info, third is signal specific (I think). */ 435 void (*__sa_sigaction)(int, struct __siginfo *, void *); 436 /** Old style handler. First arg is signal number. */ 437 void (*__sa_handler)(int); 438 } __sigaction_u; 439 /** Signal mask to apply when executing the action. */ 440 sigset_t sa_mask; 441 /** Signal action flags. (See SA_* macros.) */ 442 int sa_flags; 443 }; 444 #define sa_handler __sigaction_u.__sa_handler 445 #endif 446 447 448 #if __BSD_VISIBLE 449 /** BSD 4.3 compatibility. 450 * This structure is identical to sigaction. 451 */ 452 struct sigvec 453 { 454 /** See sa_sigaction in struct sigaction. */ 455 void (*sv_handler)(int, struct __siginfo *, void *); 456 /** See sa_mask in struct sigaction. */ 457 int sv_mask; 458 /** See sa_flags in struct sigaction. */ 459 int sv_flags; 460 }; 461 #define sv_onstack sv_flags 462 #endif 463 464 465 #if __XSI_VISIBLE 466 /* 467 * Structure used in sigaltstack call. 468 */ 469 #if __BSD_VISIBLE 470 typedef struct sigaltstack 471 #else 472 typedef struct 473 #endif 474 { 475 /** Stack base pointer. */ 476 void *ss_sp; 477 /** Stack size. */ 478 __size_t ss_size; 479 /** Flags. (SS_DISABLE and/or SS_ONSTACK) */ 480 int ss_flags; 481 } stack_t; 482 #endif 483 484 485 #if __XSI_VISIBLE 486 /** Structure for sigstack(). obsolete. */ 487 struct sigstack 488 { 489 /** Pointer to stack base. */ 490 void *ss_sp; 491 /** On stack indicator. Non zero if executing on this stack. */ 492 int ss_onstack; 493 }; 494 #endif 495 496 497 /******************************************************************************* 498 * Functions * 499 *******************************************************************************/ 500 501 __BEGIN_DECLS 502 void (*signal(int, void (*)(int)))(int); 503 504 void (*bsd_signal(int, void (*)(int)))(int); 505 void (*_signal_sysv(int, void (*)(int)))(int); 506 void (*_signal_os2(int, void (*)(int)))(int); 507 508 /** @define __LIBC_SIGNAL_SYSV 509 * #define __LIBC_SIGNAL_SYSV to use System V style signal. */ 510 #ifdef __LIBC_SIGNAL_SYSV 511 static inline void (*signal (int iSignalNo, void (*pfnHandler)(int)))(int) 512 { return _signal_sysv(iSignalNo, pfnHandler); } 513 #endif 514 515 /** @define __LIBC_SIGNAL_OS2 516 * #define __LIBC_SIGNAL_OS2 to use System V style signal. */ 517 #ifdef __LIBC_SIGNAL_OS2 518 static inline void (*signal (int iSignalNo, void (*pfnHandler)(int)))(int) 519 { return _signal_os2(iSignalNo, pfnHandler); } 520 #endif 521 522 __END_DECLS 523 524 525 #if 0 /** @todo various emx stuff. */ 526 #define SIGPTRACENOTIFY 128 /* Notification from ptrace() */ 527 #define SIGTY void 528 #endif 529 530 #endif /* not _SYS_SIGNAL_H */ 531 532 533 #else /* !__NEW_SIGNALS__ */ 534 535 1 536 /* sys/signal.h (emx+gcc) */ 2 537 … … 121 656 122 657 #endif /* not _SYS_SIGNAL_H */ 658 659 660 #endif /* !__NEW_SIGNALS__ */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.