From owner-svn-src-all@FreeBSD.ORG Fri Jun 17 21:16:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D373A1065670; Fri, 17 Jun 2011 21:16:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C33218FC0C; Fri, 17 Jun 2011 21:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLGRiG007407; Fri, 17 Jun 2011 21:16:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLGRnM007405; Fri, 17 Jun 2011 21:16:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106172116.p5HLGRnM007405@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 17 Jun 2011 21:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223206 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 17 Jun 2011 21:16:28 -0000 Author: jilles Date: Fri Jun 17 21:16:27 2011 New Revision: 223206 URL: http://svn.freebsd.org/changeset/base/223206 Log: posix_spawn(3): Document r222511 (trying to close already closed fd). MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn.3 Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Fri Jun 17 21:03:21 2011 (r223205) +++ head/lib/libc/gen/posix_spawn.3 Fri Jun 17 21:16:27 2011 (r223206) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2008 +.Dd June 17, 2011 .Dt POSIX_SPAWN 3 .Os .Sh NAME @@ -384,29 +384,28 @@ the child process exits with exit status .It If the .Fa file_actions -argument is not NULL, and specifies any close, dup2, or open actions to be +argument is not NULL, and specifies any dup2 or open actions to be performed, and if .Fn posix_spawn or .Fn posix_spawnp fails for any of the reasons that would cause -.Fn close , -.Fn dup2 , +.Fn dup2 or .Fn open to fail, an error value is returned as described by -.Fn close , -.Fn dup2 , +.Fn dup2 and .Fn open , respectively (or, if the error occurs after the calling process successfully returns, the child process exits with exit status 127). An open file action may, by itself, result in any of the errors described by -.Fn close -or .Fn dup2 , in addition to those described by .Fn open . +This implementation ignores any errors from +.Fn close , +including trying to close a descriptor that is not open. .El .Sh SEE ALSO .Xr close 2 , @@ -443,7 +442,13 @@ The and .Fn posix_spawnp functions conform to -.St -p1003.1-2001 . +.St -p1003.1-2001 , +except that they ignore all errors from +.Fn close . +A future update of the Standard is expected to require that these functions +not fail because a file descriptor to be closed (via +.Fn posix_spawn_file_actions_addclose ) +is not open. .Sh HISTORY The .Fn posix_spawn