Linux: Do not align the stack for __clone3
[glibc.git] / include / clone_internal.h
blobf8198d805957945749bb443d0fca2cca362de7f1
1 #ifndef _CLONE_INTERNAL_H
2 #define _CLONE_INTERNAL_H
4 #include <clone3.h>
6 /* The clone3 syscall provides a superset of the functionality of the clone
7 interface. The kernel might extend __CL_ARGS struct in the future, with
8 each version with a diffent __SIZE. If the child is created, it will
9 start __FUNC function with __ARG arguments.
11 Different than kernel, the implementation also returns EINVAL for an
12 invalid NULL __CL_ARGS or __FUNC (similar to __clone).
14 All callers are responsible for correctly aligning the stack. The stack is
15 not aligned prior to the syscall (this differs from the exported __clone).
17 This function is only implemented if the ABI defines HAVE_CLONE3_WRAPPER.
19 extern int __clone3 (struct clone_args *__cl_args, size_t __size,
20 int (*__func) (void *__arg), void *__arg);
22 /* The internal wrapper of clone/clone2 and clone3. Different than __clone3,
23 it will align the stack if required. If __clone3 returns -1 with ENOSYS,
24 fall back to clone or clone2. */
25 extern int __clone_internal (struct clone_args *__cl_args,
26 int (*__func) (void *__arg), void *__arg);
28 #ifndef _ISOMAC
29 libc_hidden_proto (__clone3)
30 libc_hidden_proto (__clone_internal)
31 #endif
33 #endif