fork.c 517 B

12345678910111213141516171819202122232425
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * fork() for Xtensa uClibc
  4. *
  5. * Copyright (C) 2007 Tensilica Inc.
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. /* Xtensa doesn't provide a 'fork' system call, so we use 'clone'. */
  10. #include <sys/syscall.h>
  11. #if defined __NR_clone && defined __ARCH_USE_MMU__
  12. # include <unistd.h>
  13. # include <signal.h>
  14. # include <cancel.h>
  15. pid_t fork(void)
  16. {
  17. return (pid_t) INLINE_SYSCALL(clone, 2, SIGCHLD, 0);
  18. }
  19. lt_strong_alias(fork)
  20. lt_libc_hidden(fork)
  21. #endif