vfork.S 530 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 <sys/syscall.h>
  7. #ifndef __NR_vfork
  8. /* No vfork so use fork instead */
  9. # define __NR_vfork __NR_fork
  10. #endif
  11. .text
  12. .global __vfork
  13. .hidden __vfork
  14. .type __vfork,%function
  15. .align 1<<4
  16. __vfork:
  17. popl %ecx
  18. movl $__NR_vfork,%eax
  19. int $0x80
  20. pushl %ecx
  21. cmpl $-4095,%eax
  22. jae __syscall_error
  23. ret
  24. .size __vfork,.-__vfork
  25. weak_alias(__vfork,vfork)
  26. libc_hidden_weak(vfork)