X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fac%2Fsignal.h;h=65b8ea683bb578820048353891f1cc4868b0f502;hb=2b1b64f02197157543decc0c1862c566341c3e10;hp=b850e75894fafebf800c016650b65f0c1418de4e;hpb=0e2a772173b934134001f051a662765e78c3886a;p=openldap diff --git a/include/ac/signal.h b/include/ac/signal.h index b850e75894..65b8ea683b 100644 --- a/include/ac/signal.h +++ b/include/ac/signal.h @@ -1,32 +1,58 @@ /* Generic signal.h */ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2012 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ #ifndef _AC_SIGNAL_H #define _AC_SIGNAL_H #include -#ifdef HAVE_SIGSET +#undef SIGNAL + +#if defined( HAVE_SIGACTION ) +#define SIGNAL lutil_sigaction +typedef void (*lutil_sig_t)(int); +LDAP_LUTIL_F(lutil_sig_t) lutil_sigaction( int sig, lutil_sig_t func ); +#define SIGNAL_REINSTALL(sig,act) (void)0 +#elif defined( HAVE_SIGSET ) #define SIGNAL sigset +#define SIGNAL_REINSTALL sigset #else #define SIGNAL signal +#define SIGNAL_REINSTALL signal #endif #if !defined( LDAP_SIGUSR1 ) || !defined( LDAP_SIGUSR2 ) #undef LDAP_SIGUSR1 #undef LDAP_SIGUSR2 -# ifndef HAVE_LINUX_THREADS +# if defined(WINNT) || defined(_WINNT) || defined(_WIN32) +# define LDAP_SIGUSR1 SIGILL +# define LDAP_SIGUSR2 SIGTERM + +# elif !defined(HAVE_LINUX_THREADS) # define LDAP_SIGUSR1 SIGUSR1 # define LDAP_SIGUSR2 SIGUSR2 # else /* - LinuxThreads implemented unfortunately uses the only - two signals reserved for user applications. This forces - OpenLDAP to use, hopefullly unused, signals reserved - for other uses. - */ - + * Some versions of LinuxThreads unfortunately uses the only + * two signals reserved for user applications. This forces + * OpenLDAP to use other signals reserved for other uses. + */ + # if defined( SIGSTKFLT ) # define LDAP_SIGUSR1 SIGSTKFLT # elif defined ( SIGSYS ) @@ -43,4 +69,12 @@ # endif #endif +#ifndef LDAP_SIGCHLD +#ifdef SIGCHLD +#define LDAP_SIGCHLD SIGCHLD +#elif SIGCLD +#define LDAP_SIGCHLD SIGCLD +#endif +#endif + #endif /* _AC_SIGNAL_H */