- The child process has a unique process ID.
- The child process ID also does not match any active process group ID.
- The child process has a different parent process ID(that is, the process ID of the parent process).
- The child process has its own copy of the parent's file descriptors.Each of the child's file descriptors refers to the sameopen file description with the corresponding file descriptor of the parent.
- The child process has its own copy of the parent's open directorystreams. Each open directory stream in the child process may sharedirectory stream positioning with the corresponding directorystream of the parent.
- The child process may have its own copy of the parent's message cataloguedescriptors.
- The child process' values oftms_utime,tms_stime,tms_cutimeandtms_cstimeare set to 0.
- The time left until an alarm clock signal is reset to 0.
- Allsemadjvalues are cleared.
- File locks set by the parent process are not inherited by the child process.
- The set of signals pending for the child process is initialised tothe empty set.
- Interval timers are reset in the child process.
- If the Semaphores option is supported,any semaphoresthat are open in the parent process will also be open in the childprocess.
- If the Process Memory Locking option is supported,the child process does not inherit any address spacememory locks established by the parent process via calls tomlockall()ormlock().
- Memory mappings created in the parent are retained in the child process.MAP_PRIVATE mappings inherited from the parent will also beMAP_PRIVATE mappings in the child,and any modifications to the data in these mappingsmade by the parent prior to callingfork()will be visible to the child.Any modifications to the data in MAP_PRIVATEmappings made by the parent afterfork()returns will be visible only to the parent.Modifications to the data in MAP_PRIVATEmappings made by the child will be visible only to the child.
- If the Process Scheduling option is supported,for the SCHED_FIFO and SCHED_RR scheduling policies,the child process inherits the policy and priority settingsof the parent process during afork()function.For other scheduling policies, the policy and priority settings onfork()are implementation-dependent.
- If the Timers option is supported,per-process timers created by the parent are not inheritedby the child process.
- If the Message Passing option is supported,the child process has its own copyof the message queue descriptors of the parent.Each of the message descriptors of the child refersto the same open message queue descriptionas the corresponding message descriptor of the parent.
- If the Asynchronous Input and Output option is supported,no asynchronous input or asynchronous output operations are inheritedby the child process.
The inheritance of process characteristics not defined bythis document is implementation-dependent.Afterfork(),both the parent and the child processes are capable of executingindependently before either one terminates.
A process is created with a single thread.If a multi-threaded process callsfork(),the new process contains a replica of the calling threadand its entire address space,possibly including the states of mutexes and other resources.Consequently, to avoid errors, the child process may only executeasync-signal safe operations until such time as one of theexecfunctions is called.Fork handlers may be established by means of thepthread_atfork()function in order to maintain application invariants acrossfork()calls.