From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v6 0/5] Add close_range, closefrom, and posix_spawn_file_actions_closefrom_np
Date: Wed, 23 Jun 2021 15:51:10 -0300 [thread overview]
Message-ID: <20210623185115.395812-1-adhemerval.zanella@linaro.org> (raw)
Linux v5.9 added a new close_range syscall, which allows the caller to
issue the kernel to close or set close-on-exec on a range of file
descriptors.
This patchset export the syscall along with two GNU extensions:
closefrom, with similar semantics from other systems ((Solaris, OpenBSD,
NetBSD, FreeBSD); and posix_spawn_file_actions_closefrom_np, which
allows use close_range semantic on posix_spawn().
The first two patches are libsupport support for the tests. The third
patch adds the Linux specific close_range syscall. The forth path adds
the GNU extension closefrom, which use close_range if available. The
final part adds the posix_spawn extension.
Adhemerval Zanella (5):
support: Add support_stack_alloc
support: Add xclone
linux: Add close_range
io: Add closefrom [BZ #10353]
posix: Add posix_spawn_file_actions_closefrom_np
NEWS | 12 +
include/bits/unistd_ext.h | 6 +
include/unistd.h | 1 +
io/Makefile | 4 +-
io/Versions | 3 +
io/closefrom.c | 34 ++
io/tst-closefrom.c | 152 +++++++++
manual/llio.texi | 55 ++++
posix/Makefile | 4 +-
posix/Versions | 1 +
posix/spawn.h | 8 +
posix/spawn_faction_addclosefrom.c | 57 ++++
posix/spawn_faction_destroy.c | 1 +
posix/spawn_int.h | 6 +
posix/tst-spawn5.c | 284 ++++++++++++++++
posix/unistd.h | 6 +
support/Makefile | 2 +
support/support.h | 19 ++
support/support_stack_alloc.c | 76 +++++
support/xclone.c | 50 +++
support/xsched.h | 34 ++
support/xsigstack.c | 43 +--
sysdeps/generic/spawn_int_def.h | 24 ++
sysdeps/mach/hurd/i386/libc.abilist | 2 +
sysdeps/mach/hurd/spawni.c | 4 +
sysdeps/posix/spawni.c | 4 +
sysdeps/unix/sysv/linux/Makefile | 6 +-
sysdeps/unix/sysv/linux/Versions | 1 +
sysdeps/unix/sysv/linux/aarch64/libc.abilist | 3 +
sysdeps/unix/sysv/linux/alpha/libc.abilist | 3 +
sysdeps/unix/sysv/linux/arc/libc.abilist | 3 +
sysdeps/unix/sysv/linux/arm/be/libc.abilist | 3 +
sysdeps/unix/sysv/linux/arm/le/libc.abilist | 3 +
sysdeps/unix/sysv/linux/bits/unistd_ext.h | 22 ++
sysdeps/unix/sysv/linux/closefrom.c | 36 +++
sysdeps/unix/sysv/linux/closefrom_fallback.c | 99 ++++++
sysdeps/unix/sysv/linux/csky/libc.abilist | 3 +
sysdeps/unix/sysv/linux/hppa/libc.abilist | 3 +
sysdeps/unix/sysv/linux/i386/libc.abilist | 3 +
sysdeps/unix/sysv/linux/ia64/libc.abilist | 3 +
.../sysv/linux/m68k/coldfire/libc.abilist | 3 +
.../unix/sysv/linux/m68k/m680x0/libc.abilist | 3 +
.../sysv/linux/microblaze/be/libc.abilist | 3 +
.../sysv/linux/microblaze/le/libc.abilist | 3 +
.../sysv/linux/mips/mips32/fpu/libc.abilist | 3 +
.../sysv/linux/mips/mips32/nofpu/libc.abilist | 3 +
.../sysv/linux/mips/mips64/n32/libc.abilist | 3 +
.../sysv/linux/mips/mips64/n64/libc.abilist | 3 +
sysdeps/unix/sysv/linux/nios2/libc.abilist | 3 +
.../linux/powerpc/powerpc32/fpu/libc.abilist | 3 +
.../powerpc/powerpc32/nofpu/libc.abilist | 3 +
.../linux/powerpc/powerpc64/be/libc.abilist | 3 +
.../linux/powerpc/powerpc64/le/libc.abilist | 3 +
.../unix/sysv/linux/riscv/rv32/libc.abilist | 3 +
.../unix/sysv/linux/riscv/rv64/libc.abilist | 3 +
.../unix/sysv/linux/s390/s390-32/libc.abilist | 3 +
.../unix/sysv/linux/s390/s390-64/libc.abilist | 3 +
sysdeps/unix/sysv/linux/sh/be/libc.abilist | 3 +
sysdeps/unix/sysv/linux/sh/le/libc.abilist | 3 +
.../sysv/linux/sparc/sparc32/libc.abilist | 3 +
.../sysv/linux/sparc/sparc64/libc.abilist | 3 +
sysdeps/unix/sysv/linux/spawn_int_def.h | 25 ++
sysdeps/unix/sysv/linux/spawni.c | 34 +-
sysdeps/unix/sysv/linux/syscalls.list | 1 +
sysdeps/unix/sysv/linux/tst-close_range.c | 303 ++++++++++++++++++
.../unix/sysv/linux/x86_64/64/libc.abilist | 3 +
.../unix/sysv/linux/x86_64/x32/libc.abilist | 3 +
67 files changed, 1458 insertions(+), 57 deletions(-)
create mode 100644 include/bits/unistd_ext.h
create mode 100644 io/closefrom.c
create mode 100644 io/tst-closefrom.c
create mode 100644 posix/spawn_faction_addclosefrom.c
create mode 100644 posix/tst-spawn5.c
create mode 100644 support/support_stack_alloc.c
create mode 100644 support/xclone.c
create mode 100644 support/xsched.h
create mode 100644 sysdeps/generic/spawn_int_def.h
create mode 100644 sysdeps/unix/sysv/linux/closefrom.c
create mode 100644 sysdeps/unix/sysv/linux/closefrom_fallback.c
create mode 100644 sysdeps/unix/sysv/linux/spawn_int_def.h
create mode 100644 sysdeps/unix/sysv/linux/tst-close_range.c
--
2.30.2
next reply other threads:[~2021-06-23 18:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 18:51 Adhemerval Zanella [this message]
2021-06-23 18:51 ` [PATCH v6 1/5] support: Add support_stack_alloc Adhemerval Zanella
2021-06-24 9:15 ` Florian Weimer
2021-06-24 11:33 ` Adhemerval Zanella
2021-06-23 18:51 ` [PATCH v6 2/5] support: Add xclone Adhemerval Zanella
2021-06-24 9:15 ` Florian Weimer
2021-06-23 18:51 ` [PATCH v6 3/5] linux: Add close_range Adhemerval Zanella
2021-06-27 17:23 ` Florian Weimer
2021-06-23 18:51 ` [PATCH v6 4/5] io: Add closefrom [BZ #10353] Adhemerval Zanella
2021-07-03 14:45 ` Jonathon Anderson
2021-07-05 20:26 ` Adhemerval Zanella
2021-07-06 11:37 ` Florian Weimer
2021-06-23 18:51 ` [PATCH v6 5/5] posix: Add posix_spawn_file_actions_closefrom_np Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210623185115.395812-1-adhemerval.zanella@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).