UNIX-programming-programs-procs

Voctl
1 min read

A program is an executable file residing on disk in a directory.

#ProcandprocID
An executing instance of a program is called a process. Some OS use the term task for this process.
In UNIX systems every process has a unique numeric identifier called the process ID.
The process ID is always non-negativ integer (U64).

For example a process ID is look like this in UNIX based opearation systems:

When this programs runs, it calls the function 'getpid' to obtain its process ID.

If u want to print a process ID:

#include <apue.h>

int main(void){

    printf("This process ID is from %d\n", getpid());
    exit(0);
}

// its return the process ID of this proc

#Proccontrol

There are three primary funcs to process control: 'fork', 'exec' and waitpid.

0

Responses (0)

Sign in to leave a response.

No responses yet. Be the first.