Path: utzoo!attcan!uunet!cs.utexas.edu!uwm.edu!bionet!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Sys V fork IS broken! Message-ID: <25839@mimsy.umd.edu> Date: 2 Aug 90 08:17:50 GMT References: <480@amanue.UUCP> <13426@cbmvax.commodore.com> <573@oglvee.UUCP> <574@oglvee.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 36 Just for fun (well, not really :-) ), here is what the 4BSD man page says about fork: [EAGAIN] The system-imposed limit on the total number of processes under execution would be exceeded. This limit is configuration- dependent. [EAGAIN] The system-imposed limit MAXUPRC () on the total number of processes under execution by a single user would be exceeded. [ENOMEM] There is insufficient swap space for the new process. These are the only errors listed, thus the only two that will ever be returned (and if you believe that . . . :-) ). Now, arguably the first two EAGAINs should be different codes: there is a distinct difference between `We're sorry, all circuits are busy' and `We're sorry, all your personal phones are busy'. Indeed, if EAGAIN is to be used for both `out of system-wide process table slots' and `too many of your own processes running', one could argue that open should not distinguish between EMFILE (`you personally have too many files open') and ENFILE (`everyone put together have too many files open'). At any rate, the Berkeley fork will not fail just because the system is temporarily short of physical memory. (It can, however, deadlock both in fork() and when growing a process.... Fork can only deadlock when there is almost no real memory at all, though [`almost none' means `USRPTSIZE + NPROC*HIGHPAGES < maxmem'].) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris