fork.c 451 B

123456789101112
  1. #include <sysdep.h>
  2. #define __NR___libc_fork __NR_fork
  3. SYSCALL__ (__libc_fork, 0)
  4. /* R1 is now 0 for the parent and 1 for the child. Decrement it to
  5. make it -1 (all bits set) for the parent, and 0 (no bits set)
  6. for the child. Then AND it with R0, so the parent gets
  7. R0&-1==R0, and the child gets R0&0==0. */
  8. /* i dunno what the blurb above is useful for. we just return. */
  9. __asm__("ret\n\tnop");
  10. weak_alias(__libc_fork, fork);