Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756093AbZAJWhd (ORCPT ); Sat, 10 Jan 2009 17:37:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753303AbZAJWhY (ORCPT ); Sat, 10 Jan 2009 17:37:24 -0500 Received: from mx2.redhat.com ([66.187.237.31]:53120 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbZAJWhY (ORCPT ); Sat, 10 Jan 2009 17:37:24 -0500 Message-ID: <4969230F.4080609@redhat.com> Date: Sat, 10 Jan 2009 17:37:03 -0500 From: Casey Dahlin User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Oleg Nesterov CC: Scott James Remnant , Ingo Molnar , Linux Kernel , Randy Dunlap , Roland McGrath , Davide Libenzi , Peter Zijlstra Subject: Re: [RESEND][RFC PATCH v2] waitfd References: <49639EB8.40204@redhat.com> <4963ABF0.6070400@redhat.com> <20090107123457.GB16268@elte.hu> <20090107171922.GA18000@redhat.com> <1231598863.11642.55.camel@quest> <49690FC9.4010403@redhat.com> <20090110223130.GA28581@redhat.com> In-Reply-To: <20090110223130.GA28581@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 49 Oleg Nesterov wrote: > On 01/10, Casey Dahlin wrote: > >> Scott James Remnant wrote: >> >>> 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. >>> >>> >> From the perspective of waitfd, the only difference between WNOHANG and >> O_NONBLOCK is which argument you put the flags in. >> > > No. Please see the note about ioctl/fcntl above. > > Oleg. > Yes but the actual waitfd call could simply set O_NONBLOCK on the descriptor when it receive WNOHANG in the flags, and read the descriptor flags going forward. --CJD -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/