#include <stdio.h> #include <sys/types.h> main(){ pid_t mypid; pid_t myppid; mypid = getpid(); myppid = getppid(); printf("My PID: %ld\n", (long)mypid); printf("My PPID: %ld\n", (long)myppid); }