mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2025-07-30 13:30:16 +00:00
Gets process id of program running
This commit is contained in:
20
code/process.c
Executable file
20
code/process.c
Executable 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;
|
||||
}
|
Reference in New Issue
Block a user