Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | /**************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | * Copyright 2020 Thomas E. Dickey * |
| 3 | * Copyright 1998-2003,2005 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 4 | * * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 | * copy of this software and associated documentation files (the * |
| 7 | * "Software"), to deal in the Software without restriction, including * |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 9 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 10 | * copies of the Software, and to permit persons to whom the Software is * |
| 11 | * furnished to do so, subject to the following conditions: * |
| 12 | * * |
| 13 | * The above copyright notice and this permission notice shall be included * |
| 14 | * in all copies or substantial portions of the Software. * |
| 15 | * * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 | * * |
| 24 | * Except as contained in this notice, the name(s) of the above copyright * |
| 25 | * holders shall not be used in advertising or otherwise to promote the * |
| 26 | * sale, use or other dealings in this Software without prior written * |
| 27 | * authorization. * |
| 28 | ****************************************************************************/ |
| 29 | |
| 30 | /**************************************************************************** |
| 31 | * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * |
| 32 | * and: Eric S. Raymond <esr@snark.thyrsus.com> * |
| 33 | ****************************************************************************/ |
| 34 | |
| 35 | /* |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 36 | * $Id: SigAction.h,v 1.10 2020/02/02 23:34:34 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 37 | * |
| 38 | * This file exists to handle non-POSIX systems which don't have <unistd.h>, |
| 39 | * and usually no sigaction() nor <termios.h> |
| 40 | */ |
| 41 | |
| 42 | #ifndef _SIGACTION_H |
| 43 | #define _SIGACTION_H |
| 44 | |
| 45 | #ifndef HAVE_SIGACTION |
| 46 | #define HAVE_SIGACTION 0 |
| 47 | #endif |
| 48 | |
| 49 | #ifndef HAVE_SIGVEC |
| 50 | #define HAVE_SIGVEC 0 |
| 51 | #endif |
| 52 | |
| 53 | #if HAVE_SIGACTION |
| 54 | |
| 55 | #if !HAVE_TYPE_SIGACTION |
| 56 | typedef struct sigaction sigaction_t; |
| 57 | #endif |
| 58 | |
| 59 | #else /* !HAVE_SIGACTION */ |
| 60 | |
| 61 | #if HAVE_SIGVEC |
| 62 | |
| 63 | #undef SIG_BLOCK |
| 64 | #define SIG_BLOCK 00 |
| 65 | |
| 66 | #undef SIG_UNBLOCK |
| 67 | #define SIG_UNBLOCK 01 |
| 68 | |
| 69 | #undef SIG_SETMASK |
| 70 | #define SIG_SETMASK 02 |
| 71 | |
| 72 | /* |
| 73 | * <bsd/signal.h> is in the Linux 1.2.8 + gcc 2.7.0 configuration, |
| 74 | * and is useful for testing this header file. |
| 75 | */ |
| 76 | #if HAVE_BSD_SIGNAL_H |
| 77 | #include <bsd/signal.h> |
| 78 | #endif |
| 79 | |
| 80 | typedef struct sigvec sigaction_t; |
| 81 | |
| 82 | #define sigset_t _nc_sigset_t |
| 83 | typedef unsigned long sigset_t; |
| 84 | |
| 85 | #undef sa_mask |
| 86 | #define sa_mask sv_mask |
| 87 | #undef sa_handler |
| 88 | #define sa_handler sv_handler |
| 89 | #undef sa_flags |
| 90 | #define sa_flags sv_flags |
| 91 | |
| 92 | #undef sigaction |
| 93 | #define sigaction _nc_sigaction |
| 94 | #undef sigprocmask |
| 95 | #define sigprocmask _nc_sigprocmask |
| 96 | #undef sigemptyset |
| 97 | #define sigemptyset _nc_sigemptyset |
| 98 | #undef sigsuspend |
| 99 | #define sigsuspend _nc_sigsuspend |
| 100 | #undef sigdelset |
| 101 | #define sigdelset _nc_sigdelset |
| 102 | #undef sigaddset |
| 103 | #define sigaddset _nc_sigaddset |
| 104 | |
| 105 | /* tty/lib_tstp.c is the only user */ |
| 106 | #include <base/sigaction.c> |
| 107 | |
| 108 | #endif /* HAVE_SIGVEC */ |
| 109 | #endif /* HAVE_SIGACTION */ |
| 110 | #endif /* !defined(_SIGACTION_H) */ |