vfork.S 519 B

123456789101112131415161718192021222324252627282930313233
  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. __vfork:
  16. popl %ecx
  17. movl $__NR_vfork,%eax
  18. int $0x80
  19. pushl %ecx
  20. cmpl $-4095,%eax
  21. jae __syscall_error
  22. ret
  23. .size __vfork,.-__vfork
  24. weak_alias(__vfork,vfork)
  25. libc_hidden_def(vfork)