getpid.c 421 B

123456789101112131415161718192021
  1. /*
  2. * getpid() for uClibc
  3. *
  4. * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <unistd.h>
  10. #ifdef __NR_getxpid
  11. # undef __NR_getpid
  12. # define __NR_getpid __NR_getxpid
  13. #endif
  14. _syscall_noerr0(pid_t, getpid)
  15. libc_hidden_weak(getpid)
  16. #ifndef __NR_getppid
  17. strong_alias(getpid,getppid)
  18. #endif