#include <stdio.h>
#include <signal.h>

typedef void (*sighandler_t)(int);

int main(int argc, char *argv[])
{
	int pid;
	sighandler_t istat;

	printf("grep will sit and wait\n");
	if ((pid = fork()) == 0)
	{
		if (execlp("grep", "grep", "xxx", 0) == -1)
		{
			perror("exec failed");
			exit(1);
		}
	}
	istat = signal(SIGINT, SIG_IGN);
	wait();
	signal(SIGINT, istat);
	printf("Done!\n");
}

