linux fork()系统调用

NAME
       fork - create a child process
SYNOPSIS
       #include <unistd.h>
       pid_t fork(void);
DESCRIPTION
       fork()  creates  a new process by duplicating the calling process.  The
       new process is referred to as the child process.  The  calling  process
       is referred to as the parent process.
After the fork(): Shared and Distinct AttributesShared:
§ The environment
§ Open files and directories
§ The umask setting
§ The working and root directory
§ The current priority
§ The controlling terminal
§ The process signal mask and all current signal
dispositions
§ User and group identity

Differrent in:

§ Process ID and the parent PID
§ The accumulated CPU time
§ Any signals that were pending in the parent are
cleared in the child(alarms and timers).
§ File locks are not inherited.

猜你喜欢

转载自blog.csdn.net/yanshaoshuai/article/details/80729693