diff options
author | jilles <jilles@FreeBSD.org> | 2013-05-31 20:46:08 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-05-31 20:46:08 +0000 |
commit | c541a64022f238788cff649f20a23aabc5716572 (patch) | |
tree | 6167005d766d48f070d7b62904d34df360de67d8 | |
parent | ad0bcd65abcf018366ab68ea254507d7c4688121 (diff) | |
download | FreeBSD-src-c541a64022f238788cff649f20a23aabc5716572.zip FreeBSD-src-c541a64022f238788cff649f20a23aabc5716572.tar.gz |
fork(2): Add information about fork() in multi-threaded processes.
There is nothing about pthread_atfork(3) or extensions like calling
malloc(3) in the child process as this may be unreliable or broken.
-rw-r--r-- | lib/libc/sys/fork.2 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index aef59b0..1ad2052f 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -73,6 +73,17 @@ are set to 0; see .It All interval timers are cleared; see .Xr setitimer 2 . +.It +The child process has only one thread, +corresponding to the calling thread in the parent process. +If the process has more than one thread, +locks and other resources held by the other threads are not released +and therefore only async-signal-safe functions +(see +.Xr sigaction 2 ) +are guaranteed to work in the child process until a call to +.Xr execve 2 +or a similar function. .El .Sh RETURN VALUES Upon successful completion, @@ -124,6 +135,7 @@ There is insufficient swap space for the new process. .Xr rfork 2 , .Xr setitimer 2 , .Xr setrlimit 2 , +.Xr sigaction 2 , .Xr vfork 2 , .Xr wait 2 .Sh HISTORY |