Some questions about POSIX headers
Andy Tanenbaum
ast at cs.vu.nl
Sat Nov 11 10:45:34 AEST 1989
I have several questions about POSIX P1003.1. Consider the following
excerpt from <sys/wait.h>:
#define _LOW(__v) ( (__v) & 0377)
#define _HIGH(__v) ( ((__v) >> 8) & 0377)
#define WIFEXITED(__s) (_LOW(__s) == 0) /* normal exit */
#define WEXITSTATUS(__s) (_HIGH(__s)) /* exit status */
#define WTERMSIG(__s) (_LOW(__s) & 0177) /* sig value */
#define WIFSIGNALED(__s) (_HIGH(__s) == 0 && __s != 0) /* signaled */
1. Is it legal to have _LOW and _HIGH here (name space pollution rules)?
2. Are the parameters __s and __v required to begin with __ (again, name
space pollution rules)?
3. WIFSIGNALED evaluates __s twice. Is this legal? In an ANSI C header
it is specifically forbidden. What about POSIX?
4. Is the extra set of parenthesis around __v in _HIGH() really required?
5. What is the best newsgroup for asking this sort of question?
Thanks.
Andy Tanenbaum (ast at cs.vu.nl)
More information about the Comp.unix.questions
mailing list