musl/src/signal/siginterrupt.c
Rich Felker a7dbcf5c8c use 0 instead of NULL for null pointer constants
and thereby remove otherwise-unnecessary inclusion of stddef.h
2013-12-13 02:20:07 -05:00

13 lines
214 B
C

#include <signal.h>
int siginterrupt(int sig, int flag)
{
struct sigaction sa;
sigaction(sig, 0, &sa);
if (flag) sa.sa_flags &= ~SA_RESTART;
else sa.sa_flags |= SA_RESTART;
return sigaction(sig, &sa, 0);
}