Sys V fork IS broken!

Brian Rice rice at dg-rtp.dg.com
Thu Aug 2 23:16:34 AEST 1990


In article <574 at oglvee.UUCP>, jr at oglvee.UUCP (Jim Rosenberg) writes:
> In <1990Jul30.002642.18244 at dg-rtp.dg.com> rice at 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 at dg-rtp.dg.com   +1 919 248-6328
DG/UX Product Assurance Engineering
Data General Corp., Research Triangle Park, N.C.



More information about the Comp.unix.wizards mailing list