Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755664Ab0H3OXH (ORCPT ); Mon, 30 Aug 2010 10:23:07 -0400 Received: from x35.xmailserver.org ([64.71.152.41]:42014 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753944Ab0H3OXF (ORCPT ); Mon, 30 Aug 2010 10:23:05 -0400 X-AuthUser: davidel@xmailserver.org Date: Mon, 30 Aug 2010 07:22:57 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@Macintosh-3.local To: Michael Kerrisk cc: Andrew Morton , Linux Kernel Mailing List , Linus Torvalds , linux-api@vger.kernel.org Subject: Re: [patch/rfc] eventfd semaphore-like behavior In-Reply-To: Message-ID: References: <20090204150507.665b5b7c.akpm@linux-foundation.org> <20090204152434.c8f65d52.akpm@linux-foundation.org> <20090204155514.6abbdc8f.akpm@linux-foundation.org> User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-561423044-1283178184=:175" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2210 Lines: 59 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-561423044-1283178184=:175 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Mon, 30 Aug 2010, Michael Kerrisk wrote: > On Thu, Feb 5, 2009 at 2:02 AM, Davide Libenzi wrote: > > On Thu, 5 Feb 2009, Michael Kerrisk wrote: > > > >> > Dunno. ?Probably try the syscall and see if it returned -EINVAL. ?Does > >> > that work in this case? > >> > >> As youll have seen by now, Ulrich and I noted that it works. > >> > >> > If so, it would be sensible to mention this in > >> > the description somewhere as the approved probing method and to > >> > maintain it. > >> > >> I'll add something to the man page, as this patch progresses. > > > > I see we already have stuff like this inside the man pages: > > > > O_CLOEXEC (Since Linux 2.6.23) > > ? ? ? ? ?Enable the close-on-exec flag for the new file descriptor. > > ? ? ? ? ?... > > > > Maybe a similar note for the new flag? > > It took a while, but here's the new text in the eventfd.2 (will be in > man-pages-2.36). Could you please ACK, Davide? > > EFD_SEMAPHORE (since Linux 2.6.30) > Provide semaphore-like semantics for reads from > the new file descriptor. See below. > ... > * If EFD_SEMAPHORE was not specified and the > eventfd counter has a nonzero value, then a > read(2) returns 8 bytes containing that value, > and the counter's value is reset to zero. > > * If EFD_SEMAPHORE was specified and the eventfd > counter has a nonzero value, then a read(2) > returns 8 bytes containing the value 1, and the > counter's value is decremented by 1. Looks fine to me. - Davide --0-561423044-1283178184=:175-- -- 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/