glibc/bits
Adhemerval Zanella Netto ce2bfb8569 linux: Add posix_spawnattr_{get, set}cgroup_np (BZ 26371)
These functions allow to posix_spawn and posix_spawnp to use
CLONE_INTO_CGROUP with clone3, allowing the child process to
be created in a different cgroup version 2.  These are GNU
extensions that are available only for Linux, and also only
for the architectures that implement clone3 wrapper
(HAVE_CLONE3_WRAPPER).

To create a process on a different cgroupv2, one can use the:

  posix_spawnattr_t attr;
  posix_spawnattr_init (&attr);
  posix_spawnattr_setflags (&attr, POSIX_SPAWN_SETCGROUP);
  posix_spawnattr_setcgroup_np (&attr, cgroup);
  posix_spawn (...)

Similar to other posix_spawn flags, POSIX_SPAWN_SETCGROUP control
whether the cgroup file descriptor will be used or not with
clone3.

There is no fallback if either clone3 does not support the flag
or if the architecture does not provide the clone3 wrapper, in
this case posix_spawn returns EOPNOTSUPP.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2023-09-05 13:08:48 -03:00
..
types Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
atomic_wide_counter.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
byteswap.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
confname.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dirent_ext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dirent.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dl_find_object.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
dlfcn.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
elfclass.h Update. 1999-07-27 05:53:25 +00:00
endian.h Update. 1997-11-26 04:23:08 +00:00
environments.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
errno.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fcntl.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fenv.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
floatn-common.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
floatn.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
flt-eval-method.h Remap __GLIBC_FLT_EVAL_METHOD to 0 if __FLT_EVAL_METHOD__ is -1 2023-04-28 07:02:48 -07:00
fp-fast.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
fp-logb.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hwcap.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
in.h [hurd] Add MTU_DISCOVER values 2023-02-15 15:14:06 +01:00
indirect-return.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ioctl-types.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ioctls.h Update. 1997-11-26 04:23:08 +00:00
ipc.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ipctypes.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
iscanonical.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
libc-header-start.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
libm-simd-decl-stubs.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
link_lavcurrent.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
link.h * csu/elf-init.c (__libc_csu_fini): Don't do anything here. 2005-01-06 22:40:27 +00:00
local_lim.h Update. 1997-10-15 05:34:02 +00:00
long-double.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
math-vector.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mathdef.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mman_ext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mman.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mqueue.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
msq.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
netdb.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
param.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
poll.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
posix_opt.h Update. 1997-10-15 05:34:02 +00:00
pthreadtypes.h 2002-11-10 Roland McGrath <roland@redhat.com> 2002-11-10 23:22:35 +00:00
resource.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sched.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
select.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sem.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
setjmp.h Update. 1997-11-26 04:23:08 +00:00
shm.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigaction.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigcontext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigevent-consts.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
siginfo-consts.h Fix all the remaining misspellings -- BZ 25337 2023-06-02 01:39:48 +00:00
signal_ext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
signum-arch.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
signum-generic.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigstack.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigstksz.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigthread.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sockaddr.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
socket.h Fix all the remaining misspellings -- BZ 25337 2023-06-02 01:39:48 +00:00
spawn_ext.h linux: Add posix_spawnattr_{get, set}cgroup_np (BZ 26371) 2023-09-05 13:08:48 -03:00
ss_flags.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stat.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
statfs.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
statvfs.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stdint-intn.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stdint-uintn.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
stdlib-bsearch.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
syslog-path.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sysmacros.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
termios.h hurd: Fix tcflag_t and speed_t types on 64-bit 2023-02-12 20:03:18 +01:00
time64.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
time.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
timesize.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
typesizes.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
uintn-identity.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
uio_lim.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
uio-ext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
unistd_ext.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
utmp.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
utsname.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
waitflags.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
waitstatus.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wchar.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wordsize.h Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00