getpid.c 227 B

123456789101112131415
  1. #include <unistd.h>
  2. #include <errno.h>
  3. #include <syscall.h>
  4. #include <syscall_nums.h>
  5. DEFN_SYSCALL0(getpid, SYS_GETPID);
  6. pid_t getpid(void) {
  7. return syscall_getpid();
  8. }
  9. pid_t getppid(void) {
  10. errno = ENOTSUP;
  11. return -1;
  12. }