rstevens@noao.edu (Rich Stevens) (03/22/91)
Submitted-by: rstevens@noao.edu (Rich Stevens) Does anyone know the current draft status of POSIX.2 with regard to the system() function and its return code. I see that SVR4 now returns -1 on an error (fork, exec, or wait error) while Reno still returns the exit status of 127. Is -1 a valid return value--that is, are -1 and the valid wait() and waitpid() exit statuses mutually exclusive? Rich Stevens (rstevens@noao.edu) Volume-Number: Volume 23, Number 17
willcox@urbana.mcd.mot.com (David A Willcox) (03/26/91)
Submitted-by: willcox@urbana.mcd.mot.com (David A Willcox) rstevens@noao.edu (Rich Stevens) writes: >Submitted-by: rstevens@noao.edu (Rich Stevens) >Does anyone know the current draft status of POSIX.2 with regard to >the system() function and its return code. >From POSIX.2 Draft 11 (unchanged for several drafts): B.3.1.3 Returns If command is NULL, the system() function shall return nonzero. If comamnd is not NULL, the system() function shall return the termination status of the command language interpreter in the format specified by the waitpid() function in POSIX.1. The termination status of the c.l.i. is as specified by the sh utility, except that if some error prevents the c.l.i. from executing after the child process is created, the return value from system() shall be as of the c.l.i. had terminated using exit(127) or _exit(127). If a child process cannot be created, or if the terminaton status of the c.l.i. cannot be obtained, system() shall return -1 and set errno to indicate the error. David A. Willcox "Just say 'NO' to universal drug testing" Motorola TSD - Urbana UUCP: ...!uiucuxc!udc!willcox 1101 E. University Ave. INET: willcox@urbana.mcd.mot.com Urbana, IL 61801 FONE: 217-384-8534 Volume-Number: Volume 23, Number 19