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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user