From 4051c3a10c72f7a745a0d7e7d3f3b5772f55c88d Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 14 Jun 2021 14:41:31 -0300 Subject: [PATCH] posix: Add terminal control setting support for posix_spawn Currently there is no proper way to set the controlling terminal through posix_spawn() in race free manner [1]. This forces shell implementations to keep using fork()+exec() when launching background process groups, even when using posix_spawn() yields better performance. This patch adds a new GNU extension so the creating process can configure the creating process terminal group. This is done with a new flag, POSIX_SPAWN_TCSETPGROUP, along with two new attribute functions, posix_spawnattr_tcsetpgrp_np(), and posix_spawnattr_tcgetpgrp_np(). The function sets a new attribute, spawn-tcgroupfd, that references to the controlling terminal. The controlling terminal is set after the spawn-pgroup attribute, and uses the spawn-tcgroupfd along with current creating process group (so it is composable with POSIX_SPAWN_SETPGROUP). To create a process and set the controlling terminal, one can use the following sequence: posix_spawnattr_t attr; posix_spawnattr_init (&attr); posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP); posix_spawnattr_tcsetpgrp_np (&attr, tcfd); If the idea is also to create a new process groups: posix_spawnattr_t attr; posix_spawnattr_init (&attr); posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP | POSIX_SPAWN_SETPGROUP); posix_spawnattr_tcsetpgrp_np (&attr, tcfd); posix_spawnattr_setpgroup (&attr, 0); The controlling terminal file descriptor is ignored if the new flag is not set. This interface is slight different than the one provided by QNX [2], which it only provides the POSIX_SPAWN_TCSETPGROUP flag. The QNX documentation is not on how the controlling terminal is obtained not how it iteracts with POSIX_SPAWN_SETPGROUP. Since a glibc implementation is library based, I moving the controlling terminal open to the caller should be more straighforward since it mimics the tcsetpgrp(), and allow less error handling by posix_spawn(). Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://github.com/ksh93/ksh/issues/79 [2] https://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/posix_spawn.html --- NEWS | 5 + include/unistd.h | 5 +- posix/Makefile | 4 +- posix/Versions | 2 + posix/spawn.h | 16 +- posix/spawnattr_setflags.c | 3 +- posix/spawnattr_tcgetpgrp.c | 26 +++ posix/spawnattr_tcsetpgrp.c | 26 +++ posix/tst-spawn5.c | 167 ++++++++++++++++++ sysdeps/generic/libc.abilist | 2 + sysdeps/mach/hurd/i386/libc.abilist | 2 + sysdeps/mach/hurd/spawni.c | 13 ++ sysdeps/unix/bsd/tcsetpgrp.c | 4 +- sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 + sysdeps/unix/sysv/linux/arc/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + .../sysv/linux/mips/mips64/n64/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../linux/powerpc/powerpc64/be/libc.abilist | 2 + .../linux/powerpc/powerpc64/le/libc.abilist | 2 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 2 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + .../sysv/linux/sparc/sparc64/libc.abilist | 2 + sysdeps/unix/sysv/linux/spawni.c | 14 ++ sysdeps/unix/sysv/linux/syscalls.list | 2 +- .../unix/sysv/linux/x86_64/64/libc.abilist | 2 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 2 + termios/tcsetpgrp.c | 5 +- 48 files changed, 352 insertions(+), 8 deletions(-) create mode 100644 posix/spawnattr_tcgetpgrp.c create mode 100644 posix/spawnattr_tcsetpgrp.c create mode 100644 posix/tst-spawn5.c diff --git a/NEWS b/NEWS index 60933bd975b..398ed0dda52 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,11 @@ Major new features: to call async-signal-safe functions (such as raise or execve). This function is currently a GNU extension. +* The functions posix_spawnattr_tcsetpgrp_np and posix_spawnattr_tcgetpgrp_np + have benn added, enabling posix_spawn and posix_spawnp to set the + controlling terminal in the new process in a non race manner. These + functions are GNU extensions. + Deprecated and removed features, and other changes affecting compatibility: * The function pthread_mutex_consistent_np has been deprecated; programs diff --git a/include/unistd.h b/include/unistd.h index 691405a945a..e3a7c6dfdca 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -171,7 +171,10 @@ extern int __ftruncate64 (int __fd, __off64_t __length) attribute_hidden; extern int __truncate (const char *path, __off_t __length); extern void *__sbrk (intptr_t __delta); libc_hidden_proto (__sbrk) - +extern int __tcsetpgrp (int fd, __pid_t pgrp); +libc_hidden_proto (__tcsetpgrp) +extern pid_t __getpgrp (void); +libc_hidden_proto (__getpgrp); /* This variable is set nonzero at startup if the process's effective IDs differ from its real IDs, or it is otherwise indicated that diff --git a/posix/Makefile b/posix/Makefile index e91ea25ba14..f2462cf22a3 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -63,6 +63,7 @@ routines := \ spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni \ spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \ spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \ + spawnattr_tcgetpgrp spawnattr_tcsetpgrp \ posix_madvise \ get_child_max sched_cpucount sched_cpualloc sched_cpufree \ streams-compat \ @@ -106,7 +107,7 @@ tests := test-errno tstgetopt testfnm runtests runptests \ tst-sysconf-empty-chroot tst-glob_symlinks tst-fexecve \ tst-glob-tilde test-ssize-max tst-spawn4 bug-regex37 \ bug-regex38 tst-regcomp-truncated tst-spawn-chdir \ - tst-wordexp-nocmd tst-execveat + tst-wordexp-nocmd tst-execveat tst-spawn5 # Test for the glob symbol version that was replaced in glibc 2.27. ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes) @@ -275,6 +276,7 @@ tst-exec-ARGS = -- $(host-test-program-cmd) tst-exec-static-ARGS = $(tst-exec-ARGS) tst-execvpe5-ARGS = -- $(host-test-program-cmd) tst-spawn-ARGS = -- $(host-test-program-cmd) +tst-spawn5-ARGS = -- $(host-test-program-cmd) tst-spawn-static-ARGS = $(tst-spawn-ARGS) tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir tst-chmod-ARGS = $(objdir) diff --git a/posix/Versions b/posix/Versions index ee1f4121852..86704cf2503 100644 --- a/posix/Versions +++ b/posix/Versions @@ -154,6 +154,8 @@ libc { GLIBC_2.34 { _Fork; execveat; + posix_spawnattr_tcgetpgrp_np; + posix_spawnattr_tcsetpgrp_np; } GLIBC_PRIVATE { __libc_fork; __libc_pread; __libc_pwrite; diff --git a/posix/spawn.h b/posix/spawn.h index a29da028cc2..a04d33744d9 100644 --- a/posix/spawn.h +++ b/posix/spawn.h @@ -34,7 +34,8 @@ typedef struct sigset_t __ss; struct sched_param __sp; int __policy; - int __pad[16]; + int __ctty_fd; + int __pad[15]; } posix_spawnattr_t; @@ -59,6 +60,7 @@ typedef struct #ifdef __USE_GNU # define POSIX_SPAWN_USEVFORK 0x40 # define POSIX_SPAWN_SETSID 0x80 +# define POSIX_SPAWN_TCSETPGROUP 0x100 #endif @@ -166,6 +168,18 @@ extern int posix_spawnattr_setschedparam (posix_spawnattr_t *__restrict __attr, __restrict __schedparam) __THROW __nonnull ((1, 2)); +#ifdef __USE_GNU +/* Make the spawned process the foreground process group on the terminal + associated with FD (which must be a controlling terminal, and still be + associated with its session). */ +extern int posix_spawnattr_tcsetpgrp_np (posix_spawnattr_t *__attr, int fd) + __THROW __nonnull ((1)); + +/* Return the associated terminal FD in the attribute structure. */ +extern int posix_spawnattr_tcgetpgrp_np (const posix_spawnattr_t * + __restrict __attr, int *fd) + __THROW __nonnull ((1, 2)); +#endif /* Initialize data structure for file attribute for `spawn' call. */ extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t * diff --git a/posix/spawnattr_setflags.c b/posix/spawnattr_setflags.c index 2b033a50fc0..95f521d04d7 100644 --- a/posix/spawnattr_setflags.c +++ b/posix/spawnattr_setflags.c @@ -26,7 +26,8 @@ | POSIX_SPAWN_SETSCHEDPARAM \ | POSIX_SPAWN_SETSCHEDULER \ | POSIX_SPAWN_SETSID \ - | POSIX_SPAWN_USEVFORK) + | POSIX_SPAWN_USEVFORK \ + | POSIX_SPAWN_TCSETPGROUP) /* Store flags in the attribute structure. */ int diff --git a/posix/spawnattr_tcgetpgrp.c b/posix/spawnattr_tcgetpgrp.c new file mode 100644 index 00000000000..6d5dcd438b7 --- /dev/null +++ b/posix/spawnattr_tcgetpgrp.c @@ -0,0 +1,26 @@ +/* Get the controlling terminal option. + Copyright (C) 2000-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +int +posix_spawnattr_tcgetpgrp_np (const posix_spawnattr_t *attr, int *fd) +{ + *fd = attr->__ctty_fd; + return 0; +} diff --git a/posix/spawnattr_tcsetpgrp.c b/posix/spawnattr_tcsetpgrp.c new file mode 100644 index 00000000000..b1b5d5dba01 --- /dev/null +++ b/posix/spawnattr_tcsetpgrp.c @@ -0,0 +1,26 @@ +/* Set the controlling terminal option. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +int +posix_spawnattr_tcsetpgrp_np (posix_spawnattr_t *attr, int fd) +{ + attr->__ctty_fd = fd; + return 0; +} diff --git a/posix/tst-spawn5.c b/posix/tst-spawn5.c new file mode 100644 index 00000000000..85fbf321ba9 --- /dev/null +++ b/posix/tst-spawn5.c @@ -0,0 +1,167 @@ +/* Check posix_spawn set controlling terminal extension. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int +handle_restart (const char *argv1) +{ + bool setpgrp = strcmp (argv1, "setgrpr") == 0; + int fd = xopen (_PATH_TTY, O_RDONLY, 0600); + + /* If process group is not changed (POSIX_SPAWN_SETPGROUP), then check + the creating process one, otherwise check against the process group + itself. */ + pid_t pgrp; + if (!setpgrp) + TEST_COMPARE (sscanf (argv1, "%d", &pgrp), 1); + else + pgrp = getpgrp (); + TEST_COMPARE (tcgetpgrp (fd), pgrp); + + xclose (fd); + return 0; +} + +static int restart; +#define CMDLINE_OPTIONS \ + { "restart", no_argument, &restart, 1 }, + +static void +run_subprogram (int argc, char *argv[], const posix_spawnattr_t *attr, + int exp_err) +{ + short int flags; + TEST_COMPARE (posix_spawnattr_getflags (attr, &flags), 0); + bool setpgrp = flags & POSIX_SPAWN_SETPGROUP; + + char *spargv[9]; + char pgrp[INT_STRLEN_BOUND (pid_t)]; + + int i = 0; + for (; i < argc - 1; i++) + spargv[i] = argv[i + 1]; + spargv[i++] = (char *) "--direct"; + spargv[i++] = (char *) "--restart"; + if (setpgrp) + spargv[i++] = (char *) "setgrpr"; + else + { + snprintf (pgrp, sizeof pgrp, "%d", getpgrp ()); + spargv[i++] = pgrp; + } + spargv[i] = NULL; + + pid_t pid; + TEST_COMPARE (posix_spawn (&pid, argv[1], NULL, attr, spargv, environ), + exp_err); + if (exp_err != 0) + return; + + int status; + TEST_COMPARE (xwaitpid (pid, &status, WUNTRACED), pid); + TEST_VERIFY (WIFEXITED (status)); + TEST_VERIFY (!WIFSTOPPED (status)); + TEST_VERIFY (!WIFSIGNALED (status)); + TEST_COMPARE (WEXITSTATUS (status), 0); +} + +static int +do_test (int argc, char *argv[]) +{ + /* We must have either: + - One our fource parameters left if called initially: + + path to ld.so optional + + "--library-path" optional + + the library path optional + + the application name + - six parameters left if called through re-execution: + + --setgrpr optional + */ + + if (restart) + return handle_restart (argv[1]); + + int tcfd = xopen (_PATH_TTY, O_RDONLY, 0600); + + /* Check getters and setters. */ + { + posix_spawnattr_t attr; + TEST_COMPARE (posix_spawnattr_init (&attr), 0); + TEST_COMPARE (posix_spawnattr_tcsetpgrp_np (&attr, tcfd), 0); + + int fd; + TEST_COMPARE (posix_spawnattr_tcgetpgrp_np (&attr, &fd), 0); + TEST_COMPARE (tcfd, fd); + } + + /* Check setting the controlling terminal without changing the group. */ + { + posix_spawnattr_t attr; + TEST_COMPARE (posix_spawnattr_init (&attr), 0); + TEST_COMPARE (posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP), + 0); + TEST_COMPARE (posix_spawnattr_tcsetpgrp_np (&attr, tcfd), 0); + + run_subprogram (argc, argv, &attr, 0); + } + + /* Check setting both the controlling terminal and the create a new process + group. */ + { + posix_spawnattr_t attr; + TEST_COMPARE (posix_spawnattr_init (&attr), 0); + TEST_COMPARE (posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP + | POSIX_SPAWN_SETPGROUP), + 0); + TEST_COMPARE (posix_spawnattr_setpgroup (&attr, 0), 0); + TEST_COMPARE (posix_spawnattr_tcsetpgrp_np (&attr, tcfd), 0); + + run_subprogram (argc, argv, &attr, 0); + } + + /* Trying to set the controlling terminal after a setsid() incurs in a ENOTTY + from tcsetpgrp. */ + { + posix_spawnattr_t attr; + TEST_COMPARE (posix_spawnattr_init (&attr), 0); + TEST_COMPARE (posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP + | POSIX_SPAWN_SETSID), 0); + TEST_COMPARE (posix_spawnattr_tcsetpgrp_np (&attr, tcfd), 0); + + run_subprogram (argc, argv, &attr, ENOTTY); + } + + xclose (tcfd); + + return 0; +} + +#define TEST_FUNCTION_ARGV do_test +#include diff --git a/sysdeps/generic/libc.abilist b/sysdeps/generic/libc.abilist index e69de29bb2d..72f9b9c5b02 100644 --- a/sysdeps/generic/libc.abilist +++ b/sysdeps/generic/libc.abilist @@ -0,0 +1,2 @@ +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 120131a7688..7d2a0ae0b90 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2229,6 +2229,8 @@ GLIBC_2.34 dlopen F GLIBC_2.34 dlsym F GLIBC_2.34 dlvsym F GLIBC_2.34 execveat F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 shm_open F GLIBC_2.34 shm_unlink F GLIBC_2.34 timespec_getres F diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c index b5c92365f23..2646ad128a5 100644 --- a/sysdeps/mach/hurd/spawni.c +++ b/sysdeps/mach/hurd/spawni.c @@ -390,6 +390,19 @@ __spawni (pid_t *pid, const char *file, if (!err && (flags & POSIX_SPAWN_SETPGROUP) != 0) err = __proc_setpgrp (proc, new_pid, attrp->__pgrp); + /* Set the controlling terminal. */ + if (!err && (flags & POSIX_SPAWN_TCSETPGROUP) != 0) + { + pid_t pgrp; + /* Check if it is possible to avoid an extra syscall. */ + if ((attrp->__flags & POSIX_SPAWN_SETPGROUP) != 0 && attrp->__pgrp != 0) + pgrp = attrp->__pgrp; + else + err = __proc_getpgrp (proc, new_pid, &pgrp); + if (!err) + err = __tcsetpgrp (attrp->__tcpgrp, pgrp); + } + /* Set the effective user and group IDs. */ if (!err && (flags & POSIX_SPAWN_RESETIDS) != 0) { diff --git a/sysdeps/unix/bsd/tcsetpgrp.c b/sysdeps/unix/bsd/tcsetpgrp.c index 98c88db3ae8..3930b4f6741 100644 --- a/sysdeps/unix/bsd/tcsetpgrp.c +++ b/sysdeps/unix/bsd/tcsetpgrp.c @@ -22,7 +22,9 @@ /* Set the foreground process group ID of FD set PGRP_ID. */ int -tcsetpgrp (int fd, pid_t pgrp_id) +__tcsetpgrp (int fd, pid_t pgrp_id) { return __ioctl (fd, TIOCSPGRP, &pgrp_id); } +weak_alias (__tcsetpgrp, tcsetpgrp) +libc_hidden_def (__tcsetpgrp) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 4736a5966f8..3372f796a55 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2433,6 +2433,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 89257e39c15..736f25085d0 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2532,6 +2532,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index e1eef248779..76f5f52433e 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2192,6 +2192,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 19d609e058d..3ebe9f5cffa 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -335,6 +335,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 371274917a8..7e1a7456434 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -332,6 +332,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index ee2ffbabc4a..de891440fab 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2457,6 +2457,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index c6d4d2478e5..f2f7a7eed8b 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2410,6 +2410,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index f4e30827849..fcaa323ff6d 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2594,6 +2594,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 8c13d880529..5126b6d386a 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2370,6 +2370,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 43a692714f7..9f405bc4275 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -336,6 +336,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 901f086bfaa..b6c772fdecc 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2537,6 +2537,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index d14576eb2e8..1eadabc0c8f 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2508,6 +2508,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index b01add6f6c4..0db6f11cff8 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2505,6 +2505,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index ea5fee313d2..52c21f3ce89 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2502,6 +2502,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 5f20e5f3fcc..72d13369201 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2500,6 +2500,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index f3c90812426..b0821e2ed0e 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2508,6 +2508,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 2e10c747a25..557a89db2f4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2421,6 +2421,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 36563055a8a..1059a983974 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2547,6 +2547,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 229731b5756..8db893623e9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2564,6 +2564,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 8b3bdc0909d..8c4d420b7c9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2597,6 +2597,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 5797cc29c17..8085f1cd0e0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2334,6 +2334,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index a60d9b5d128..e6d3c7b1870 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2629,6 +2629,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 0c32c81af08..45855bac594 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2194,6 +2194,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index df65b693746..4bb0afdaea9 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2394,6 +2394,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 5497df2f618..4252a5d36bb 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2562,6 +2562,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 8a050a93747..2825b8cc3a6 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2371,6 +2371,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 8de0cd37f38..1689be72941 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2417,6 +2417,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index ef67585b2ad..ef317aa3d07 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2414,6 +2414,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index ee2aa17bcaf..27d9d173192 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2557,6 +2557,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 8a0cd15b428..363597570d1 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2393,6 +2393,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index 3b435e6c869..9e803b07280 100644 --- a/sysdeps/unix/sysv/linux/spawni.c +++ b/sysdeps/unix/sysv/linux/spawni.c @@ -33,6 +33,9 @@ #include #include "spawn_int.h" +_Static_assert (sizeof (posix_spawnattr_t) == 336, + "sizeof (posix_spawnattr_t) != 336"); + /* The Linux implementation of posix_spawn{p} uses the clone syscall directly with CLONE_VM and CLONE_VFORK flags and an allocated stack. The new stack and start function solves most the vfork limitation (possible parent @@ -184,6 +187,17 @@ __spawni_child (void *arguments) && __setpgid (0, attr->__pgrp) != 0) goto fail; + /* Set the controlling terminal. */ + if ((attr->__flags & POSIX_SPAWN_TCSETPGROUP) != 0) + { + /* Check if it is possible to avoid an extra syscall. */ + pid_t pgrp = (attr->__flags & POSIX_SPAWN_SETPGROUP) != 0 + && attr->__pgrp != 0 + ? attr->__pgrp : __getpgrp (); + if (__tcsetpgrp (attr->__ctty_fd, pgrp) != 0) + goto fail; + } + /* Set the effective user and group IDs. */ if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0 && (local_seteuid (__getuid ()) != 0 diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 62329abb49d..4914f44a882 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -17,7 +17,7 @@ getpid - getpid Ei: __getpid getpid getegid - getegid Ei: __getegid getegid geteuid - geteuid Ei: __geteuid geteuid getpgid - getpgid i:i __getpgid getpgid -getpgrp - getpgrp Ei: getpgrp +getpgrp - getpgrp Ei: __getpgrp getpgrp getppid - getppid Ei: __getppid getppid getresuid - getresuid i:ppp getresuid getresgid - getresgid i:ppp getresgid diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 63a7bc8388b..53492b89c93 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2349,6 +2349,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index cc128a6b9be..ca5fcb02ffa 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2448,6 +2448,8 @@ GLIBC_2.34 mtx_lock F GLIBC_2.34 mtx_timedlock F GLIBC_2.34 mtx_trylock F GLIBC_2.34 mtx_unlock F +GLIBC_2.34 posix_spawnattr_tcgetpgrp_np F +GLIBC_2.34 posix_spawnattr_tcsetpgrp_np F GLIBC_2.34 pthread_attr_getaffinity_np F GLIBC_2.34 pthread_attr_getguardsize F GLIBC_2.34 pthread_attr_getstack F diff --git a/termios/tcsetpgrp.c b/termios/tcsetpgrp.c index 05630cd04cb..9bd94a70bc9 100644 --- a/termios/tcsetpgrp.c +++ b/termios/tcsetpgrp.c @@ -21,7 +21,7 @@ /* Set the foreground process group ID of FD set PGRP_ID. */ int -tcsetpgrp (int fd, pid_t pgrp_id) +__tcsetpgrp (int fd, pid_t pgrp_id) { if (fd < 0) { @@ -32,6 +32,7 @@ tcsetpgrp (int fd, pid_t pgrp_id) __set_errno (ENOSYS); return -1; } - +weak_alias (__tcsetpgrp, tcsetpgrp); +libc_hidden_def (__tcsetpgrp) stub_warning (tcsetpgrp)