Re: [PATCH v5 1/3] open: add close_range()

2020-09-17 Thread Michael Kerrisk (man-pages)
Hey Christian, Could we please have a manual page for the close_range(2) syscall that's about to land in 5.9? Thanks, Michael On Wed, 3 Jun 2020 at 12:24, Michael Kerrisk (man-pages) wrote: > > Hi Christian, > > Could we have a manual page for this API (best before it's merged)? > > Thanks, >

RE: [PATCH v5 1/3] open: add close_range()

2020-06-07 Thread David Laight
From: Szabolcs Nagy > Sent: 05 June 2020 15:56 ... > currently there is no libc interface contract in place that > says which calls may use libc internal fds e.g. i've seen > > openlog(...) // opens libc internal syslog fd > ... > fork() > closefrom(...) // close syslog fd > open(...)

Re: [PATCH v5 1/3] open: add close_range()

2020-06-06 Thread Kyle Evans
On Sat, Jun 6, 2020 at 6:55 AM Szabolcs Nagy wrote: > > * Kyle Evans [2020-06-05 21:54:56 -0500]: > > On Fri, Jun 5, 2020 at 9:55 AM Szabolcs Nagy wrote: > > > this api needs a documentation patch if there isn't yet. > > > > > > currently there is no libc interface contract in place that > > >

Re: [PATCH v5 1/3] open: add close_range()

2020-06-06 Thread Szabolcs Nagy
* Kyle Evans [2020-06-05 21:54:56 -0500]: > On Fri, Jun 5, 2020 at 9:55 AM Szabolcs Nagy wrote: > > this api needs a documentation patch if there isn't yet. > > > > currently there is no libc interface contract in place that > > says which calls may use libc internal fds e.g. i've seen > > > >

Re: [PATCH v5 1/3] open: add close_range()

2020-06-05 Thread Kyle Evans
On Fri, Jun 5, 2020 at 9:54 PM Kyle Evans wrote: > > On Fri, Jun 5, 2020 at 9:55 AM Szabolcs Nagy wrote: > > > > * Christian Brauner [2020-06-02 22:42:17 > > +0200]: > > > [... snip ...] > > > > > > First, it helps to close all file descriptors of an exec()ing task. This > > > can be done

Re: [PATCH v5 1/3] open: add close_range()

2020-06-05 Thread Kyle Evans
On Fri, Jun 5, 2020 at 9:55 AM Szabolcs Nagy wrote: > > * Christian Brauner [2020-06-02 22:42:17 > +0200]: > > [... snip ...] > > > > First, it helps to close all file descriptors of an exec()ing task. This > > can be done safely via (quoting Al's example from [1] verbatim): > > > > /*

Re: [PATCH v5 1/3] open: add close_range()

2020-06-05 Thread Szabolcs Nagy
* Christian Brauner [2020-06-02 22:42:17 +0200]: > This adds the close_range() syscall. It allows to efficiently close a range > of file descriptors up to all file descriptors of a calling task. > > I've also coordinated with some FreeBSD developers who got in touch with > me (Cced below).

Re: [PATCH v5 1/3] open: add close_range()

2020-06-03 Thread Michael Kerrisk (man-pages)
Hi Christian, Could we have a manual page for this API (best before it's merged)? Thanks, Michael On Tue, 2 Jun 2020 at 22:44, Christian Brauner wrote: > > This adds the close_range() syscall. It allows to efficiently close a range > of file descriptors up to all file descriptors of a calling

Re: [PATCH v5 1/3] open: add close_range()

2020-06-02 Thread Christian Brauner
On Wed, Jun 03, 2020 at 01:30:57AM +0200, Florian Weimer wrote: > * Christian Brauner: > > > The performance is striking. For good measure, comparing the following > > simple close_all_fds() userspace implementation that is essentially just > > glibc's version in [6]: > > > > static int

Re: [PATCH v5 1/3] open: add close_range()

2020-06-02 Thread Florian Weimer
* Christian Brauner: > The performance is striking. For good measure, comparing the following > simple close_all_fds() userspace implementation that is essentially just > glibc's version in [6]: > > static int close_all_fds(void) > { > int dir_fd; > DIR *dir; > struct

[PATCH v5 1/3] open: add close_range()

2020-06-02 Thread Christian Brauner
This adds the close_range() syscall. It allows to efficiently close a range of file descriptors up to all file descriptors of a calling task. I've also coordinated with some FreeBSD developers who got in touch with me (Cced below). FreeBSD intends to add the same syscall once we merged it. Quite