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 <fernanbola...@mailc.net> wrote: > On Tue, Jan 11, 2011 at 4:06 PM, Fernan Bolando <fernanbola...@mailc.net> > wrote: >> On Tue, Jan 11, 2011 at 3:45 PM, Federico G. Benavento >> <benave...@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