dave@lsuc.UUCP (David Sherman) (01/08/85)
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
danny@itm.UUCP (Danny) (01/09/85)
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)