vfork.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * libc/sysdeps/linux/v850/vfork.S -- `vfork' syscall for linux/v850
  3. *
  4. * Copyright (C) 2001,2002 NEC Corporation
  5. * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU Lesser
  8. * General Public License. See the file COPYING.LIB in the main
  9. * directory of this archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #include <sys/syscall.h>
  14. #include <clinkage.h>
  15. /* Clone the calling process, but without copying the whole address space.
  16. The calling process is suspended until the new process exits or is
  17. replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
  18. and the process ID of the new process to the old process. */
  19. /* this should be made hidden */
  20. C_ENTRY (__vfork):
  21. addi SYS_vfork, r0, r12
  22. trap 0
  23. addi -125, r0, r11 /* minimum err value */
  24. cmp r11, r10
  25. bh 1f
  26. jmp [lp] /* normal return */
  27. 1: mov hilo(C_SYMBOL_NAME(errno)), r11
  28. subr r0, r10
  29. st.w r10, 0[r11]
  30. jmp [lp] /* error return */
  31. C_END(__vfork)
  32. weak_alias(__vfork,vfork)
  33. libc_hidden_def(vfork)