From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH] nextfd(2) Date: Fri, 06 Apr 2012 09:23:00 -0700 Message-ID: <4F7F1864.8090606@zytor.com> References: <20120401125741.GA7484@p183.telecom.by> <4F78D0BA.9040709@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, drepper@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Alexey Dobriyan Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 04/06/2012 02:54 AM, Alexey Dobriyan wrote: > > Without proc knowledge about fdtable is gathered linearly and still unreliable. > With nextfd(2), even procful environments could lose several failure branches. > And they can keep old dumb fd++ or smart /proc/self/fd loops for a change. > Incidentally, if we were to create a system call for this -- which I so far see no reason for -- I would make it return a select-style bitmask of file descriptors in use, not a "next fd" which would require a system call per iteration. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.