ksh/sigexec.c
2010-03-10 14:26:16 +00:00

20 lines
384 B
C

#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <signal.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
struct sigaction sa;
sa.sa_flags = SA_RESTART;
sa.sa_handler = SIG_DFL;
sigemptyset (&sa.sa_mask);
sigaction(SIGPIPE, &sa, (struct sigaction*)0);
sigaction(SIGQUIT, &sa, (struct sigaction*)0);
return execv(argv[0], &argv[1]);
}