3 * Copyright 2000 The OpenLDAP Foundation
4 * COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory
5 * of this package for details.
11 #include <ac/string.h>
12 #include <ac/signal.h>
15 lutil_sigaction(int sig, lutil_sig_t func)
17 struct sigaction action, oaction;
19 memset( &action, '\0', sizeof(action) );
21 action.sa_handler = func;
22 sigemptyset( &action.sa_mask );
24 action.sa_flags |= SA_RESTART;
27 if( sigaction( sig, &action, &oaction ) != 0 ) {
31 return oaction.sa_handler;