[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200703310124.22082.vda.linux@googlemail.com>
Date: Sat, 31 Mar 2007 01:24:22 +0200
From: Denis Vlasenko <vda.linux@...glemail.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "Michael K. Edwards" <medwards.linux@...il.com>,
Davide Libenzi <davidel@...ilserver.org>,
"David M. Lloyd" <dmlloyd@...rg.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch 2/5] signalfd v2 - signalfd core ...
On Thursday 08 March 2007 18:28, Linus Torvalds wrote:
> The sad part is that there really is no reason why the BSD crowd couldn't
> have done recvmsg() as an "extended read with per-system call flags",
> which would have made things like O_NONBLOCK etc unnecessary, because you
> could do it just with MSG_DONTWAIT..
Wait a second here... O_NONBLOCK is not just unnecessary - it's buggy!
Try to do nonblocking read from stdin (fd #0) -
* setting O_NONBLOCK with fcntl will set it for all other processes
which has the same stdin!
* trying to reset O_NONBLOCK after the read doesn't help (think kill -9)
* duping fd #0 doesn't help because O_NONBLOCK is not per-fd,
it's shared just like filepos.
I really like that trick with recvmsg + MSG_DONTWAIT instead.
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists