fork.c 650 B

12345678910111213141516171819
  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 "sysdep.h"
  7. #define __NR___libc_fork __NR_fork
  8. SYSCALL__ (__libc_fork, 0)
  9. /* R1 is now 0 for the parent and 1 for the child. Decrement it to
  10. make it -1 (all bits set) for the parent, and 0 (no bits set)
  11. for the child. Then AND it with R0, so the parent gets
  12. R0&-1==R0, and the child gets R0&0==0. */
  13. /* i dunno what the blurb above is useful for. we just return. */
  14. __asm__("ret\n\tnop");
  15. /* libc_hidden_proto(fork) */
  16. weak_alias(__libc_fork,fork)
  17. libc_hidden_weak(fork)