[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dup2 on mingw
From: |
Eric Blake |
Subject: |
Re: dup2 on mingw |
Date: |
Tue, 21 Jul 2009 13:50:59 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> > Yes, that's definitely a portability pitfall that warrants a wrapper module.
>
> And in writing the testcase, I learned that cygwin 1.5 also has a bug, in
> that dup2(1,1) returns 0 (but at least cygwin's dup2(1,2) returns 2).
> Although you seldom see code using dup2 as a no-op for an fd onto itself,
> it provides a great way to non-destructively check whether an fd is open
> without having to use fcntl or _get_osfhandle (and so I did just that in
> test-pipe.c).
Well, it would be nice if doing that didn't hang mingw. It looks like
Microsoft has a bug, because using dup2(fd,fd) when fd is closed appears to
deadlock the process.
I also botched the interaction between fchdir and dup2 (they can't both define
rpl_dup2).
I'm working on a followup patch for both of these issues.
--
Eric Blake
- Re: Help with create_pipe_bidi, (continued)
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/17
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/17
- Re: Help with create_pipe_bidi, Bruno Haible, 2009/07/18
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/18
- Re: Help with create_pipe_bidi, Bruno Haible, 2009/07/19
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/20
- Re: Help with create_pipe_bidi, Bruno Haible, 2009/07/20
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/20
- Re: dup2 on mingw, Bruno Haible, 2009/07/20
- Re: dup2 on mingw, Eric Blake, 2009/07/21
- Re: dup2 on mingw,
Eric Blake <=
- Re: dup2 on mingw, Eric Blake, 2009/07/21
Re: Help with create_pipe_bidi, Bruno Haible, 2009/07/18
- Re: Help with create_pipe_bidi, Eric Blake, 2009/07/18
- Re: new module pipe-filter, Paolo Bonzini, 2009/07/21
- Re: new module pipe-filter, Bruno Haible, 2009/07/21
- Re: new module pipe-filter, Paolo Bonzini, 2009/07/21
- Re: new module pipe-filter, Paolo Bonzini, 2009/07/22