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