vfork.c 535 B

123456789101112131415161718192021222324252627
  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. /* Trivial implementation for arches that lack vfork */
  7. #include <unistd.h>
  8. #include <sys/types.h>
  9. #include <sys/syscall.h>
  10. #ifdef __ARCH_USE_MMU__
  11. #ifdef __NR_fork
  12. /* libc_hidden_proto(fork) */
  13. extern __typeof(vfork) __vfork attribute_hidden;
  14. pid_t __vfork(void)
  15. {
  16. return fork();
  17. }
  18. /* libc_hidden_proto(vfork) */
  19. weak_alias(__vfork,vfork)
  20. libc_hidden_weak(vfork)
  21. #endif
  22. #endif