clone_cruft.h 623 B

123456789101112131415161718192021222324
  1. /* because people like to make things difficult */
  2. #undef do_clone
  3. #define crappy_sizeof(s) (s == NULL ? 0 : sizeof(s))
  4. #if defined __ia64__
  5. extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
  6. size_t __child_stack_size, int __flags, void *__arg, ...);
  7. # define do_clone(fn, stack, flags, arg) \
  8. __clone2(fn, stack, crappy_sizeof(stack), flags, arg, NULL, NULL, NULL)
  9. #elif defined __hppa__
  10. # define do_clone(fn, stack, flags, arg) \
  11. clone(fn, stack, flags, arg)
  12. #else
  13. # define do_clone(fn, stack, flags, arg) \
  14. clone(fn, stack+crappy_sizeof(stack), flags, arg)
  15. #endif