2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef AFS_PTHREAD_NOSIGS_H
11 #define AFS_PTHREAD_NOSIGS_H
13 /* We want servers to only handle signals in the main thread. To do this
14 * we must block signals in the child threads. To do this, wrap pthread_create
19 /* Compilers complain about empty declaration unless at end of decl's */
20 #define AFS_SIGSET_DECL int i_junk
21 #define AFS_SIGSET_CLEAR()
22 #define AFS_SIGSET_RESTORE()
24 #define AFS_SIGSET_DECL sigset_t i_tset, i_oset
26 #define AFS_SET_SIGMASK sigthreadmask
28 #define AFS_SET_SIGMASK pthread_sigmask
30 #define AFS_SIGSET_CLEAR() \
32 sigfillset(&i_tset); \
33 assert(AFS_SET_SIGMASK(SIG_BLOCK, &i_tset, &i_oset) == 0); \
36 #define AFS_SIGSET_RESTORE() \
38 assert(AFS_SET_SIGMASK(SIG_SETMASK, &i_oset, NULL) == 0); \
40 #endif /* AFS_NT40_ENV */
42 #endif /* AFS_PTHREAD_NOSIGS_H */