Systemd/src/nspawn
Michael Karcher 8869a0b40b util-lib: Add sparc64 support for process creation (#3348)
The current raw_clone function takes two arguments, the cloning flags and
a pointer to the stack for the cloned child. The raw cloning without
passing a "thread main" function does not make sense if a new stack is
specified, as it returns in both the parent and the child, which will fail
in the child as the stack is virgin. All uses of raw_clone indeed pass NULL
for the stack pointer which indicates that both processes should share the
stack address (so you better don't pass CLONE_VM).

This commit refactors the code to not require the caller to pass the stack
address, as NULL is the only sensible option. It also adds the magic code
needed to make raw_clone work on sparc64, which does not return 0 in %o0
for the child, but indicates the child process by setting %o1 to non-zero.
This refactoring is not plain aesthetic, because non-NULL stack addresses
need to get mangled before being passed to the clone syscall (you have to
apply STACK_BIAS), whereas NULL must not be mangled. Implementing the
conditional mangling of the stack address would needlessly complicate the
code.

raw_clone is moved to a separete header, because the burden of including
the assert machinery and sched.h shouldn't be applied to every user of
missing_syscalls.h
2016-05-29 20:03:51 -04:00
..
.gitignore nspawn: add new .nspawn files for container settings 2015-09-06 01:49:06 +02:00
Makefile build-sys: add stub makefiles to all subdirs to ease development with emacs 2012-04-13 21:37:59 +02:00
nspawn-cgroup.c core: update populated event handling in unified hierarchy 2016-03-26 12:05:57 -04:00
nspawn-cgroup.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-expose-ports.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-expose-ports.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-gperf.gperf tree-wide: port more code to use ifname_valid() 2016-05-09 15:45:31 +02:00
nspawn-mount.c prevent systemd-nspawn from trying to create target 2016-04-01 17:31:55 +02:00
nspawn-mount.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-network.c nspawn: add new --network-zone= switch for automatically managed bridge devices 2016-05-09 15:45:31 +02:00
nspawn-network.h nspawn: add new --network-zone= switch for automatically managed bridge devices 2016-05-09 15:45:31 +02:00
nspawn-patch-uid.c nspawn: rename is_procfs_sysfs_or_suchlike() to is_fs_fully_userns_compatible() 2016-05-26 22:39:34 +02:00
nspawn-patch-uid.h nspawn: optionally fix up OS tree uid/gids for userns 2016-04-25 12:15:57 +02:00
nspawn-register.c shared: move unit-specific code from bus-util.h to bus-unit-util.h 2016-04-22 16:06:20 +02:00
nspawn-register.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-seccomp.c nspawn: split out seccomp call into nspawn-seccomp.[ch] 2016-05-26 22:42:29 +02:00
nspawn-seccomp.h nspawn: split out seccomp call into nspawn-seccomp.[ch] 2016-05-26 22:42:29 +02:00
nspawn-settings.c nspawn: add new --network-zone= switch for automatically managed bridge devices 2016-05-09 15:45:31 +02:00
nspawn-settings.h nspawn: add new --network-zone= switch for automatically managed bridge devices 2016-05-09 15:45:31 +02:00
nspawn-setuid.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-setuid.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
nspawn-stub-pid1.c nspawn: optionally run a stub init process as PID 1 2016-02-03 23:58:24 +01:00
nspawn-stub-pid1.h nspawn: optionally run a stub init process as PID 1 2016-02-03 23:58:24 +01:00
nspawn.c util-lib: Add sparc64 support for process creation (#3348) 2016-05-29 20:03:51 -04:00
test-patch-uid.c nspawn: optionally fix up OS tree uid/gids for userns 2016-04-25 12:15:57 +02:00