vfork.S 566 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <features.h>
  7. #include <sys/syscall.h>
  8. #ifndef __NR_vfork
  9. /* No vfork so use fork instead */
  10. hidden_strong_alias(__libc_fork,__vfork)
  11. #else
  12. .text
  13. .global __vfork
  14. .hidden __vfork
  15. .type __vfork,%function
  16. .align 1<<4
  17. __vfork:
  18. popl %ecx
  19. movl $__NR_vfork,%eax
  20. int $0x80
  21. pushl %ecx
  22. cmpl $-4095,%eax
  23. jae __syscall_error
  24. ret
  25. .size __vfork,.-__vfork
  26. #endif
  27. weak_alias(__vfork,vfork)
  28. libc_hidden_def(vfork)