Gets process id of program running
This commit is contained in:
parent
77c79dfef2
commit
03035efd1d
|
@ -0,0 +1,20 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(){
|
||||
|
||||
pid_t getpid(void);
|
||||
pid_t getppid(void);
|
||||
|
||||
printf("PID = [%d]\n",getpid());
|
||||
printf("PPID = [%d]\n",getppid());
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue