fork.c 535 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. #include <unistd.h>
  10. #include <sys/syscall.h>
  11. #define _SIGNAL_H
  12. #include <bits/signum.h>
  13. /* Xtensa doesn't provide a 'fork' system call, so we use 'clone'. */
  14. extern __typeof(fork) __libc_fork;
  15. libc_hidden_proto(fork)
  16. pid_t __libc_fork(void)
  17. {
  18. return (pid_t) INLINE_SYSCALL(clone, 2, SIGCHLD, 0);
  19. }
  20. weak_alias(__libc_fork, fork)
  21. libc_hidden_weak(fork)