🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by David Sherman Tue, 08 Jan 1985 03:54
what does wait(2) really do with status?
#3
Author: David Sherman
Date: Tue, 08 Jan 1985 03:54
12 lines
844 bytes
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?

Dave Sherman
The Law Society of Upper Canada
Toronto
-- 
{utzoo pesnta nrcaero utcs}!lsuc!dave
{allegra decvax ihnp4 linus}!utcsrgv!lsuc!dave
Re: what does wait(2) really do with status?
#5
Author: Danny
Date: Tue, 08 Jan 1985 16:09
31 lines
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)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads