source: trunk/essentials/sys-devel/m4/lib/sigprocmask.h

Last change on this file was 3090, checked in by bird, 18 years ago

m4 1.4.8

File size: 2.4 KB
Line 
1/* POSIX compatible signal blocking.
2 Copyright (C) 2006 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19#include <signal.h>
20
21#if ! HAVE_POSIX_SIGNALBLOCKING
22
23/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
24# include <sys/types.h>
25
26# include "verify.h"
27
28/* Maximum signal number + 1. */
29# ifndef NSIG
30# define NSIG 32
31# endif
32
33/* This code supports only 32 signals. */
34verify (NSIG <= 32);
35
36/* A set or mask of signals. */
37# if !HAVE_SIGSET_T
38typedef unsigned int sigset_t;
39# endif
40
41/* Test whether a given signal is contained in a signal set. */
42extern int sigismember (const sigset_t *set, int sig);
43
44/* Initialize a signal set to the empty set. */
45extern int sigemptyset (sigset_t *set);
46
47/* Add a signal to a signal set. */
48extern int sigaddset (sigset_t *set, int sig);
49
50/* Remove a signal from a signal set. */
51extern int sigdelset (sigset_t *set, int sig);
52
53/* Fill a signal set with all possible signals. */
54extern int sigfillset (sigset_t *set);
55
56/* Return the set of those blocked signals that are pending. */
57extern int sigpending (sigset_t *set);
58
59/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
60 Then, if SET is not NULL, affect the current set of blocked signals by
61 combining it with *SET as indicated in OPERATION.
62 In this implementation, you are not allowed to change a signal handler
63 while the signal is blocked. */
64# define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */
65# define SIG_SETMASK 1 /* blocked_set = *set; */
66# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */
67extern int sigprocmask (int operation, const sigset_t *set, sigset_t *old_set);
68
69#endif
Note: See TracBrowser for help on using the repository browser.