vfork.h 794 B

12345678910111213141516171819202122232425262728293031
  1. /* orginally from include/unistd.h, written by ndf@linux.mit.edu> */
  2. #ifndef _M68K_VFORK_H
  3. #define _M68K_VFORK_H 1
  4. extern int _clone __P ((int (*fn)(void *arg), void *child_stack, int flags, void *arg));
  5. #ifndef __NR_vfork
  6. #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
  7. #endif
  8. #define vfork() ({ \
  9. unsigned long __res; \
  10. __asm__ __volatile__ ("movel %1,%%d0;" \
  11. "trap #0;" \
  12. "movel %%d0,%0" \
  13. : "=d" (__res) \
  14. : "0" (__NR_vfork) \
  15. : "%d0"); \
  16. if (__res >= (unsigned long)-4096) { \
  17. errno = -__res; \
  18. __res = (pid_t)-1; \
  19. } \
  20. (pid_t)__res; \
  21. })
  22. #define clone clone_not_available_use__clone
  23. #endif /* _M68K_VFORK_H */