Article View: pe.cust.bugs
Article #5Re: what does wait(2) really do with status?
From: Danny
Date: Tue, 08 Jan 1985 16:09
Date: Tue, 08 Jan 1985 16:09
31 lines
1522 bytes
1522 bytes
David Sherman writes:
>According to the manual for wait(2), the argument supplied
>is a pointer to int (that is, "int *status"). The manual goes
>on to talk about its "high byte" and "low byte", obviously
>a throwback to the PDP-11. Anyone know whether status should
>be declared pointer to short, or what?
This is the way I've done it, it's simple, it requires no
masking/shifting, etc.
/*
* Structure of return from wait() system call
* Note: This is probably machine dependent
*/
struct status {
char dummy1; /* dummy char # 1 */
char dummy2; /* dummy char # 2 */
char ret; /* Exit code from process */
char pstat; /* Signal process died with (if any) */
};
The note above is correct, it is very machine-dependant. The
VAX version reverses pstat and ret, and defines them first in the
struct (I think).
Anyway, try it out...
Danny
--
Daniel S. Cox
({gatech|akgua}!itm!danny)
Technical Details
Message-ID:
<225@itm.UUCP>Path:
arc1-ca.pugleaf.net!lsuc!pesnta!itm!dannyReferences:
<268@lsuc.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Posting-Version: version B 2.10.1 6/24/83; site itm.UUCP Path: arc1-ca.pugleaf.net!lsuc!pesnta!itm!danny From: danny@itm.UUCP (Danny) Newsgroups: pe.cust.bugs Subject: Re: what does wait(2) really do with status? Message-ID: <225@itm.UUCP> Date: 8 Jan 85 16:09:52 GMT Date-Received: 9 Jan 85 08:18:22 GMT References: <268@lsuc.UUCP> Reply-To: danny@itm.UUCP (Danny) Organization: In Touch - Atlanta, GA Lines: 31