Date: Fri, 31 May 2013 20:46:08 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251194 - head/lib/libc/sys Message-ID: <201305312046.r4VKk8Fc057202@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Fri May 31 20:46:08 2013 New Revision: 251194 URL: http://svnweb.freebsd.org/changeset/base/251194 Log: 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. Modified: head/lib/libc/sys/fork.2 Modified: head/lib/libc/sys/fork.2 ============================================================================== --- head/lib/libc/sys/fork.2 Fri May 31 20:11:07 2013 (r251193) +++ head/lib/libc/sys/fork.2 Fri May 31 20:46:08 2013 (r251194) @@ -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 .Xr rfork 2 , .Xr setitimer 2 , .Xr setrlimit 2 , +.Xr sigaction 2 , .Xr vfork 2 , .Xr wait 2 .Sh HISTORY
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305312046.r4VKk8Fc057202>