Back to index

openldap  2.4.31
signal.h
Go to the documentation of this file.
00001 /* Generic signal.h */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #ifndef _AC_SIGNAL_H
00018 #define _AC_SIGNAL_H
00019 
00020 #include <signal.h>
00021 
00022 #undef SIGNAL
00023 
00024 #if defined( HAVE_SIGACTION )
00025 #define SIGNAL lutil_sigaction
00026 typedef void (*lutil_sig_t)(int);
00027 LDAP_LUTIL_F(lutil_sig_t) lutil_sigaction( int sig, lutil_sig_t func );
00028 #define SIGNAL_REINSTALL(sig,act)  (void)0
00029 #elif defined( HAVE_SIGSET )
00030 #define SIGNAL sigset
00031 #define SIGNAL_REINSTALL sigset
00032 #else
00033 #define SIGNAL signal
00034 #define SIGNAL_REINSTALL signal
00035 #endif
00036 
00037 #if !defined( LDAP_SIGUSR1 ) || !defined( LDAP_SIGUSR2 )
00038 #undef LDAP_SIGUSR1
00039 #undef LDAP_SIGUSR2
00040 
00041 #      if defined(WINNT) || defined(_WINNT) || defined(_WIN32)
00042 #             define LDAP_SIGUSR1  SIGILL
00043 #             define LDAP_SIGUSR2  SIGTERM
00044 
00045 #      elif !defined(HAVE_LINUX_THREADS)
00046 #             define LDAP_SIGUSR1  SIGUSR1
00047 #             define LDAP_SIGUSR2  SIGUSR2
00048 
00049 #      else
00050               /*
00051                * Some versions of LinuxThreads unfortunately uses the only
00052                * two signals reserved for user applications.  This forces
00053                * OpenLDAP to use other signals reserved for other uses.
00054                */
00055 
00056 #             if defined( SIGSTKFLT )
00057 #                    define LDAP_SIGUSR1  SIGSTKFLT
00058 #             elif defined ( SIGSYS )
00059 #                    define LDAP_SIGUSR1  SIGSYS
00060 #             endif
00061 
00062 #             if defined( SIGUNUSED )
00063 #                    define LDAP_SIGUSR2  SIGUNUSED
00064 #             elif defined ( SIGINFO )
00065 #                    define LDAP_SIGUSR2  SIGINFO
00066 #             elif defined ( SIGEMT )
00067 #                    define LDAP_SIGUSR2  SIGEMT
00068 #             endif
00069 #      endif
00070 #endif
00071 
00072 #ifndef LDAP_SIGCHLD
00073 #ifdef SIGCHLD
00074 #define LDAP_SIGCHLD SIGCHLD
00075 #elif SIGCLD
00076 #define LDAP_SIGCHLD SIGCLD
00077 #endif
00078 #endif
00079 
00080 #endif /* _AC_SIGNAL_H */