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
atomic_wide_counter.h
byteswap.h
confname.h
dirent_ext.h
dirent.h
dl_find_object.h
dlfcn.h
elfclass.h
endian.h
environments.h
errno.h
fcntl.h
fenv.h
floatn-common.h
floatn.h
flt-eval-method.h
fp-fast.h
fp-logb.h
hwcap.h
in.h
indirect-return.h
ioctl-types.h
ioctls.h
ipc.h
ipctypes.h
iscanonical.h
libc-header-start.h
libm-simd-decl-stubs.h
link_lavcurrent.h
link.h
local_lim.h
long-double.h
math-vector.h
mathdef.h
mman_ext.h
mman.h
mqueue.h
msq.h
netdb.h
param.h
poll.h
posix_opt.h
pthreadtypes.h
resource.h
sched.h
select.h
sem.h
setjmp.h
shm.h
sigaction.h
sigcontext.h
sigevent-consts.h
siginfo-consts.h
signal_ext.h
signum-arch.h
signum-generic.h
sigstack.h
sigstksz.h
sigthread.h
sockaddr.h
socket.h
spawn_ext.h
ss_flags.h
stat.h
statfs.h
statvfs.h
stdint-intn.h
stdint-uintn.h
stdlib-bsearch.h
syslog-path.h
sysmacros.h
termios.h
time64.h
time.h
timesize.h
typesizes.h
uintn-identity.h
uio_lim.h
uio-ext.h
unistd_ext.h
utmp.h
utsname.h
waitflags.h
waitstatus.h
wchar.h
wordsize.h