Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!wuarchive!emory!mephisto!mcnc!rti!dg-rtp!magic!rice From: rice@dg-rtp.dg.com (Brian Rice) Newsgroups: comp.unix.wizards Subject: Re: Sys V fork IS broken! Keywords: misleading man page Message-ID: <1990Aug2.131634.6161@dg-rtp.dg.com> Date: 2 Aug 90 13:16:34 GMT References: <480@amanue.UUCP> <13426@cbmvax.commodore.com> <573@oglvee.UUCP> <13435@smoke.BRL.MIL> <1990Jul28.195032.18746@watdragon.waterloo.edu> <1990Jul30.002642.18244@dg-rtp.dg.com> <574@oglvee.UUCP> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: rice@dg-rtp.dg.com Followup-To: comp.unix.wizards Organization: Data General Corporation, Research Triangle Park, NC Lines: 37 In article <574@oglvee.UUCP>, jr@oglvee.UUCP (Jim Rosenberg) writes: > In <1990Jul30.002642.18244@dg-rtp.dg.com> rice@dg-rtp.dg.com (Brian Rice) writes: > >And, of course, the kernel tells you why your fork failed: you get EAGAIN or > >ENOMEM in errno. > > Not clear! In the V.3.2 man page for fork(2) it sez: > > EAGAIN Total amount of system memory available when reading via > raw IO is temporarily insufficient. > > ENOMEM The process requires more space than the system is able to > supply. Yup--this is pretty murky. The System V Interface Definition, issue 2, and later documents are more forthcoming: EAGAIN is returned if the limits on total processes or processes-per-user would be exceeded, and ENOMEM is returned if physical storage is insufficient. I don't recall having looked carefully at the above man page section before (I wouldn't have seen it in daily life because DG/UX's fork man page echoes the SVID). It does indeed give readers the impression that their forks are failing because of an implementation detail (not to say "flaw") of the kernel; I don't know whether vanilla V.3 kernels ever actually worked that way, but if they did, I can certainly sympathize with those people who were unhappy with fork. Anyway, if your System V conforms to SVID 2 or later, you can count on the use of EAGAIN for configuration-limits problems and ENOMEM for physical- storage problems. So don't worry about that "raw IO" malarkey. "Be happy." -- Baba RAM Dass Brian Rice rice@dg-rtp.dg.com +1 919 248-6328 DG/UX Product Assurance Engineering Data General Corp., Research Triangle Park, N.C.