Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.programmer Subject: Re: Catching termination of child process and system() call Message-ID: <12673:Feb1900:07:4691@kramden.acf.nyu.edu> Date: 19 Feb 91 00:07:46 GMT References: <1356@geovision.UUCP> <9882@dog.ee.lbl.gov> <2608@root44.co.uk> Organization: IR Lines: 22 In article <2608@root44.co.uk> gwc@root.co.uk (Geoff Clare) writes: > The discussion does have some relevance to 'C' since > it is about the format of the status returned by wait(), No. It has absolutely nothing to do with C. We just happen to be talking about it in C. > POSIX does not specify the precise encoding of information in the status > returned by wait(), system(), etc., so portable programs should not > rely on the traditional encoding Chris describes above. Instead macros > are provided in to extract the relevant data from the status: Wrong. A program written according to your advice is decidedly nonportable: it will work only on POSIX systems. A program written according to Chris's advice will work under System V, BSD, and most POSIX-based systems to boot. Someone who wants to plan for the future should conditionally compile the POSIX code, though of course he'll still have to use w & 0200 to get the core dump bit. Portability is defined by the real world, not a standards committee. ---Dan