Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: wait ((char *) 0) Keywords: aack thppt wait union Message-ID: <9185@smoke.BRL.MIL> Date: 15 Dec 88 00:41:10 GMT References: <9142@smoke.BRL.MIL> <685@auspex.UUCP> <1886@loral.UUCP> <5147@bsu-cs.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <5147@bsu-cs.UUCP> dhesi@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*.