Paul Eggert writes: > I took a quick look, and in the ordinary POSIXish code there's a race > condition between the calls to pipe2 and the calls to fcntl with > FD_CLOEXEC. If some other thread forks and execs a process after > pipe2 but before fcntl, that process will have access to the pipe ends > and this could cause problems. Instead, please call pipe2 (.., > O_BINARY | O_CLOEXEC) so that the other process won't see the pipe > end. Any child process that needs to have the pipe end survive an > exec should then call fcntl (pipe_end, F_SETFD, 0) before execing. Thanks. Actually, the special case of pipe2 flags was not necessary; it was a wreck when I tried to support FD above 2 (for stderr, the flag is cleared in child_setup). I updated the patch and it's now much simpler. Regards, -- Daiki Ueno