View Single Post
  #7   (View Single Post)  
Old 14th September 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Just tested a simple program. Use getppid(2).
Code:
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int
main(int argc, char **argv) {
   printf("Process ID: %d\n", getppid());
   exit(0);
}
Reply With Quote