From owner-svn-src-all@FreeBSD.ORG Thu May 9 21:29:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6938A6D5; Thu, 9 May 2013 21:29:14 +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 5AAFC2B5; Thu, 9 May 2013 21:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49LTE8g047913; Thu, 9 May 2013 21:29:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49LTEFa047912; Thu, 9 May 2013 21:29:14 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305092129.r49LTEFa047912@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 9 May 2013 21:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250421 - head/lib/libc/gen 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: Thu, 09 May 2013 21:29:14 -0000 Author: jilles Date: Thu May 9 21:29:13 2013 New Revision: 250421 URL: http://svnweb.freebsd.org/changeset/base/250421 Log: posix_spawn_file_actions_adddup2(3): Document difference with dup2(). The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 ============================================================================== --- head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 20:13:43 2013 (r250420) +++ head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 21:29:13 2013 (r250421) @@ -123,7 +123,19 @@ to be duplicated as dup2(fildes, newfildes) .Ed .Pp -had been called) when a new process is spawned using this file actions object. +had been called) when a new process is spawned using this file actions object, +except that the +.Dv FD_CLOEXEC +flag for +.Fa newfildes +is cleared even if +.Fa fildes +is equal to +.Fa newfildes . +The difference from +.Fn dup2 +is useful for passing a particular file descriptor +to a particular child process. .Pp The .Fn posix_spawn_file_actions_addclose @@ -169,7 +181,16 @@ The and .Fn posix_spawn_file_actions_addclose functions conform to -.St -p1003.1-2001 . +.St -p1003.1-2001 , +with the exception of the behavior of +.Fn posix_spawn_file_actions_adddup2 +if +.Fa fildes +is equal to +.Fa newfildes +(clearing +.Dv FD_CLOEXEC ) . +A future update of the Standard is expected to require this behavior, .Sh HISTORY The .Fn posix_spawn_file_actions_addopen ,