Subject: Re: system time and resource usage stats wrong?
To: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
From: Simon Burge <simonb@netbsd.org>
List: port-pmax
Date: 08/13/1999 11:19:11
Toru Nishimura wrote:

> Simon, could you post the program which you made?

It probably should take a command-line argument for the delay, but I was
too lazy!

Simon.
------------------------------ x.c ------------------------------
#include <signal.h>
#include <unistd.h>

void
termhandler(int ignored)
{
	exit(0);
}

main()
{
	pid_t pid;

	pid = fork();
	if (pid == 0) {
		sleep(10);
		kill(getppid(), SIGTERM);
		exit(0);
	}
	else {
		signal(SIGTERM, termhandler);
		while (1)
			;
	}
}