From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11482 invoked by alias); 12 Sep 2015 20:56:46 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 11424 invoked by uid 48); 12 Sep 2015 20:56:42 -0000 From: "rahimi.nv at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/18433] posix_spawn does not return correctly upon failure to execute Date: Sat, 12 Sep 2015 20:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.19 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rahimi.nv at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg00149.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18433 --- Comment #4 from navid R --- I developed a pipe solution but didn't get accepted . the problem raise because glibc is supporting system without pipe2 , (we can use pipe for creating file descriptor and use fcntl and FD_CLOEXEC to set it proper flag , but there is race condition between two calls . and the overall code is so messy . #ifdef __ASSUME_PIPE2 if (__pipe2 (pipefd, O_CLOEXEC)) return errno; #else if (__pipe (pipefd)) return errno; if (__fcntl (pipefd[0], FD_CLOEXEC) == -1 || __fcntl (pipefd[1], FD_CLOEXEC) == -1 return errno; -- You are receiving this mail because: You are on the CC list for the bug.