Showing posts with label process id. Show all posts
Showing posts with label process id. Show all posts

How to Create process and display Process ID (pid) of Both Parent and Child

This program shows how to create process and display Process ID (pid) of Both Parent and Child processes. The process is created using the fork system call in UNIX (Linux) operating systems.

#include<stdio.h>
#include<dirent.h>
main(int argc,char **argv)
{

C Program to Show Process ID in Linux

This program is to show the process id (pid) in UNIX or Linx
The system call getpid() returns the process id of current process.

#include<stdio.h>
int main()
{
printf("\n Parent Process ID %d",getppid());
}