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",
192 rc = ldap_url_parse( url, &lud );
194 if( rc != LDAP_URL_SUCCESS ) {
195 Debug( LDAP_DEBUG_ANY,
196 "daemon: listen URL \"%s\" parse error=%d\n",
202 if( lud->lud_ldaps ) {
203 Debug( LDAP_DEBUG_ANY,
204 "daemon: TLS not supported (%s)\n",
206 ldap_free_urldesc( lud );
210 if(! lud->lud_port ) {
211 lud->lud_port = port;
215 l.sl_is_tls = lud->lud_ldaps;
217 if(! lud->lud_port ) {
218 lud->lud_port = lud->lud_ldaps ? tls_port : port;
222 port = lud->lud_port;
224 (void) memset( (void*) &l.sl_addr, '\0', sizeof(l.sl_addr) );
226 l.sl_addr.sin_family = AF_INET;
227 l.sl_addr.sin_port = htons( (unsigned short) lud->lud_port );
229 if( lud->lud_host == NULL || lud->lud_host[0] == '\0'
230 || strcmp(lud->lud_host, "*") == 0 )
232 l.sl_addr.sin_addr.s_addr = htonl(INADDR_ANY);
235 /* host or address was specified */
236 if( !inet_aton( lud->lud_host, &l.sl_addr.sin_addr ) ) {
237 struct hostent *he = gethostbyname( lud->lud_host );
239 Debug( LDAP_DEBUG_ANY, "invalid host (%s) in URL: %s",
240 lud->lud_host, url, 0);
241 ldap_free_urldesc( lud );
245 memcpy( &l.sl_addr.sin_addr, he->h_addr,
246 sizeof( l.sl_addr.sin_addr ) );
250 ldap_free_urldesc( lud );
253 if ( (l.sl_sd = socket( AF_INET, SOCK_STREAM, 0 )) == AC_SOCKET_INVALID ) {
254 int err = sock_errno();
255 Debug( LDAP_DEBUG_ANY,
256 "daemon: socket() failed errno=%d (%s)\n", err,
257 sock_errstr(err), 0 );
262 if ( l.sl_sd >= dtblsize ) {
263 Debug( LDAP_DEBUG_ANY,
264 "daemon: listener descriptor %ld is too great %ld\n",
265 (long) l.sl_sd, (long) dtblsize, 0 );
266 tcp_close( l.sl_sd );
272 /* enable address reuse */
274 rc = setsockopt( l.sl_sd, SOL_SOCKET, SO_REUSEADDR,
275 (char *) &tmp, sizeof(tmp) );
276 if ( rc == AC_SOCKET_ERROR ) {
277 int err = sock_errno();
278 Debug( LDAP_DEBUG_ANY,
279 "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n",
280 (long) l.sl_sd, err, sock_errstr(err) );
284 /* enable keep alives */
286 rc = setsockopt( l.sl_sd, SOL_SOCKET, SO_KEEPALIVE,
287 (char *) &tmp, sizeof(tmp) );
288 if ( rc == AC_SOCKET_ERROR ) {
289 int err = sock_errno();
290 Debug( LDAP_DEBUG_ANY,
291 "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno=%d (%s)\n",
292 (long) l.sl_sd, err, sock_errstr(err) );
296 /* enable no delay */
298 rc = setsockopt( l.sl_sd, IPPROTO_TCP, TCP_NODELAY,
299 (char *)&tmp, sizeof(tmp) );
300 if ( rc == AC_SOCKET_ERROR ) {
301 int err = sock_errno();
302 Debug( LDAP_DEBUG_ANY,
303 "slapd(%ld): setsockopt(TCP_NODELAY) failed errno=%d (%s)\n",
304 (long) l.sl_sd, err, sock_errstr(err) );
308 rc = bind( l.sl_sd, (struct sockaddr *) &l.sl_addr, sizeof(l.sl_addr) );
309 if ( rc == AC_SOCKET_ERROR ) {
310 int err = sock_errno();
311 Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n",
312 (long) l.sl_sd, err, sock_errstr(err) );
313 tcp_close( l.sl_sd );
317 l.sl_url = ch_strdup( url );
319 l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65336") );
320 s = inet_ntoa( l.sl_addr.sin_addr );
321 sprintf( l.sl_name, "IP=%s:%d",
322 s != NULL ? s : "unknown" , port );
324 li = ch_malloc( sizeof( Listener ) );
327 Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n",
333 static int sockinit(void);
334 static int sockdestroy(void);
336 int slapd_daemon_init(char *urls, int port, int tls_port )
342 assert( tls_port == 0 );
345 Debug( LDAP_DEBUG_ARGS, "daemon_init: %s (%d/%d)\n",
346 urls ? urls : "<null>", port, tls_port );
348 if( (rc = sockinit()) != 0 ) {
353 dtblsize = sysconf( _SC_OPEN_MAX );
354 #elif HAVE_GETDTABLESIZE
355 dtblsize = getdtablesize();
357 dtblsize = FD_SETSIZE;
361 if(dtblsize > FD_SETSIZE) {
362 dtblsize = FD_SETSIZE;
364 #endif /* !FD_SETSIZE */
366 /* open a pipe (or something equivalent connected to itself).
367 * we write a byte on this fd whenever we catch a signal. The main
368 * loop will be select'ing on this socket, and will wake up when
371 if( (rc = lutil_pair( wake_sds )) < 0 ) {
372 Debug( LDAP_DEBUG_ANY,
373 "daemon: lutil_pair() failed rc=%d\n", rc, 0, 0 );
377 FD_ZERO( &slap_daemon.sd_readers );
378 FD_ZERO( &slap_daemon.sd_writers );
384 u = str2charray( urls, " " );
386 if( u == NULL || u[0] == NULL ) {
387 Debug( LDAP_DEBUG_ANY, "daemon_init: no urls (%s) provided.\n",
393 for( i=0; u[i] != NULL; i++ ) {
394 Debug( LDAP_DEBUG_TRACE, "daemon_init: listen on %s\n",
399 Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n",
405 Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners to open...\n",
408 slap_listeners = ch_malloc( (i+1)*sizeof(Listener *) );
410 for(i = 0; u[i] != NULL; i++ ) {
411 slap_listeners[i] = open_listener( u[i], port, tls_port );
413 if( slap_listeners[i] == NULL ) {
418 slap_listeners[i] = NULL;
420 Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n",
424 ldap_pvt_thread_mutex_init( &slap_daemon.sd_mutex );
430 slapd_daemon_destroy(void)
432 connections_destroy();
433 tcp_close( wake_sds[1] );
434 tcp_close( wake_sds[0] );
446 time_t last_idle_check = slap_get_time();
449 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
450 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
453 if ( listen( slap_listeners[l]->sl_sd, 5 ) == -1 ) {
454 int err = sock_errno();
455 Debug( LDAP_DEBUG_ANY,
456 "daemon: listen(%s, 5) failed errno=%d (%s)\n",
457 slap_listeners[l]->sl_url, err,
462 slapd_add( slap_listeners[l]->sl_sd );
465 #ifdef HAVE_NT_SERVICE_MANAGER
466 if ( started_event != NULL ) {
467 ldap_pvt_thread_cond_signal( &started_event );
470 /* initialization complete. Here comes the loop. */
472 while ( !slapd_shutdown ) {
477 #define SLAPD_EBADF_LIMIT 10
480 #define SLAPD_IDLE_CHECK_LIMIT 4
481 time_t now = slap_get_time();
487 struct sockaddr_in from;
488 #if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
494 if( global_idletimeout > 0 && difftime(
495 last_idle_check+global_idletimeout/SLAPD_IDLE_CHECK_LIMIT,
498 connections_timeout_idle(now);
501 FD_ZERO( &writefds );
507 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
509 #ifdef FD_SET_MANUAL_COPY
510 for( s = 0; s < nfds; s++ ) {
511 if(FD_ISSET( &slap_sd_readers, s )) {
512 FD_SET( s, &readfds );
514 if(FD_ISSET( &slap_sd_writers, s )) {
515 FD_SET( s, &writefds );
519 memcpy( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) );
520 memcpy( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) );
522 assert(!FD_ISSET(wake_sds[0], &readfds));
523 FD_SET( wake_sds[0], &readfds );
525 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
526 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
528 if (!FD_ISSET(slap_listeners[l]->sl_sd, &readfds))
529 FD_SET( slap_listeners[l]->sl_sd, &readfds );
533 nfds = slap_daemon.sd_nfds;
538 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
540 ldap_pvt_thread_mutex_lock( &active_threads_mutex );
542 ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
544 #if defined( HAVE_YIELDING_SELECT ) || defined( NO_THREADS )
547 tvp = at ? &zero : NULL;
550 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
551 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
554 Debug( LDAP_DEBUG_CONNS,
555 "daemon: select: listen=%d active_threads=%d tvp=%s\n",
556 slap_listeners[l]->sl_sd, at,
557 tvp == NULL ? "NULL" : "zero" );
560 switch(ns = select( nfds, &readfds,
562 /* don't pass empty fd_set */
563 ( writefds.fd_count > 0 ? &writefds : NULL ),
569 case -1: { /* failure - try again */
570 int err = sock_errno();
574 || err == WSAENOTSOCK /* you'd think this would be EBADF */
577 if (++ebadf < SLAPD_EBADF_LIMIT)
582 Debug( LDAP_DEBUG_CONNS,
583 "daemon: select failed (%d): %s\n",
584 err, sock_errstr(err), 0 );
591 case 0: /* timeout - let threads run */
593 Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n",
595 ldap_pvt_thread_yield();
598 default: /* something happened - deal with it */
600 Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n",
605 if( FD_ISSET( wake_sds[0], &readfds ) ) {
607 tcp_read( wake_sds[0], c, sizeof(c) );
614 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
616 socklen_t len = sizeof(from);
622 char peername[sizeof("IP=255.255.255.255:65336")];
624 if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
627 if ( !FD_ISSET( slap_listeners[l]->sl_sd, &readfds ) )
630 if ( (s = accept( slap_listeners[l]->sl_sd,
631 (struct sockaddr *) &from, &len )) == AC_SOCKET_INVALID )
633 int err = sock_errno();
634 Debug( LDAP_DEBUG_ANY,
635 "daemon: accept(%ld) failed errno=%d (%s)\n",
636 (long) slap_listeners[l]->sl_sd, err,
642 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
644 /* newly accepted stream should not be in any of the FD SETS */
646 assert( !FD_ISSET( s, &slap_daemon.sd_actives) );
647 assert( !FD_ISSET( s, &slap_daemon.sd_readers) );
648 assert( !FD_ISSET( s, &slap_daemon.sd_writers) );
650 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
654 /* make sure descriptor number isn't too great */
655 if ( s >= dtblsize ) {
656 Debug( LDAP_DEBUG_ANY,
657 "daemon: %ld beyond descriptor table size %ld\n",
658 (long) s, (long) dtblsize, 0 );
664 Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n",
669 if ( getpeername( s, (struct sockaddr *) &from, &len ) != 0 ) {
670 int err = sock_errno();
671 Debug( LDAP_DEBUG_ANY,
672 "daemon: getpeername( %ld ) failed: errno=%d (%s)\n",
673 (long) s, err, sock_errstr(err) );
678 peeraddr = inet_ntoa( from.sin_addr );
679 sprintf( peername, "IP=%s:%d",
680 peeraddr != NULL ? peeraddr : "unknown",
681 (unsigned) ntohs( from.sin_port ) );
683 #if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
684 hp = gethostbyaddr( (char *)
686 sizeof(from.sin_addr), AF_INET );
689 dnsname = ldap_pvt_str2lower( hp->h_name );
699 if( !hosts_ctl("slapd",
700 dnsname != NULL ? dnsname : STRING_UNKNOWN,
701 peeraddr != NULL ? peeraddr : STRING_UNKNOWN,
705 Statslog( LDAP_DEBUG_ANY,
706 "fd=%ld connection from %s (%s) denied.\n",
708 dnsname != NULL ? dnsname : "unknown",
709 peeraddr != NULL ? peeraddr : "unknown",
715 #endif /* HAVE_TCPD */
717 if( (id = connection_init(s,
718 slap_listeners[l]->sl_url,
719 dnsname != NULL ? dnsname : "unknown",
721 slap_listeners[l]->sl_name,
723 slap_listeners[l]->sl_is_tls
729 Debug( LDAP_DEBUG_ANY,
730 "daemon: connection_init(%ld, %s, %s) failed.\n",
733 slap_listeners[l]->sl_name );
738 Statslog( LDAP_DEBUG_STATS,
739 "daemon: conn=%ld fd=%ld connection from %s (%s) accepted.\n",
742 slap_listeners[l]->sl_name,
750 Debug( LDAP_DEBUG_CONNS, "daemon: activity on:", 0, 0, 0 );
752 for ( i = 0; i < readfds.fd_count; i++ ) {
753 Debug( LDAP_DEBUG_CONNS, " %d%s",
754 readfds.fd_array[i], "r", 0 );
756 for ( i = 0; i < writefds.fd_count; i++ ) {
757 Debug( LDAP_DEBUG_CONNS, " %d%s",
758 writefds.fd_array[i], "w", 0 );
761 for ( i = 0; i < nfds; i++ ) {
765 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
766 if ( i == slap_listeners[l]->sl_sd ) {
774 r = FD_ISSET( i, &readfds );
775 w = FD_ISSET( i, &writefds );
777 Debug( LDAP_DEBUG_CONNS, " %d%s%s", i,
778 r ? "r" : "", w ? "w" : "" );
782 Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
785 /* loop through the writers */
787 for ( i = 0; i < writefds.fd_count; i++ )
789 for ( i = 0; i < nfds; i++ )
795 wd = writefds.fd_array[i];
797 if( ! FD_ISSET( i, &writefds ) ) {
803 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
804 if ( i == slap_listeners[l]->sl_sd ) {
812 Debug( LDAP_DEBUG_CONNS,
813 "daemon: write active on %d\n",
817 * NOTE: it is possible that the connection was closed
818 * and that the stream is now inactive.
819 * connection_write() must valid the stream is still
823 if ( connection_write( wd ) < 0 ) {
824 FD_CLR( (unsigned) wd, &readfds );
830 for ( i = 0; i < readfds.fd_count; i++ )
832 for ( i = 0; i < nfds; i++ )
839 rd = readfds.fd_array[i];
841 if( ! FD_ISSET( i, &readfds ) ) {
847 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
848 if ( rd == slap_listeners[l]->sl_sd ) {
857 Debug ( LDAP_DEBUG_CONNS,
858 "daemon: read activity on %d\n", rd, 0, 0 );
861 * NOTE: it is possible that the connection was closed
862 * and that the stream is now inactive.
863 * connection_read() must valid the stream is still
867 if ( connection_read( rd ) < 0 ) {
871 ldap_pvt_thread_yield();
874 if( slapd_shutdown > 0 ) {
875 Debug( LDAP_DEBUG_TRACE,
876 "daemon: shutdown requested and initiated.\n",
879 } else if ( slapd_shutdown < 0 ) {
880 Debug( LDAP_DEBUG_TRACE,
881 "daemon: abnormal condition, shutdown initiated.\n",
884 Debug( LDAP_DEBUG_TRACE,
885 "daemon: no active streams, shutdown initiated.\n",
889 for ( l = 0; slap_listeners[l] != NULL; l++ ) {
890 if ( slap_listeners[l]->sl_sd != AC_SOCKET_INVALID ) {
891 slapd_close( slap_listeners[l]->sl_sd );
896 ldap_pvt_thread_mutex_lock( &active_threads_mutex );
897 Debug( LDAP_DEBUG_ANY,
898 "slapd shutdown: waiting for %d threads to terminate\n",
899 active_threads, 0, 0 );
900 while ( active_threads > 0 ) {
901 ldap_pvt_thread_cond_wait(&active_threads_cond, &active_threads_mutex);
903 ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
909 int slapd_daemon( void )
915 #define SLAPD_LISTENER_THREAD 1
916 #if defined( SLAPD_LISTENER_THREAD ) || !defined(HAVE_PTHREADS)
918 /* listener as a separate THREAD */
919 rc = ldap_pvt_thread_create( &listener_tid,
920 0, slapd_daemon_task, NULL );
923 Debug( LDAP_DEBUG_ANY,
924 "listener ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
928 /* wait for the listener thread to complete */
929 ldap_pvt_thread_join( listener_tid, (void *) NULL );
931 /* expermimental code */
932 listener_tid = pthread_self();
933 slapd_daemon_task( NULL );
943 WORD wVersionRequested;
947 wVersionRequested = MAKEWORD( 2, 0 );
949 err = WSAStartup( wVersionRequested, &wsaData );
951 /* Tell the user that we couldn't find a usable */
956 /* Confirm that the WinSock DLL supports 2.0.*/
957 /* Note that if the DLL supports versions greater */
958 /* than 2.0 in addition to 2.0, it will still return */
959 /* 2.0 in wVersion since that is the version we */
962 if ( LOBYTE( wsaData.wVersion ) != 2 ||
963 HIBYTE( wsaData.wVersion ) != 0 )
965 /* Tell the user that we couldn't find a usable */
971 /* The WinSock DLL is acceptable. Proceed. */
975 int sockdestroy(void)
982 static int sockinit(void)
985 if ( WSAStartup( 0x0101, &wsaData ) != 0 ) {
990 static int sockdestroy(void)
997 static int sockinit(void)
1001 static int sockdestroy(void)
1008 slap_sig_shutdown( int sig )
1010 slapd_shutdown = sig;
1013 /* reinstall self */
1014 (void) SIGNAL( sig, slap_sig_shutdown );
1018 slap_sig_wake( int sig )
1022 /* reinstall self */
1023 (void) SIGNAL( sig, slap_sig_wake );