wait ((char *) 0)

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Dec 15 10:41:10 AEST 1988


In article <5147 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>My 4.3BSD manual allows wait(0).
>[This probably ought to be wait((union wait *)0) ].

No, it ought to be wait((int*)0).
wait() has always required a pointer to int;
when non-null, the pointed-to int was filled in with
the least significant 8 bits meaning one thing and
the next 8 bits meaning another (see manual for
details).  Berkeley's attempt to describe this with
a union was totally bogus, because the order of the
bitfields is implementation-dependent, and the true
meaning of the lowest 16 bits of the int pointed to
by wait was system-INdependent.  Vendors of 4BSD-
based systems either had to make sure that the union
was kludged to fit their particular C compiler's
allocation of bitfields, or else have customer code
written according to the original definition break.
I'm pretty sure IEEE 1003.1 went with int*.



More information about the Comp.lang.c mailing list