Gets process id of program running

This commit is contained in:
muarachmann 2018-10-11 04:35:15 +01:00 committed by Luke Oliff
parent 77c79dfef2
commit 03035efd1d
1 changed files with 20 additions and 0 deletions

20
code/process.c Executable file
View File

@ -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;
}