]> git.sur5r.net Git - openldap/blob - include/ac/signal.h
Merge latest devel codes into releng 2 branch.
[openldap] / include / ac / signal.h
1 /* Generic signal.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms are permitted only
8  * as authorized by the OpenLDAP Public License.  A copy of this
9  * license is available at http://www.OpenLDAP.org/license.html or
10  * in file LICENSE in the top-level directory of the distribution.
11  */
12
13 #ifndef _AC_SIGNAL_H
14 #define _AC_SIGNAL_H
15
16 #include <signal.h>
17
18 #undef SIGNAL
19 #ifdef HAVE_SIGSET
20 #define SIGNAL sigset
21 #else
22 #define SIGNAL signal
23 #endif
24
25 #if !defined( LDAP_SIGUSR1 ) || !defined( LDAP_SIGUSR2 )
26 #undef LDAP_SIGUSR1
27 #undef LDAP_SIGUSR2
28
29 #       if defined(WINNT) || defined(_WINNT) || defined(_WIN32)
30 #               define LDAP_SIGUSR1     SIGILL
31 #               define LDAP_SIGUSR2     SIGTERM
32
33 #       elif !defined(HAVE_LINUX_THREADS)
34 #               define LDAP_SIGUSR1     SIGUSR1
35 #               define LDAP_SIGUSR2     SIGUSR2
36
37 #       else
38                 /*
39                 LinuxThreads implemented unfortunately uses the only
40                 two signals reserved for user applications.  This forces
41                 OpenLDAP to use, hopefullly unused, signals reserved
42                 for other uses.
43                 */
44             
45 #               if defined( SIGSTKFLT )
46 #                       define LDAP_SIGUSR1     SIGSTKFLT
47 #               elif defined ( SIGSYS )
48 #                       define LDAP_SIGUSR1     SIGSYS
49 #               endif
50
51 #               if defined( SIGUNUSED )
52 #                       define LDAP_SIGUSR2     SIGUNUSED
53 #               elif defined ( SIGINFO )
54 #                       define LDAP_SIGUSR2     SIGINFO
55 #               elif defined ( SIGEMT )
56 #                       define LDAP_SIGUSR2     SIGEMT
57 #               endif
58 #       endif
59 #endif
60
61 #ifndef LDAP_SIGCHLD
62 #ifdef SIGCHLD
63 #define LDAP_SIGCHLD SIGCHLD
64 #elif SIGCLD
65 #define LDAP_SIGCHLD SIGCLD
66 #endif
67 #endif
68
69 #endif /* _AC_SIGNAL_H */