Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!pyrltd!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.lang.c Subject: Re: Catching termination of child process and system() call Message-ID: <2615@root44.co.uk> Date: 20 Feb 91 15:00:28 GMT References: <1356@geovision.UUCP> <9882@dog.ee.lbl.gov> <2608@root44.co.uk> <15239@smoke.brl.mil> Followup-To: comp.unix.programmer Organization: UniSoft Ltd., London, England Lines: 34 In <15239@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >In article <2608@root44.co.uk> gwc@root.co.uk (Geoff Clare) writes: >>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: >(1) PORTABLE programs MUST follow Chris's recommendation; not all >existing UNIX environments provide the macros to which you alluded. >PORTABLE != POSIX I think Doug has misunderstood my meaning. Dan Bernstein gave a similar reaction in comp.unix.programmer. Perhaps I wasn't very clear, or maybe I used some English expression which doesn't mean quite the same to Americans. Anyway, what I was trying to say is that because the wait status encoding is not specified by POSIX, it may not be the same on future POSIX systems, so programs should not rely on it. For maximum portability programs should use the POSIX macros *if they are defined*. If they are not defined, programs which are required to be portable to non-POSIX systems should of course revert to the traditional encoding. See my reply to Dan's follow-up in comp.unix.programmer for more details. >(2) Does POSIX really neglect to specify the bits? Yes. By the way, Doug, why did you ignore the "Followup-To:" in my article? Are you using a broken newsreader? Follow-ups to this article are directed to comp.unix.programmer (again :-) -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, London, England. Tel: +44 71 729 3773 Fax: +44 71 729 3273