Files
heimdal/lib/roken/signal.c
Assar Westerlund a32d6a5de8 lots of small fixes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@289 ec53bebd-3082-4978-b11e-865c3cabbd6b
1996-03-10 15:12:11 +00:00

44 lines
668 B
C

#include "bsd_locl.h"
RCSID("$Id$");
/*
* We would like to always use this signal but there is a link error
* on NEXTSTEP
*/
#ifndef NeXT
/*
* Bugs:
*
* Do we need any extra hacks for SIGCLD and/or SIGCHLD?
*/
SigAction
signal(int iSig, SigAction pAction)
{
struct sigaction saNew, saOld;
saNew.sa_handler = pAction;
sigemptyset(&saNew.sa_mask);
saNew.sa_flags = 0;
if (iSig == SIGALRM)
{
#ifdef SA_INTERRUPT
saNew.sa_flags |= SA_INTERRUPT;
#endif
}
else
{
#ifdef SA_RESTART
saNew.sa_flags |= SA_RESTART;
#endif
}
if (sigaction(iSig, &saNew, &saOld) < 0)
return(SIG_ERR);
return(saOld.sa_handler);
}
#endif