#define SIGNAL signal
#endif
+#if !defined( LDAP_SIGUSR1 ) || !defined( LDAP_SIGUSR2 )
+#undef LDAP_SIGUSR1
+#undef LDAP_SIGUSR2
+
+# ifndef 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.
+ */
+
+# if defined( SIGSTKFLT )
+# define LDAP_SIGUSR1 SIGSTKFLT
+# elif defined ( SIGSYS )
+# define LDAP_SIGUSR1 SIGSYS
+# endif
+
+# ifdef defined( SIGUNUSED )
+# define LDAP_SIGUSR2 SIGUNUSED
+# elif defined ( SIGINFO )
+# define LDAP_SIGUSR1 SIGINFO
+# elif defined ( SIGEMT )
+# define LDAP_SIGUSR1 SIGEMT
+# endif
+# endif
+#endif
+
#endif /* _AC_SIGNAL_H */
}
(void) SIGNAL( SIGPIPE, SIG_IGN );
-#ifdef HAVE_LINUX_THREADS
- /*
- * LinuxThreads are implemented using SIGUSR1/USR2,
- * so we'll use SIGSTKFLT and SIGUNUSED
- */
- (void) SIGNAL( SIGSTKFLT, do_nothing );
- (void) SIGNAL( SIGUNUSED, set_shutdown );
-#else /* !linux */
- (void) SIGNAL( SIGUSR1, do_nothing );
- (void) SIGNAL( SIGUSR2, set_shutdown );
-#endif /* !linux */
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
+ (void) SIGNAL( LDAP_SIGUSR2, set_shutdown );
(void) SIGNAL( SIGTERM, set_shutdown );
(void) SIGNAL( SIGINT, set_shutdown );
(void) SIGNAL( SIGHUP, set_shutdown );
{
Debug( LDAP_DEBUG_ANY, "slapd got shutdown signal %d\n", sig, 0, 0 );
slapd_shutdown = 1;
-#ifdef HAVE_LINUX_THREADS
- /*
- * LinuxThreads are implemented using SIGUSR1/USR2,
- * so we'll use SIGSTKFLT and SIGUNUSED
- */
- pthread_kill( listener_tid, SIGSTKFLT );
- (void) SIGNAL( SIGUNUSED, set_shutdown );
-#else /* !linux */
- pthread_kill( listener_tid, SIGUSR1 );
- (void) SIGNAL( SIGUSR2, set_shutdown );
-#endif /* !linux */
+ pthread_kill( listener_tid, LDAP_SIGUSR1 );
+ (void) SIGNAL( LDAP_SIGUSR2, set_shutdown );
(void) SIGNAL( SIGTERM, set_shutdown );
(void) SIGNAL( SIGINT, set_shutdown );
(void) SIGNAL( SIGHUP, set_shutdown );
do_nothing( int sig )
{
Debug( LDAP_DEBUG_TRACE, "slapd got do_nothing signal %d\n", sig, 0, 0 );
-#ifdef HAVE_LINUX_THREADS
- /*
- * LinuxThreads are implemented using SIGUSR1/USR2,
- * so we'll use SIGSTKFLT and SIGUNUSED
- */
- (void) SIGNAL( SIGSTKFLT, do_nothing );
-#else /* !linux */
- (void) SIGNAL( SIGUSR1, do_nothing );
-#endif /* !linux */
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
}
active_threads--;
conn->c_writewaiter = 1;
-#ifdef HAVE_LINUX_THREADS
- pthread_kill( listener_tid, SIGSTKFLT );
-#else /* !linux */
- pthread_kill( listener_tid, SIGUSR1 );
-#endif /* !linux */
+ pthread_kill( listener_tid, LDAP_SIGUSR1 );
pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
pthread_mutex_unlock( &active_threads_mutex );
pthread_mutex_lock( &active_threads_mutex );
active_threads--;
conn->c_writewaiter = 1;
- pthread_kill( listener_tid, SIGUSR1 );
+ pthread_kill( listener_tid, LDAP_SIGUSR1 );
pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
pthread_mutex_unlock( &active_threads_mutex );
do_admin( int sig )
{
sglob->rq->rq_dump( sglob->rq );
- (void) SIGNAL( SIGUSR2, do_admin );
+ (void) SIGNAL( LDAP_SIGUSR2, do_admin );
}
* SIG(UNUSED|USR2) - causes slurpd to read its administrative interface file.
* (not yet implemented).
*/
-#ifdef HAVE_LINUX_THREADS
- (void) SIGNAL( SIGSTKFLT, do_nothing );
- (void) SIGNAL( SIGUNUSED, do_admin );
-#else
- (void) SIGNAL( SIGUSR1, do_nothing );
- (void) SIGNAL( SIGUSR2, do_admin );
-#endif
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
+ (void) SIGNAL( LDAP_SIGUSR2, do_admin );
(void) SIGNAL( SIGTERM, set_shutdown );
(void) SIGNAL( SIGINT, set_shutdown );
(void) SIGNAL( SIGHUP, set_shutdown );
int i;
sglob->slurpd_shutdown = 1; /* set flag */
-#ifdef HAVE_LINUX_THREADS
- pthread_kill( sglob->fm_tid, SIGSTKFLT ); /* wake up file mgr */
-#else
- pthread_kill( sglob->fm_tid, SIGUSR1 ); /* wake up file mgr */
-#endif
+ pthread_kill( sglob->fm_tid, LDAP_SIGUSR1 ); /* wake up file mgr */
sglob->rq->rq_lock( sglob->rq ); /* lock queue */
pthread_cond_broadcast( &(sglob->rq->rq_more) ); /* wake repl threads */
for ( i = 0; i < sglob->num_replicas; i++ ) {
RETSIGTYPE
do_nothing(int i)
{
-#ifdef HAVE_LINUX_THREADS
- (void) SIGNAL( SIGSTKFLT, do_nothing );
-#else
- (void) SIGNAL( SIGUSR1, do_nothing );
-#endif
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
}
int rc ;
char *errmsg;
-#ifdef HAVE_LINUX_THREADS
- (void) SIGNAL( SIGSTKFLT, do_nothing );
-#else
- (void) SIGNAL( SIGUSR1, do_nothing );
-#endif
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
(void) SIGNAL( SIGPIPE, SIG_IGN );
if ( ri == NULL ) {
Debug( LDAP_DEBUG_ANY, "Error: Ri_process: ri == NULL!\n", 0, 0, 0 );
if ( ri == NULL ) {
return;
}
-#ifdef HAVE_LINUX_THREADS
- pthread_kill( ri->ri_tid, SIGSTKFLT );
- (void) SIGNAL( SIGSTKFLT, do_nothing );
-#else
- pthread_kill( ri->ri_tid, SIGUSR1 );
- (void) SIGNAL( SIGUSR1, do_nothing );
-#endif
+ pthread_kill( ri->ri_tid, LDAP_SIGUSR1 );
+ (void) SIGNAL( LDAP_SIGUSR1, do_nothing );
}