On Mon, 15.12.14 08:01, Ken Werner ([email protected]) wrote:
> From: Ken Werner <[email protected]>
>
> Since the order of the first and second arguments of the raw clone()
> system call is reversed on s390 and cris it needs to be invoked differently.
>
> Signed-off-by: Ken Werner <[email protected]>
Hmm, I'd prefer if we could move the definition of this syscall
wrapper into missing.h, and do the per-arch magic there, like we do
for all the other syscalls missing from glibc. Maybe call the function
"raw_clone()" there or so.
Alternatively we could move to the glibc-provided wrapper, but I think
it's nastier to use, since it requires a stack parameter to be
specified.
> @@ -3133,9 +3133,17 @@ int main(int argc, char *argv[]) {
> goto finish;
> }
>
> +#if defined(__s390__) || defined(__CRIS)
> + /* On s390 and cris the order of the first and second
> arguments
> + * of the raw clone() system call is reversed. */
> + pid = syscall(__NR_clone, NULL, SIGCHLD|CLONE_NEWNS|
> + (arg_share_system ? 0 :
> CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWUTS)|
> + (arg_private_network ?
> CLONE_NEWNET : 0));
> +#else
> pid = syscall(__NR_clone, SIGCHLD|CLONE_NEWNS|
> (arg_share_system ? 0 :
> CLONE_NEWIPC|CLONE_NEWPID|CLONE_NEWUTS)|
> (arg_private_network ?
> CLONE_NEWNET : 0), NULL);
> +#endif
> if (pid < 0) {
> if (errno == EINVAL)
> r = log_error_errno(errno, "clone() failed,
> do you have namespace support enabled in your kernel? (You need UTS, IPC, PID
> and NET namespacing built in): %m");
> --
> 1.7.1
>
> _______________________________________________
> systemd-devel mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Lennart
--
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel