Catching termination of child process and system() call
Geoff Clare
gwc at root.co.uk
Thu Feb 21 02:00:28 AEST 1991
In <15239 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>In article <2608 at root44.co.uk> gwc at 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 <sys/wait.h> 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 <gwc at root.co.uk> (Dumb American mailers: ...!uunet!root.co.uk!gwc)
UniSoft Limited, London, England. Tel: +44 71 729 3773 Fax: +44 71 729 3273
More information about the Comp.lang.c
mailing list