]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/test/unistd/clone_cruft.h
Inital import
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / test / unistd / clone_cruft.h
1 /* because people like to make things difficult */
2
3 #undef do_clone
4
5 #define crappy_sizeof(s) (s == NULL ? 0 : sizeof(s))
6
7 #if defined __ia64__
8
9 extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
10                      size_t __child_stack_size, int __flags, void *__arg, ...);
11 # define do_clone(fn, stack, flags, arg) \
12         __clone2(fn, stack, crappy_sizeof(stack), flags, arg, NULL, NULL, NULL)
13
14 #elif defined __hppa__
15
16 # define do_clone(fn, stack, flags, arg) \
17         clone(fn, stack, flags, arg)
18
19 #else
20
21 # define do_clone(fn, stack, flags, arg) \
22         clone(fn, stack+crappy_sizeof(stack), flags, arg)
23
24 #endif