Date: Sun, 12 Apr 2020 15:09:07 -0700 From: Cy Schubert <Cy.Schubert@cschubert.com> To: Kyle Evans <kevans@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r359836 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/file Message-ID: <202004122209.03CM971W097282@slippy.cwsent.com> In-Reply-To: <202004122123.03CLNK82073001@repo.freebsd.org> References: <202004122123.03CLNK82073001@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <202004122123.03CLNK82073001@repo.freebsd.org>, Kyle Evans writes: > Author: kevans > Date: Sun Apr 12 21:23:19 2020 > New Revision: 359836 > URL: https://svnweb.freebsd.org/changeset/base/359836 > > Log: > Implement a close_range(2) syscall > > close_range(min, max, flags) allows for a range of descriptors to be > closed. The Python folk have indicated that they would much prefer this > interface to closefrom(2), as the case may be that they/someone have specia > l > fds dup'd to higher in the range and they can't necessarily closefrom(min) > because they don't want to hit the upper range, but relocating them to lowe > r > isn't necessarily feasible. > > sys_closefrom has been rewritten to use kern_close_range() using ~0U to > indicate closing to the end of the range. This was chosen rather than > requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the > call to kern_close_range for simplicity. > > The flags argument of close_range(2) is currently unused, so any flags set > is currently EINVAL. It was added to the interface in Linux so that future > flags could be added for, e.g., "halt on first error" and things of this > nature. > > This patch is based on a syscall of the same design that is expected to be > merged into Linux. > > Reviewed by: kib, markj, vangyzen (all slightly earlier revisions) > Differential Revision: https://reviews.freebsd.org/D21627 > > Modified: > head/include/unistd.h > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/Symbol.map > head/lib/libc/sys/closefrom.2 > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/capabilities.conf > head/sys/kern/kern_descrip.c > head/sys/kern/syscalls.master > head/sys/sys/syscallsubr.h > head/tests/sys/file/closefrom_test.c A __FreeBSD_version bump should be for ports to test for. -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004122209.03CM971W097282>