We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f06964e + a1a06dd commit 1caf628Copy full SHA for 1caf628
getPIDs.c
@@ -0,0 +1,16 @@
1
+#include <sys/types.h>
2
+#include <unistd.h>
3
+#include <stdio.h>
4
+
5
+void main(){
6
+ pid_t pid; //variable to store process id
7
+ pid_t ppid; //variable to store parent process id
8
9
+ sleep(5);
10
11
+ pid = getpid(); // returns pid
12
+ ppid = getppid(); //returns parent pid
13
14
+ printf("The process id is : %d\n" , pid);
15
+ printf("The parent of process id is : %d\n" , ppid);
16
+}
0 commit comments