From: "Federico G. Benavento" <benavento@gmail.com>
To: fernanbolando@mailc.net
Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] ape/socket again non-blocking command succeeds but still blocks
Date: Tue, 11 Jan 2011 05:57:35 -0300 [thread overview]
Message-ID: <AANLkTimtqnXS4sqGfbn6iB4yroPNq9BLxKqKTbeng3zK@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinMYAnaRzo+JdTa6Mm_hwuZyrtGPzU9y+CMr4vS@mail.gmail.com>
fcntl() didn't fail, it has to do with listen()'s implementation
which creates a pipe, dups and forks... but the new fd
doesn't have O_NONBLOCK set.
check /sys/src/ape/lib/bsd/listen.c
and yes it's an incompatibility
On Tue, Jan 11, 2011 at 5:18 AM, Fernan Bolando <fernanbolando@mailc.net> wrote:
> On Tue, Jan 11, 2011 at 4:06 PM, Fernan Bolando <fernanbolando@mailc.net> wrote:
>> On Tue, Jan 11, 2011 at 3:45 PM, Federico G. Benavento
>> <benavento@gmail.com> wrote:
>>> it's not fcnlt's fault, ape replaces your sockfd with a pipe
>>> when you do listen(), you could call fcntl again after the
>>> listen() call...
>>>
>>> all this is usually combined with select() which in turns does
>>> more magic behind the scenes and this behavior isn't
>>> exposed.
>>>
>>
>> I understand, I am now using select() when compiled under plan9/ape,
>> it looks like it's working now. I originally found select() when I was
>> googling this problem, but I wasn't sure if adding select() will hide
>> an incompatibility issue between plan9/ape and some standard.
>>
>> thanks for your help.
>>
>
> On a second thought shouldn't fnctl raise an error that it was not
> able to set non-block?
>
--
Federico G. Benavento
prev parent reply other threads:[~2011-01-11 8:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 1:31 Fernan Bolando
2011-01-11 6:11 ` Federico G. Benavento
2011-01-11 6:53 ` Fernan Bolando
2011-01-11 7:45 ` Federico G. Benavento
2011-01-11 8:06 ` Fernan Bolando
2011-01-11 8:18 ` Fernan Bolando
2011-01-11 8:57 ` Federico G. Benavento [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimtqnXS4sqGfbn6iB4yroPNq9BLxKqKTbeng3zK@mail.gmail.com \
--to=benavento@gmail.com \
--cc=9fans@9fans.net \
--cc=fernanbolando@mailc.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).