This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18433] posix_spawn does not return correctly upon failure to execute


https://sourceware.org/bugzilla/show_bug.cgi?id=18433

--- Comment #4 from navid R <rahimi.nv at gmail dot com> ---
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]