
Unfortunately, this is redhat's position.
------- Additional Comments From roland@redhat.com 2003-12-22 16:37 ------- I think it is clear that the specification refers to the elements of the child process state that survive exec, so that the executed command can perceive them as part of its "environment". You could submit an interpretation request, but I think the committee would concur with my reading. The specification of pthread_atfork refers to calls to fork, not to other parts of the POSIX.1 implementation. If your application calls system, and not fork, those clauses do not apply to it.
How hard would it be to reimplement our own system() and popen() using only POSIX calls, for POSIX systems? I've always thought of these to be pretty simple combinations of fork() and exec(), with an assumption of a working /bin/sh. Without error checking:
int system(char *cmd) { pid = fork(); if (!pid) { /* child */ execl("/bin/sh", "-c", cmd, NULL); } else { /* parent */ int sts; waitpid(pid, *sts, 0); return sts; }
--Guido van Rossum (home page: http://www.python.org/~guido/)