summaryrefslogtreecommitdiffstats
path: root/test/unistd/clone_cruft.h
blob: ec4887aaf873f3355a399fb845289c4cd5a0b863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* because people like to make things difficult */

#undef do_clone

#define crappy_sizeof(s) (s == NULL ? 0 : sizeof(s))

#if defined __ia64__

extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
                     size_t __child_stack_size, int __flags, void *__arg, ...);
# define do_clone(fn, stack, flags, arg) \
	clone2(fn, stack, crappy_sizeof(stack), flags, arg, NULL, NULL, NULL)

#elif defined __hppa__

# define do_clone(fn, stack, flags, arg) \
	clone(fn, stack, flags, arg)

#else

# define do_clone(fn, stack, flags, arg) \
	clone(fn, stack+crappy_sizeof(stack), flags, arg)

#endif