-/* $NetBSD: sigtypes.h,v 1.8 2005/12/11 12:25:21 christos Exp $ */\r
-\r
-/*\r
- * Copyright (c) 1982, 1986, 1989, 1991, 1993\r
- * The Regents of the University of California. All rights reserved.\r
- * (c) UNIX System Laboratories, Inc.\r
- * All or some portions of this file are derived from material licensed\r
- * to the University of California by American Telephone and Telegraph\r
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with\r
- * the permission of UNIX System Laboratories, Inc.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. Neither the name of the University nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * @(#)signal.h 8.4 (Berkeley) 5/4/95\r
- */\r
-\r
-#ifndef _SYS_SIGTYPES_H_\r
-#define _SYS_SIGTYPES_H_\r
-\r
-/*\r
- * This header file defines various signal-related types. We also keep\r
- * the macros to manipulate sigset_t here, to encapsulate knowledge of\r
- * its internals.\r
- */\r
-\r
-#include <sys/featuretest.h>\r
-#include <machine/int_types.h>\r
-#include <machine/ansi.h>\r
-\r
-#ifdef _EFI_SIZE_T_\r
- typedef _EFI_SIZE_T_ size_t;\r
- #undef _EFI_SIZE_T_\r
- #undef _BSD_SIZE_T_\r
-#endif\r
-\r
-#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \\r
- defined(_NETBSD_SOURCE)\r
-\r
-typedef struct {\r
- __uint32_t __bits[4];\r
-} sigset_t;\r
-\r
-/*\r
- * Macro for manipulating signal masks.\r
- */\r
-#define __sigmask(n) (1 << (((unsigned int)(n) - 1) & 31))\r
-#define __sigword(n) (((unsigned int)(n) - 1) >> 5)\r
-#define __sigaddset(s, n) ((s)->__bits[__sigword(n)] |= __sigmask(n))\r
-#define __sigdelset(s, n) ((s)->__bits[__sigword(n)] &= ~__sigmask(n))\r
-#define __sigismember(s, n) (((s)->__bits[__sigword(n)] & __sigmask(n)) != 0)\r
-#define __sigemptyset(s) ((s)->__bits[0] = 0x00000000, \\r
- (s)->__bits[1] = 0x00000000, \\r
- (s)->__bits[2] = 0x00000000, \\r
- (s)->__bits[3] = 0x00000000)\r
-#define __sigsetequal(s1,s2) ((s1)->__bits[0] == (s2)->__bits[0] && \\r
- (s1)->__bits[1] == (s2)->__bits[1] && \\r
- (s1)->__bits[2] == (s2)->__bits[2] && \\r
- (s1)->__bits[3] == (s2)->__bits[3])\r
-#define __sigfillset(s) ((s)->__bits[0] = 0xffffffff, \\r
- (s)->__bits[1] = 0xffffffff, \\r
- (s)->__bits[2] = 0xffffffff, \\r
- (s)->__bits[3] = 0xffffffff)\r
-#define __sigplusset(s, t) \\r
- do { \\r
- (t)->__bits[0] |= (s)->__bits[0]; \\r
- (t)->__bits[1] |= (s)->__bits[1]; \\r
- (t)->__bits[2] |= (s)->__bits[2]; \\r
- (t)->__bits[3] |= (s)->__bits[3]; \\r
- } while (/* CONSTCOND */ 0)\r
-#define __sigminusset(s, t) \\r
- do { \\r
- (t)->__bits[0] &= ~(s)->__bits[0]; \\r
- (t)->__bits[1] &= ~(s)->__bits[1]; \\r
- (t)->__bits[2] &= ~(s)->__bits[2]; \\r
- (t)->__bits[3] &= ~(s)->__bits[3]; \\r
- } while (/* CONSTCOND */ 0)\r
-#define __sigandset(s, t) \\r
- do { \\r
- (t)->__bits[0] &= (s)->__bits[0]; \\r
- (t)->__bits[1] &= (s)->__bits[1]; \\r
- (t)->__bits[2] &= (s)->__bits[2]; \\r
- (t)->__bits[3] &= (s)->__bits[3]; \\r
- } while (/* CONSTCOND */ 0)\r
-\r
-#if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \\r
- (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)\r
-typedef struct\r
-#if defined(_NETBSD_SOURCE)\r
- sigaltstack\r
-#endif /* _NETBSD_SOURCE */\r
- {\r
- void *ss_sp; /* signal stack base */\r
- size_t ss_size; /* signal stack length */\r
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */\r
-} stack_t;\r
-\r
-#endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */\r
-\r
-#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */\r
-\r
-#endif /* !_SYS_SIGTYPES_H_ */\r