Messages in this thread | | | From | (Nick Holloway) | Subject | Re: ext2 attribute immutable | Date | 2 Apr 1996 21:59:34 +0100 |
| |
In <m0u3rUL-0004CeC@a4dialup-3.ed.ac.uk> sct@dcs.ed.ac.uk writes: > You don't need to. You can just do a ptrace() on init, or create your > OWN init process --- by using a careful, controlled fork bomb we can > easily create new processes until we are about to wrap pid, then kill > init and wait until one of our forks has a pid of 1.
I had always assumed that it was common to wrap around to a pid that was higher than 1 (possibly 300?). This means that you are more likely to find a free pid, since the long running system daemons will have claimed all the low pids (my machine with few daemons has 11% of the pids between 1 and 200 used).
This is a good feature of Linux -- I was able to look at kernel/fork.c at determine the answer for Linux was 0x7fff for the maxpid and 1 for wrappid (the value used after maxpid). I had to write a program that ran on an otherwise idle Sun to determine the same parameters.
-- `O O' | Home: Nick.Holloway@alfie.demon.co.uk // ^ \\ | Work: Nick.Holloway@parallax.co.uk http://www.parallax.co.uk/~alfie/
| |