From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 14 Feb 2008 17:14:33 +0000 To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Google search of the day From: "Eris Discordia" Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 References: <32d376bd5d99375e5941cff163ebbfb1@csplan9.rit.edu> <47B46ECD.D08BED0F@null.net> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <47B46ECD.D08BED0F@null.net> User-Agent: Opera Mail/9.23 (Win32) Topicbox-Message-UUID: 53ca4034-ead3-11e9-9d60-3106f5b1d025 On Thu, 14 Feb 2008 16:45:02 -0000, Douglas A. Gwyn wrote: > john@csplan9.rit.edu wrote: >> for (;;) >> fork(); > > In genuine UNIX(tm) systems, there is a per-user process limit, > so eventually the fork requests start failing. However, this > program keeps trying to fork, so if you kill off some of the > child processes it will spawn replacements. > That is not limited to UNIX proper. FreeBSD (and relatives, I suppose) all have the /etc/login.conf where one can set limits on virtually all aspects of user priviliges (cputime, filesize, datasize, stacksize, coredumpsize, memoryuse, maxproc, openfiles, sbsize, etc) for arbitrary user classes. I think it will be possible to kill the spawned children, because they are all bound to have pids larger than a certain number. I do not know if Linux has similar facilities. As for Plan 9, the book by Francisco Ballesteros mentions a piece of code worse than the above and points out that the only way to get rid of it would be to reboot the system (which is quite as funny as the "bootsplash: silent mode," by the way). ----snippet---- /* rabbits.c */ #include #include void main(int, char*[]) { // just like rabbits... while(fork()) ; exits(nil); } ----snippet---- -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/