summaryrefslogtreecommitdiffstats
path: root/src/basic/process-util.c
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-07-08 17:43:28 +0200
committerLuca Boccassi <bluca@debian.org>2023-07-10 12:39:35 +0200
commit840ac5cd1abbcee0c8def620bdabfb66d0707ebf (patch)
treeddb239eaccd3e6515a446c80a76736d842dbba9e /src/basic/process-util.c
parentCast st_dev to dev_t when printing (diff)
downloadsystemd-840ac5cd1abbcee0c8def620bdabfb66d0707ebf.tar.xz
systemd-840ac5cd1abbcee0c8def620bdabfb66d0707ebf.zip
process-util: use clone2 on ia64
glibc does not provide clone() on ia64, only clone2. But only as a symbol in the shared library, there's no prototype in the gblic headers, so we have to define it, copied from the manpage.
Diffstat (limited to 'src/basic/process-util.c')
-rw-r--r--src/basic/process-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 6cf882866f..7182e15b61 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -1177,7 +1177,11 @@ pid_t clone_with_nested_stack(int (*fn)(void *), int flags, void *userdata) {
mystack = (uint8_t*) mystack + ps; /* move pointer one page ahead since stacks usually grow backwards */
mystack = (void*) ALIGN_TO((uintptr_t) mystack, ps); /* align to page size (moving things further ahead) */
+#if HAVE_CLONE
pid = clone(fn, mystack, flags, userdata);
+#else
+ pid = __clone2(fn, mystack, ps, flags, userdata);
+#endif
if (pid < 0)
return -errno;