[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC socketpair

From: Bastien ROUCARIES
Subject: Re: RFC socketpair
Date: Tue, 3 May 2011 15:00:31 +0200

On Mon, May 2, 2011 at 3:52 PM, Paolo Bonzini <address@hidden> wrote:
> On 05/01/2011 04:29 PM, Bastien ROUCARIES wrote:
>> Did you test if dup2 work for socket ?
>> According tohttp://www.suacommunity.com/dictionary/dup-entry.php
>> andhttp://blog.csdn.net/linlu11/archive/2008/06/06/2518571.aspx  it
>> will need more work.
> dup2 indeed may not work for a socket on Windows.  It would work on Wine,
> since WSADuplicateSocket is just doing DuplicateHandle on Wine, but I don't
> know what Windows actually does.
> That's definitely something to remember, thanks for pointing it out.
> Paolo

How can we test without a socketpair ?

Moreover I see another non compliance with dup2. After a dup2 of
stdin/stdout/stderr fprintf(stdout,"%s",some format) will not work
because it is using the old handle....

So we must use special code for fd 0,1,2

BTW it seems that dup fail with bad handle


reply via email to

[Prev in Thread] Current Thread [Next in Thread]