lkml.org 
[lkml]   [2009]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RESEND][RFC PATCH v2] waitfd
From
Date
On Wed, 2009-01-07 at 18:19 +0100, Oleg Nesterov wrote:

> Please note that unlike other sys_...fd() syscalls, sys_waitfd()
> doesn't allow to pass O_CLOEXEC. Looks like we need a separate
> "flags" argument...
>
> Also, ioctl(FIONBIO) or fcntl(O_NONBLOCK) have no effect on
> waitfd, not very good.
>
> I'd suggest to remove WNOHANG from waitfd_ctx->ops and treat
> (->f_flags & O_NONBLOCK) as WNOHANG.
>
> (can't resist, ->ops is not the best name ;)
>
Definitely agree here, waitfd() doesn't need WNOHANG - we already have
ONONBLOCK.

That also solves one of the strangest behaves of waitid when you use
WNOHANG (it returns zero and you have to check whether it changed the
struct), now you just read() - if no child you get EAGAIN, if a child
you read a struct.

Scott
--
Scott James Remnant
scott@canonical.com
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2009-01-10 15:49    [W:0.334 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site