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