[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h89o9cng.fsf@oldenburg2.str.redhat.com>
Date: Tue, 21 May 2019 15:10:11 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Christian Brauner <christian@...uner.io>
Cc: viro@...iv.linux.org.uk, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
jannh@...gle.com, oleg@...hat.com, tglx@...utronix.de,
torvalds@...ux-foundation.org, arnd@...db.de, shuah@...nel.org,
dhowells@...hat.com, tkjos@...roid.com, ldv@...linux.org,
miklos@...redi.hu, linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-ia64@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, linux-sh@...r.kernel.org,
sparclinux@...r.kernel.org, linux-xtensa@...ux-xtensa.org,
linux-arch@...r.kernel.org, linux-kselftest@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH 1/2] open: add close_range()
* Christian Brauner:
>> Solaris has an fdwalk function:
>>
>> <https://docs.oracle.com/cd/E88353_01/html/E37843/closefrom-3c.html>
>>
>> So a different way to implement this would expose a nextfd system call
>
> Meh. If nextfd() then I would like it to be able to:
> - get the nextfd(fd) >= fd
> - get highest open fd e.g. nextfd(-1)
The highest open descriptor isn't istering for fdwalk because nextfd
would just fail.
> But then I wonder if nextfd() needs to be a syscall and isn't just
> either:
> fcntl(fd, F_GET_NEXT)?
> or
> prctl(PR_GET_NEXT)?
I think the fcntl route is a bit iffy because you might need it to get
the *first* valid descriptor.
>> to userspace, so that we can use that to implement both fdwalk and
>> closefrom. But maybe fdwalk is just too obscure, given the existence of
>> /proc.
>
> Yeah we probably don't need fdwalk.
Agreed. Just wanted to bring it up for completeness. I certainly don't
want to derail the implementation of close_range.
Thanks,
Florian
Powered by blists - more mailing lists