vfork.S 872 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * clone.S, part of the i960 support for the uClibc library.
  3. *
  4. * Copyright (C) 2002 by Okiok Data Ltd. http://www.okiok.com/
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. /*
  10. * Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu).
  11. */
  12. #include <sys/syscall.h>
  13. #ifndef __NR_vfork
  14. #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
  15. #endif
  16. .globl ___vfork
  17. .hidden ___vfork
  18. .type ___vfork,@function
  19. ___vfork:
  20. mov g13, r3
  21. ldconst __NR_vfork, g13
  22. calls 0
  23. mov r3, g13
  24. cmpible 0, g0, 1f
  25. subo g0, 0, r3
  26. st r3, _errno
  27. 1:
  28. ret
  29. weak_alias(__vfork,vfork)
  30. libc_hidden_def(vfork)