glibc/sysdeps/unix/sysv/linux/x86_64
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
..
64 linux: Add posix_spawnattr_{get, set}cgroup_np (BZ 26371) 2023-09-05 13:08:48 -03:00
x32 linux: Add posix_spawnattr_{get, set}cgroup_np (BZ 26371) 2023-09-05 13:08:48 -03:00
____longjmp_chk.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
__start_context.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
clone3.S Linux: Do not align the stack for __clone3 2023-02-01 08:42:11 -03:00
clone.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
configure configure: Use autoconf 2.71 2023-07-17 10:08:10 -04:00
configure.ac
dl-procinfo.c
dl-procinfo.h x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
getcontext.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Implies
kernel-features.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ldd-rewrite.sed Remove left over LD_LIBRARY_VERSION usages 2022-08-04 09:09:48 -03:00
libc_sigaction.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
libmvec.abilist x86-64: Add vector tan/tanf implementation to libmvec 2021-12-30 10:19:13 -08:00
makecontext.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
Makefile ldconfig/x86: Store ISA level in cache and aux cache 2021-01-13 05:51:17 -08:00
pointer_guard.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
setcontext.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
sigaltstack-offsets.sym
sigcontextinfo.h Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
single-thread.h Replace __libc_multiple_threads with __libc_single_threaded 2022-07-05 10:14:47 -03:00
swapcontext.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
syscall.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
syscalls.list linux: Consolidate Linux setsockopt implementation 2021-07-06 11:45:35 -03:00
sysdep.h Fix misspellings in sysdeps/unix -- BZ 25337 2023-05-23 11:59:23 +00:00
sysdep.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
tst-glibc-hwcaps-2.c Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
ucontext_i.sym x86-64/CET: Extend ucontext_t to save shadow stack 2018-07-25 06:37:31 -07:00
Versions Linux: Move timer_settime, __timer_settime64 from librt to libc 2021-06-28 09:51:01 +02:00
vfork.S Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
x86-64-isa-level-VALUE.c ldconfig/x86: Store ISA level in cache and aux cache 2021-01-13 05:51:17 -08:00