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/