etc/services - sync with NetBSD-8
[minix.git] / bin / ksh / sigact.h
blobe1dce463da9d21407e5d0f6b52c133ae67f65eb5
1 /* $NetBSD: sigact.h,v 1.3 2002/05/25 23:29:17 wiz Exp $ */
3 /* NAME:
4 * sigact.h - sigaction et al
6 * SYNOPSIS:
7 * #include "sigact.h"
9 * DESCRIPTION:
10 * This header is the interface to a fake sigaction(2)
11 * implementation. It provides a POSIX compliant interface
12 * to whatever signal handling mechanisms are available.
13 * It also provides a Signal() function that is implemented
14 * in terms of sigaction().
15 * If not using signal(2) as part of the underlying
16 * implementation (USE_SIGNAL or USE_SIGMASK), and
17 * NO_SIGNAL is not defined, it also provides a signal()
18 * function that calls Signal().
20 * SEE ALSO:
21 * sigact.c
24 * RCSid:
25 * $NetBSD: sigact.h,v 1.3 2002/05/25 23:29:17 wiz Exp $
27 /* Changes to sigact.h for pdksh, Michael Rendell <michael@cs.mun.ca>:
28 * - changed SIG_HDLR to RETSIGTYPE for use with GNU autoconf
29 * - added RETSIGVAL
30 * - ifdef'd out ARGS(), volatile and const initializations
31 * - ifdef'd out sigset_t definition - let autoconf handle it
32 * - ifdef out routines not used in ksh if IS_KSH is defined
33 * (same in sigact.c).
35 #ifndef _SIGACT_H
36 #define _SIGACT_H
39 * most modern systems use void for signal handlers but
40 * not all.
42 #ifndef RETSIGTYPE
43 # define RETSIGTYPE void
44 # define RETSIGVAL
45 #endif
47 #if 0 /* ARGS(), volatile and const are already set up in config*.h -mhr */
48 #undef ARGS
49 #define ARGS(p) p
50 #endif
52 #ifndef IS_KSH
53 handler_t Signal ARGS((int sig, handler_t disp));
54 #endif /* IS_KSH */
57 * if you want to install this header as signal.h,
58 * modify this to pick up the original signal.h
60 #ifndef SIGKILL
61 # include <signal.h>
62 #endif
64 #ifndef SIG_ERR
65 # define SIG_ERR ((handler_t) -1)
66 #endif
67 #ifndef BADSIG
68 # define BADSIG SIG_ERR
69 #endif
71 #ifndef SA_NOCLDSTOP
72 /* we assume we need the fake sigaction */
73 /* sa_flags */
74 #define SA_NOCLDSTOP 1 /* don't send SIGCHLD on child stop */
75 #define SA_RESTART 2 /* re-start I/O */
77 /* sigprocmask flags */
78 #define SIG_BLOCK 1
79 #define SIG_UNBLOCK 2
80 #define SIG_SETMASK 4
82 #if 0 /* autoconf will define sigset_t if it isn't available */
84 * this is a bit untidy
86 #if !defined(__sys_stdtypes_h)
87 typedef unsigned int sigset_t;
88 #endif
89 #endif /* 0 */
92 * POSIX sa_handler should return void, but since we are
93 * implementing in terms of something else, it may
94 * be appropriate to use the normal RETSIGTYPE return type
96 struct sigaction
98 handler_t sa_handler;
99 sigset_t sa_mask;
100 int sa_flags;
104 int sigaction ARGS(( int sig, struct sigaction *act, struct sigaction *oact ));
105 int sigaddset ARGS(( sigset_t *mask, int sig ));
106 #ifndef IS_KSH
107 int sigdelset ARGS(( sigset_t *mask, int sig ));
108 #endif /* IS_KSH */
109 int sigemptyset ARGS(( sigset_t *mask ));
110 #ifndef IS_KSH
111 int sigfillset ARGS(( sigset_t *mask ));
112 int sigismember ARGS(( sigset_t *mask, int sig ));
113 int sigpending ARGS(( sigset_t *set ));
114 #endif /* IS_KSH */
115 int sigprocmask ARGS(( int how, sigset_t *set, sigset_t *oset ));
116 int sigsuspend ARGS(( sigset_t *mask ));
118 #ifndef sigmask
119 # define sigmask(s) (1<<((s)-1)) /* convert SIGnum to mask */
120 #endif
121 #if !defined(NSIG) && defined(_NSIG)
122 # define NSIG _NSIG
123 #endif
124 #endif /* ! SA_NOCLDSTOP */
125 #endif /* _SIGACT_H */