vfork.c 456 B

123456789101112131415161718192021
  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. pid_t attribute_hidden __vfork(void)
  13. {
  14. return fork();
  15. }
  16. libc_hidden_proto(vfork)
  17. weak_alias(__vfork,vfork)
  18. libc_hidden_def(vfork)
  19. #endif