From owner-svn-src-all@FreeBSD.ORG Fri May 31 20:46:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B82EEE; Fri, 31 May 2013 20:46:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC3A8B83; Fri, 31 May 2013 20:46:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VKk8mj057203; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VKk8Fc057202; Fri, 31 May 2013 20:46:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305312046.r4VKk8Fc057202@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 May 2013 20:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251194 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 20:46:08 -0000 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