vfork.c 490 B

1234567891011121314151617181920212223
  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 __NR_fork
  11. libc_hidden_proto(fork)
  12. extern __typeof(vfork) __vfork attribute_hidden;
  13. pid_t __vfork(void)
  14. {
  15. return fork();
  16. }
  17. libc_hidden_proto(vfork)
  18. weak_alias(__vfork,vfork)
  19. libc_hidden_weak(vfork)
  20. #endif