Subject: Re: Fork bomb protection patch
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 12/05/2002 10:49:02
This variant:

 	for (i = 1000; i; i--) {
 		if (fork() == 0)
			/* reset counter in child */
			i = 1000;
 	}
	exit(0);

Might be even more lively.
Although it frees up processes occasionally, it is possible
that no process is running long enough to get its priority
stomped on.

(I've not tried it though...)

	David

-- 
David Laight: david@l8s.co.uk