fork.c 475 B

12345678910111213141516171819202122
  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. pid_t __libc_fork(void)
  15. {
  16. return (pid_t) INLINE_SYSCALL(clone, 2, SIGCHLD, 0);
  17. }
  18. weak_alias(__libc_fork, fork)
  19. libc_hidden_weak(fork)