ПИД процесса в C
#include <stdio.h>
#include <stdlib.h>
int main()
{
int pid = 0;
printf("before the fork \n");
pid = fork(); //create the child process
printf("after the fork \n");
if (pid == 0)
{
printf("I'm the child process, my pid is &d\n", getpid());
exit(1);
}
else
{
printf("I'm the parent process, my pid is &d\n", getpid());
exit(0);
}
}
The Bad Programmer