about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-01-27 10:11:30 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-02-02 08:34:16 -0300
commit6289d28d3c4e56f34830cfb011c31271ef850418 (patch)
tree32d0c4d7af2c5a6a9d293a1ea05eb0d45313e450 /sysdeps/unix/sysv/linux
parent3f35e7d193b7ff098467996ebf85b19c41d6d86e (diff)
downloadglibc-6289d28d3c4e56f34830cfb011c31271ef850418.tar.gz
glibc-6289d28d3c4e56f34830cfb011c31271ef850418.tar.xz
glibc-6289d28d3c4e56f34830cfb011c31271ef850418.zip
posix: Replace posix_spawnattr_tc{get,set}pgrp_np with posix_spawn_file_actions_addtcsetpgrp_np
The posix_spawnattr_tcsetpgrp_np works on a file descriptor (the
controlling terminal), so it would make more sense to actually fit
it on the file actions API.

Also, POSIX_SPAWN_TCSETPGROUP is not really required since it is
implicit by the presence of tcsetpgrp file action.

The posix/tst-spawn6.c is also fixed when TTY can is not present.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arc/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/csky/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/or1k/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c21
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist3
34 files changed, 43 insertions, 77 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 9dd574d9e2..1b63d9e447 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2615,5 +2615,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index f66704877e..e7e4cf7d2a 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2712,8 +2712,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 97aa3da1ad..bc3d228e31 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2376,5 +2376,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 18f4364856..db7039c4ab 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -495,8 +495,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 2c12c020b1..d2add4fb49 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -492,8 +492,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 7f28516feb..355d72a30c 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2651,5 +2651,4 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 9776f20763..3df39bb28c 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2600,8 +2600,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 96b50d0a9b..c4da358f80 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2784,8 +2784,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 9b2eebfbf1..241bac70ea 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2550,8 +2550,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 71cd35488e..78bf372b72 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -496,8 +496,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
 GLIBC_2.4 _IO_2_1_stdin_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index ced01a501d..00df5c901f 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2727,8 +2727,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 5406c01f1d..e8118569c3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2700,5 +2700,4 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 53b8ade4c3..c0d2373e64 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2697,5 +2697,4 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 919973ea46..2d0fd04f54 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2692,8 +2692,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index cf5a8dc120..e39ccfb312 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2690,8 +2690,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 003c3bd0a6..1e900f86e4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2698,8 +2698,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 73629c2f21..9145ba7931 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2601,8 +2601,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 9e8645ebc0..e95d60d926 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2739,5 +2739,4 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index 7ed49ee71e..ca934e374b 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -1379,6 +1379,7 @@ GLIBC_2.35 posix_spawn_file_actions_addclosefrom_np F
 GLIBC_2.35 posix_spawn_file_actions_adddup2 F
 GLIBC_2.35 posix_spawn_file_actions_addfchdir_np F
 GLIBC_2.35 posix_spawn_file_actions_addopen F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.35 posix_spawn_file_actions_destroy F
 GLIBC_2.35 posix_spawn_file_actions_init F
 GLIBC_2.35 posix_spawnattr_destroy F
@@ -1395,8 +1396,6 @@ GLIBC_2.35 posix_spawnattr_setschedparam F
 GLIBC_2.35 posix_spawnattr_setschedpolicy F
 GLIBC_2.35 posix_spawnattr_setsigdefault F
 GLIBC_2.35 posix_spawnattr_setsigmask F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
 GLIBC_2.35 posix_spawnp F
 GLIBC_2.35 ppoll F
 GLIBC_2.35 prctl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 3d1ba9887c..3820b9f235 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2754,8 +2754,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index d979a3b93b..464dc27fcd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2787,8 +2787,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 44688e52cf..2f7e58747f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2509,8 +2509,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 40682711eb..4f3043d913 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2811,5 +2811,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index e239d626b3..84b6ac815a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2378,5 +2378,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index ab0c4e7092..4d5c19c56a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2578,5 +2578,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 74e3a4651f..7c5ee8d569 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2752,8 +2752,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index e5553f06b2..50de0b46cf 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2546,8 +2546,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 9662041cd4..66fba013ca 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2607,8 +2607,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index bf90e924a6..38703f8aa0 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2604,8 +2604,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index ddb0d0621f..6df55eb765 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2747,8 +2747,7 @@ GLIBC_2.35 __epoll_pwait2_time64 F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
 GLIBC_2.4 _IO_sprintf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index ca14224cb7..b90569d881 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2573,8 +2573,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index 93359c708b..d703485e3f 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -164,17 +164,6 @@ __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 : __getpgid (0);
-      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
@@ -279,6 +268,16 @@ __spawni_child (void *arguments)
 		if (r != 0 && !__closefrom_fallback (lowfd, false))
 		  goto fail;
 	      } break;
+
+	    case spawn_do_tcsetpgrp:
+	      {
+		/* Check if it is possible to avoid an extra syscall.  */
+		pid_t pgrp = (attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
+			       && attr->__pgrp != 0
+			     ? attr->__pgrp : __getpgid (0);
+		if (__tcsetpgrp (action->action.setpgrp_action.fd, pgrp) != 0)
+		  goto fail;
+	      }
 	    }
 	}
     }
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 661d928adf..e88b0f101f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2524,8 +2524,7 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
 GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index bb8058dfa4..e0755272eb 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2630,5 +2630,4 @@ GLIBC_2.34 tss_set F
 GLIBC_2.35 __memcmpeq F
 GLIBC_2.35 _dl_find_object F
 GLIBC_2.35 epoll_pwait2 F
-GLIBC_2.35 posix_spawnattr_tcgetpgrp_np F
-GLIBC_2.35 posix_spawnattr_tcsetpgrp_np F
+GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F