I thought of that, but what should the fallback case (dup2 + cloexec)
return?
On Mar 8, 2014 4:52 PM, "Ben Noordhuis" <notifications@github.com> wrote:

> In src/unix/stream.c:
>
> > @@ -93,6 +93,52 @@ static int uv__open_cloexec(const char* path, int flags) {
> >  }
> >
> >
> > +int uv__dup_cloexec(int oldfd, int newfd) {
> > +  int r;
> > +
> > +#if defined(__linux__)
> > +  static int no_dup3;
> > +  if (!no_dup3) {
> > +    do
> > +      r = uv__dup3(oldfd, newfd, UV__O_CLOEXEC);
> > +    while (r == -1 && (errno == EINTR || errno == EBUSY));
> > +    if (r == -1 && errno == ENOSYS)
> > +      no_dup3 = 1;
> > +    else if (r == -1)
> > +      return -errno;
> > +    return 0;
>
> Should return r.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/joyent/libuv/pull/1184/files#r10409652>
> .
>