From fb7cb5973283533cca7a7df6ca28753176ff310f Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 7 Jul 2019 18:01:21 +0200 Subject: Use __clone2 on ia64 clone has a different interfaces there, as the stack size needs to be known. --- src/firejail/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/firejail/main.c b/src/firejail/main.c index 34c6f4044..1e2488062 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -38,6 +38,15 @@ #include #include +#ifdef __ia64__ +/* clone(2) has a different interface on ia64, as it needs to know + the size of the stack */ +int __clone2(int (*fn)(void *), + void *child_stack_base, size_t stack_size, + int flags, void *arg, ... + /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ); +#endif + uid_t firejail_uid = 0; gid_t firejail_gid = 0; @@ -2541,10 +2550,18 @@ int main(int argc, char **argv) { EUID_ASSERT(); EUID_ROOT(); +#ifdef __ia64__ + child = __clone2(sandbox, + child_stack, + STACK_SIZE, + flags, + NULL); +#else child = clone(sandbox, child_stack + STACK_SIZE, flags, NULL); +#endif if (child == -1) errExit("clone"); EUID_USER(); -- cgit v1.2.3-70-g09d2