4.3BSD/usr/guest/sam/tests/sigtstp.c

Compare this file to the similar file:
Show the results in this format:

#include <signal.h>

catch()
{

	printf("catch SIGTSTP\n");
	sigsetmask(0);
	signal(SIGTSTP, SIG_DFL);
	kill(getpid(), SIGTSTP);
	signal(SIGTSTP, catch);
}

main()
{

	signal(SIGTSTP, catch);
	for (;;)
		kill(getpid(), SIGTSTP);
}