3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
13 #include <ac/signal.h>
14 #include <ac/socket.h>
15 #include <ac/string.h>
17 #include <ac/unistd.h>
26 int allow_severity = LOG_INFO;
27 int deny_severity = LOG_NOTICE;
28 #endif /* TCP Wrappers */
32 ber_socket_t dtblsize;
34 typedef struct slap_listener {
41 struct sockaddr_in sl_addr;
44 Listener **slap_listeners = NULL;
46 static ber_socket_t wake_sds[2];
50 #define WAKE_LISTENER(w) \
51 ((w && !waking) ? tcp_write( wake_sds[1], "0", 1 ), waking=1 : 0)
53 #define WAKE_LISTENER(w) \
54 do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
57 #ifdef HAVE_NT_SERVICE_MANAGER
59 extern ldap_pvt_thread_cond_t started_event;
65 volatile sig_atomic_t slapd_shutdown = 0;
67 static ldap_pvt_thread_t listener_tid;
69 static struct slap_daemon {
70 ldap_pvt_thread_mutex_t sd_mutex;
75 /* In winsock, accept() returns values higher than dtblsize
76 so don't bother with this optimization */
86 * Add a descriptor to daemon control
88 static void slapd_add(ber_socket_t s) {
89 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
91 assert( !FD_ISSET( s, &slap_daemon.sd_actives ));
92 assert( !FD_ISSET( s, &slap_daemon.sd_readers ));
93 assert( !FD_ISSET( s, &slap_daemon.sd_writers ));
96 if (s >= slap_daemon.sd_nfds) {
97 slap_daemon.sd_nfds = s + 1;
101 FD_SET( s, &slap_daemon.sd_actives );
102 FD_SET( s, &slap_daemon.sd_readers );
104 Debug( LDAP_DEBUG_CONNS, "daemon: added %ld%s%s\n",
106 FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
107 FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
109 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
113 * Remove the descriptor from daemon control
115 void slapd_remove(ber_socket_t s, int wake) {
116 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
118 Debug( LDAP_DEBUG_CONNS, "daemon: removing %ld%s%s\n",
120 FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
121 FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
123 FD_CLR( s, &slap_daemon.sd_actives );
124 FD_CLR( s, &slap_daemon.sd_readers );
125 FD_CLR( s, &slap_daemon.sd_writers );
127 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
131 void slapd_clr_write(ber_socket_t s, int wake) {
132 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
134 assert( FD_ISSET( s, &slap_daemon.sd_actives) );
135 FD_CLR( s, &slap_daemon.sd_writers );
137 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
141 void slapd_set_write(ber_socket_t s, int wake) {
142 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
144 assert( FD_ISSET( s, &slap_daemon.sd_actives) );
145 if (!FD_ISSET(s, &slap_daemon.sd_writers))
146 FD_SET( (unsigned) s, &slap_daemon.sd_writers );
148 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
152 void slapd_clr_read(ber_socket_t s, int wake) {
153 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
155 assert( FD_ISSET( s, &slap_daemon.sd_actives) );
156 FD_CLR( s, &slap_daemon.sd_readers );
158 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
162 void slapd_set_read(ber_socket_t s, int wake) {
163 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
165 assert( FD_ISSET( s, &slap_daemon.sd_actives) );
166 if (!FD_ISSET(s, &slap_daemon.sd_readers))
167 FD_SET( s, &slap_daemon.sd_readers );
169 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
173 static void slapd_close(ber_socket_t s) {
174 Debug( LDAP_DEBUG_CONNS, "daemon: closing %ld\n",
180 static Listener * open_listener( const char* url )
189 rc = ldap_url_parse( url, &lud );
191 if( rc != LDAP_URL_SUCCESS ) {
192 Debug( LDAP_DEBUG_ANY,
193 "daemon: listen URL \"%s\" parse error=%d\n",
199 if( lud->lud_ldaps ) {
200 Debug( LDAP_DEBUG_ANY,
201 "daemon: TLS not supported (%s)\n",
203 ldap_free_urldesc( lud );
207 if(! lud->lud_port ) {
208 lud->lud_port = LDAP_PORT;
212 l.sl_is_tls = lud->lud_ldaps;
214 if(! lud->lud_port ) {
215 lud->lud_port = lud->lud_ldaps ? LDAPS_PORT : LDAP_PORT;
219 port = lud->lud_port;
221 (void) memset( (void*) &l.sl_addr, '\0', sizeof(l.sl_addr) );
223 l.sl_addr.sin_family = AF_INET;
224 l.sl_addr.sin_port = htons( (unsigned short) lud->lud_port );
226 if( lud->lud_host == NULL || lud->lud_host[0] == '\0'
227 || strcmp(lud->lud_host, "*") == 0 )
229 l.sl_addr.sin_addr.s_addr = htonl(INADDR_ANY);
232 /* host or address was specified */
233 if( !inet_aton( lud->lud_host, &l.sl_addr.sin_addr ) ) {
234 struct hostent *he = gethostbyname( lud->lud_host );
236 Debug( LDAP_DEBUG_ANY, "invalid host (%s) in URL: %s",
237 lud->lud_host, url, 0);
238 ldap_free_urldesc( lud );
242 memcpy( &l.sl_addr.sin_addr, he->h_addr,
243 sizeof( l.sl_addr.sin_addr ) );
247 ldap_free_urldesc( lud );
250 if ( (l.sl_sd = socket( AF_INET, SOCK_STREAM, 0 )) == AC_SOCKET_INVALID ) {
251 int err = sock_errno();
252 Debug( LDAP_DEBUG_ANY,
253 "daemon: socket() failed errno=%d (%s)\n", err,
254 sock_errstr(err), 0 );
259 if ( l.sl_sd >= dtblsize ) {
260 Debug( LDAP_DEBUG_ANY,
261 "daemon: listener descriptor %ld is too great %ld\n",
262 (long) l.sl_sd, (long) dtblsize, 0 );
263 tcp_close( l.sl_sd );
269 /* enable address reuse */
271 rc = setsockopt( l.sl_sd, SOL_SOCKET, SO_REUSEADDR,
272 (char *) &tmp, sizeof(tmp) );
273 if ( rc == AC_SOCKET_ERROR ) {
274 int err = sock_errno();
275 Debug( LDAP_DEBUG_ANY,
276 "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n",
277 (long) l.sl_sd, err, sock_errstr(err) );
281 /* enable keep alives */
283 rc = setsockopt( l.sl_sd, SOL_SOCKET, SO_KEEPALIVE,
284 (char *) &tmp, sizeof(tmp) );
285 if ( rc == AC_SOCKET_ERROR ) {
286 int err = sock_errno();
287 Debug( LDAP_DEBUG_ANY,
288 "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno=%d (%s)\n",
289 (long) l.sl_sd, err, sock_errstr(err) );
293 /* enable no delay */
295 rc = setsockopt( l.sl_sd, IPPROTO_TCP, TCP_NODELAY,
296 (char *)&tmp, sizeof(tmp) );
297 if ( rc == AC_SOCKET_ERROR ) {
298 int err = sock_errno();
299 Debug( LDAP_DEBUG_ANY,
300 "slapd(%ld): setsockopt(TCP_NODELAY) failed errno=%d (%s)\n",
301 (long) l.sl_sd, err, sock_errstr(err) );
305 rc = bind( l.sl_sd, (struct sockaddr *) &l.sl_addr, sizeof(l.sl_addr) );
306 if ( rc == AC_SOCKET_ERROR ) {
307 int err = sock_errno();
308 Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n",
309 (long) l.sl_sd, err, sock_errstr(err) );
310 tcp_close( l.sl_sd );
314 l.sl_url = ch_strdup( url );
316 l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65336") );
317 s = inet_ntoa( l.sl_addr.sin_addr );
318 sprintf( l.sl_name, "IP=%s:%d",
319 s != NULL ? s : "unknown" , port );
321 li = ch_malloc( sizeof( Listener ) );
324 Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n",
330 static int sockinit(void);
331 static int sockdestroy(void);
333 int slapd_daemon_init( char *urls )
338 Debug( LDAP_DEBUG_ARGS, "daemon_init: %s\n",
339 urls ? urls : "<null>", 0, 0 );
341 if( (rc = sockinit()) != 0 ) {
346 dtblsize = sysconf( _SC_OPEN_MAX );
347 #elif HAVE_GETDTABLESIZE
348 dtblsize = getdtablesize();
350 dtblsize = FD_SETSIZE;
354 if(dtblsize > FD_SETSIZE) {
355 dtblsize = FD_SETSIZE;
357 #endif /* !FD_SETSIZE */
359 /* open a pipe (or something equivalent connected to itself).
360 * we write a byte on this fd whenever we catch a signal. The main
361 * loop will be select'ing on this socket, and will wake up when
364 if( (rc = lutil_pair( wake_sds )) < 0 ) {
365 Debug( LDAP_DEBUG_ANY,
366 "daemon: lutil_pair() failed rc=%d\n", rc, 0, 0 );
370 FD_ZERO( &slap_daemon.sd_readers );
371 FD_ZERO( &slap_daemon.sd_writers );
377 u = str2charray( urls, " " );
379 if( u == NULL || u[0] == NULL ) {
380 Debug( LDAP_DEBUG_ANY, "daemon_init: no urls (%s) provided.\n",
386 for( i=0; u[i] != NULL; i++ ) {
387 Debug( LDAP_DEBUG_TRACE, "daemon_init: listen on %s\n",
392 Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n",
398 Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners to open...\n",
401 slap_listeners = ch_malloc( (i+1)*sizeof(Listener *) );
403 for(i = 0; u[i] != NULL; i++ ) {
404 slap_listeners[i] = open_listener( u[i] );
406 if( slap_listeners[i] == NULL ) {
411 slap_listeners[i] = NULL;
413 Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n",
417 ldap_pvt_thread_mutex_init( &slap_daemon.sd_mutex );
423 slapd_daemon_destroy(void)
425 connections_destroy();
426 tcp_close( wake_sds[1] );
427 tcp_close( wake_sds[0] );
439 time_t last_idle_check = slap_get_time();
442 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
443 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
446 if ( listen( slap_listeners[l]->sl_sd, 5 ) == -1 ) {
447 int err = sock_errno();
448 Debug( LDAP_DEBUG_ANY,
449 "daemon: listen(%s, 5) failed errno=%d (%s)\n",
450 slap_listeners[l]->sl_url, err,
455 slapd_add( slap_listeners[l]->sl_sd );
458 #ifdef HAVE_NT_SERVICE_MANAGER
459 if ( started_event != NULL ) {
460 ldap_pvt_thread_cond_signal( &started_event );
463 /* initialization complete. Here comes the loop. */
465 while ( !slapd_shutdown ) {
470 #define SLAPD_EBADF_LIMIT 10
473 #define SLAPD_IDLE_CHECK_LIMIT 4
474 time_t now = slap_get_time();
480 struct sockaddr_in from;
481 #if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
487 if( global_idletimeout > 0 && difftime(
488 last_idle_check+global_idletimeout/SLAPD_IDLE_CHECK_LIMIT,
491 connections_timeout_idle(now);
494 FD_ZERO( &writefds );
500 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
502 #ifdef FD_SET_MANUAL_COPY
503 for( s = 0; s < nfds; s++ ) {
504 if(FD_ISSET( &slap_sd_readers, s )) {
505 FD_SET( s, &readfds );
507 if(FD_ISSET( &slap_sd_writers, s )) {
508 FD_SET( s, &writefds );
512 memcpy( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) );
513 memcpy( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) );
515 assert(!FD_ISSET(wake_sds[0], &readfds));
516 FD_SET( wake_sds[0], &readfds );
518 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
519 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
521 if (!FD_ISSET(slap_listeners[l]->sl_sd, &readfds))
522 FD_SET( slap_listeners[l]->sl_sd, &readfds );
526 nfds = slap_daemon.sd_nfds;
531 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
533 ldap_pvt_thread_mutex_lock( &active_threads_mutex );
535 ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
537 #if defined( HAVE_YIELDING_SELECT ) || defined( NO_THREADS )
540 tvp = at ? &zero : NULL;
543 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
544 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
547 Debug( LDAP_DEBUG_CONNS,
548 "daemon: select: listen=%d active_threads=%d tvp=%s\n",
549 slap_listeners[l]->sl_sd, at,
550 tvp == NULL ? "NULL" : "zero" );
553 switch(ns = select( nfds, &readfds,
555 /* don't pass empty fd_set */
556 ( writefds.fd_count > 0 ? &writefds : NULL ),
562 case -1: { /* failure - try again */
563 int err = sock_errno();
567 || err == WSAENOTSOCK /* you'd think this would be EBADF */
570 if (++ebadf < SLAPD_EBADF_LIMIT)
575 Debug( LDAP_DEBUG_CONNS,
576 "daemon: select failed (%d): %s\n",
577 err, sock_errstr(err), 0 );
584 case 0: /* timeout - let threads run */
586 Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n",
588 ldap_pvt_thread_yield();
591 default: /* something happened - deal with it */
593 Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n",
598 if( FD_ISSET( wake_sds[0], &readfds ) ) {
600 tcp_read( wake_sds[0], c, sizeof(c) );
607 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
609 socklen_t len = sizeof(from);
615 char peername[sizeof("IP=255.255.255.255:65336")];
617 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
620 if ( !FD_ISSET( slap_listeners[l]->sl_sd, &readfds ) )
623 if ( (s = accept( slap_listeners[l]->sl_sd,
624 (struct sockaddr *) &from, &len )) == AC_SOCKET_INVALID )
626 int err = sock_errno();
627 Debug( LDAP_DEBUG_ANY,
628 "daemon: accept(%ld) failed errno=%d (%s)\n",
629 (long) slap_listeners[l]->sl_sd, err,
635 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
637 /* newly accepted stream should not be in any of the FD SETS */
639 assert( !FD_ISSET( s, &slap_daemon.sd_actives) );
640 assert( !FD_ISSET( s, &slap_daemon.sd_readers) );
641 assert( !FD_ISSET( s, &slap_daemon.sd_writers) );
643 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
647 /* make sure descriptor number isn't too great */
648 if ( s >= dtblsize ) {
649 Debug( LDAP_DEBUG_ANY,
650 "daemon: %ld beyond descriptor table size %ld\n",
651 (long) s, (long) dtblsize, 0 );
657 Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n",
662 if ( getpeername( s, (struct sockaddr *) &from, &len ) != 0 ) {
663 int err = sock_errno();
664 Debug( LDAP_DEBUG_ANY,
665 "daemon: getpeername( %ld ) failed: errno=%d (%s)\n",
666 (long) s, err, sock_errstr(err) );
671 peeraddr = inet_ntoa( from.sin_addr );
672 sprintf( peername, "IP=%s:%d",
673 peeraddr != NULL ? peeraddr : "unknown",
674 (unsigned) ntohs( from.sin_port ) );
676 #if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
677 hp = gethostbyaddr( (char *)
679 sizeof(from.sin_addr), AF_INET );
682 dnsname = ldap_pvt_str2lower( hp->h_name );
692 if( !hosts_ctl("slapd",
693 dnsname != NULL ? dnsname : STRING_UNKNOWN,
694 peeraddr != NULL ? peeraddr : STRING_UNKNOWN,
698 Statslog( LDAP_DEBUG_ANY,
699 "fd=%ld connection from %s (%s) denied.\n",
701 dnsname != NULL ? dnsname : "unknown",
702 peeraddr != NULL ? peeraddr : "unknown",
708 #endif /* HAVE_TCPD */
710 if( (id = connection_init(s,
711 slap_listeners[l]->sl_url,
712 dnsname != NULL ? dnsname : "unknown",
714 slap_listeners[l]->sl_name,
716 slap_listeners[l]->sl_is_tls
722 Debug( LDAP_DEBUG_ANY,
723 "daemon: connection_init(%ld, %s, %s) failed.\n",
726 slap_listeners[l]->sl_name );
731 Statslog( LDAP_DEBUG_STATS,
732 "daemon: conn=%ld fd=%ld connection from %s (%s) accepted.\n",
735 slap_listeners[l]->sl_name,
743 Debug( LDAP_DEBUG_CONNS, "daemon: activity on:", 0, 0, 0 );
745 for ( i = 0; i < readfds.fd_count; i++ ) {
746 Debug( LDAP_DEBUG_CONNS, " %d%s",
747 readfds.fd_array[i], "r", 0 );
749 for ( i = 0; i < writefds.fd_count; i++ ) {
750 Debug( LDAP_DEBUG_CONNS, " %d%s",
751 writefds.fd_array[i], "w", 0 );
754 for ( i = 0; i < nfds; i++ ) {
758 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
759 if ( i == slap_listeners[l]->sl_sd ) {
767 r = FD_ISSET( i, &readfds );
768 w = FD_ISSET( i, &writefds );
770 Debug( LDAP_DEBUG_CONNS, " %d%s%s", i,
771 r ? "r" : "", w ? "w" : "" );
775 Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
778 /* loop through the writers */
780 for ( i = 0; i < writefds.fd_count; i++ )
782 for ( i = 0; i < nfds; i++ )
788 wd = writefds.fd_array[i];
790 if( ! FD_ISSET( i, &writefds ) ) {
796 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
797 if ( i == slap_listeners[l]->sl_sd ) {
805 Debug( LDAP_DEBUG_CONNS,
806 "daemon: write active on %d\n",
810 * NOTE: it is possible that the connection was closed
811 * and that the stream is now inactive.
812 * connection_write() must valid the stream is still
816 if ( connection_write( wd ) < 0 ) {
817 FD_CLR( (unsigned) wd, &readfds );
823 for ( i = 0; i < readfds.fd_count; i++ )
825 for ( i = 0; i < nfds; i++ )
832 rd = readfds.fd_array[i];
834 if( ! FD_ISSET( i, &readfds ) ) {
840 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
841 if ( rd == slap_listeners[l]->sl_sd ) {
850 Debug ( LDAP_DEBUG_CONNS,
851 "daemon: read activity on %d\n", rd, 0, 0 );
854 * NOTE: it is possible that the connection was closed
855 * and that the stream is now inactive.
856 * connection_read() must valid the stream is still
860 if ( connection_read( rd ) < 0 ) {
864 ldap_pvt_thread_yield();
867 if( slapd_shutdown > 0 ) {
868 Debug( LDAP_DEBUG_TRACE,
869 "daemon: shutdown requested and initiated.\n",
872 } else if ( slapd_shutdown < 0 ) {
873 Debug( LDAP_DEBUG_TRACE,
874 "daemon: abnormal condition, shutdown initiated.\n",
877 Debug( LDAP_DEBUG_TRACE,
878 "daemon: no active streams, shutdown initiated.\n",
882 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
883 if ( slap_listeners[l]->sl_sd != AC_SOCKET_INVALID ) {
884 slapd_close( slap_listeners[l]->sl_sd );
889 ldap_pvt_thread_mutex_lock( &active_threads_mutex );
890 Debug( LDAP_DEBUG_ANY,
891 "slapd shutdown: waiting for %d threads to terminate\n",
892 active_threads, 0, 0 );
893 while ( active_threads > 0 ) {
894 ldap_pvt_thread_cond_wait(&active_threads_cond, &active_threads_mutex);
896 ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
902 int slapd_daemon( void )
908 #define SLAPD_LISTENER_THREAD 1
909 #if defined( SLAPD_LISTENER_THREAD ) || !defined(HAVE_PTHREADS)
911 /* listener as a separate THREAD */
912 rc = ldap_pvt_thread_create( &listener_tid,
913 0, slapd_daemon_task, NULL );
916 Debug( LDAP_DEBUG_ANY,
917 "listener ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
921 /* wait for the listener thread to complete */
922 ldap_pvt_thread_join( listener_tid, (void *) NULL );
924 /* expermimental code */
925 listener_tid = pthread_self();
926 slapd_daemon_task( NULL );
936 WORD wVersionRequested;
940 wVersionRequested = MAKEWORD( 2, 0 );
942 err = WSAStartup( wVersionRequested, &wsaData );
944 /* Tell the user that we couldn't find a usable */
949 /* Confirm that the WinSock DLL supports 2.0.*/
950 /* Note that if the DLL supports versions greater */
951 /* than 2.0 in addition to 2.0, it will still return */
952 /* 2.0 in wVersion since that is the version we */
955 if ( LOBYTE( wsaData.wVersion ) != 2 ||
956 HIBYTE( wsaData.wVersion ) != 0 )
958 /* Tell the user that we couldn't find a usable */
964 /* The WinSock DLL is acceptable. Proceed. */
968 int sockdestroy(void)
975 static int sockinit(void)
978 if ( WSAStartup( 0x0101, &wsaData ) != 0 ) {
983 static int sockdestroy(void)
990 static int sockinit(void)
994 static int sockdestroy(void)
1001 slap_sig_shutdown( int sig )
1003 slapd_shutdown = sig;
1006 /* reinstall self */
1007 (void) SIGNAL( sig, slap_sig_shutdown );
1011 slap_sig_wake( int sig )
1015 /* reinstall self */
1016 (void) SIGNAL( sig, slap_sig_wake );