From sacadmin Wed Feb 18 14:20:10 2009
Received: from donald2.sfbay.sun.com (donald2.SFBay.Sun.COM [129.146.126.67])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1IMKAl4001976;
	Wed, 18 Feb 2009 14:20:10 -0800 (PST)
Received: from donald2.sfbay.sun.com (localhost [127.0.0.1])
	by donald2.sfbay.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n1IMK4Gh101515;
	Wed, 18 Feb 2009 14:20:04 -0800 (PST)
Received: (from raf@localhost)
	by donald2.sfbay.sun.com (8.14.3+Sun/8.14.3/Submit) id n1IMK3bZ101511;
	Wed, 18 Feb 2009 14:20:03 -0800 (PST)
Date: Wed, 18 Feb 2009 14:20:03 -0800 (PST)
From: "Roger A. Faulkner" <raf@donald2.sfbay.sun.com>
Message-Id: <200902182220.n1IMK3bZ101511@donald2.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Subject: posix_spawn_file_actions_addclosefrom_np [PSARC/2009/116 Self Review]
Status: RO
Content-Length: 573


Template Version: @(#)sac_nextcase %I% %G% SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 posix_spawn_file_actions_addclosefrom_np
    1.2. Name of Document Author/Supplier:
	 Author:  Roger Faulkner
    1.3  Date of This Document:
	18 February, 2009
4. Technical Description
    See the case directory for more detail

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open


From Roger.Faulkner@sun.com Wed Feb 18 16:40:07 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1J0e7nO026009
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 18 Feb 2009 16:40:07 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1J0e7l1026340
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Wed, 18 Feb 2009 17:40:07 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFA00727F6VG400@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 18 Feb 2009 16:40:07 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFA00MHKF6UXJB0@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 18 Feb 2009 16:40:06 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com
 (jurassic-x4600.sfbay.sun.com [129.146.17.59])	by jurassic-x4600.sfbay.sun.com
 (8.14.3+Sun/8.14.3) with SMTP id n1J0dtiq656169; Wed,
 18 Feb 2009 16:40:04 -0800 (PST)
Date: Wed, 18 Feb 2009 16:39:55 -0800 (PST)
From: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Subject: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
To: To: ;
Reply-to: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Message-id: <200902190040.n1J0dtiq656169@jurassic-x4600.sfbay.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_98 SunOS 5.11 i86pc i386
Content-type: TEXT/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-MD5: c/uZhZzV4zLXeQ5aoRnZ8A==
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 4769

I am sponsoring this automatic case for myself.

1.  Introduction

    This case adds a new posix_spawn() support function to the C library:

       int posix_spawn_file_actions_addclosefrom_np(
           posix_spawn_file_actions_t *file_actions,
           int filedes);

    The committment level of this interface is Committed.
    The "_np" suffix indicates that this is a non-portable
    Solaris extension.

    The release binding is "minor release" so it can go
    into SunOS 5.11 (OpenSolaris) (there is no need or
    intention to back-port the interface to SunOS 5.10).

    This case also redefines the semantics of the
    posix_spawn_file_actions_addclose() interface:

    Previously, posix_spawn() would fail if any of the file descriptors
    specified in calls to posix_spawn_file_actions_addclose() were
    not open at the time of the call to posix_spawn() (posix_spawn()
    would return EBADF as a result).  The new semantic is that no
    error occurs if the file descriptors to be closed are not open
    at the time of the call to posix_spawn().

    See the materials directory of this case for the manual
    page change for posix_spawn_file_actions_addclose() and
    for the new posix_spawn_file_actions_addclosefrom_np()
    manual page.

2.  Discussion

    The posix_spawn() interface has a problem with MT-safeness,
    complained about on comp.unix.programmer and other places:

    One thread of a multithreaded process may want to create
    a child process/program using posix_spawn() and it wants
    to supply a list of file descriptors to be closed before
    the new program begins execution (by one or more calls
    to posix_spawn_file_actions_addclose() prior to the call
    to posix_spawn().

    However, between the call to posix_spawn_file_actions_addclose()
    and the call to posix_spawn(), some other thread in the process
    may close the specified file descriptor.

    The call to posix_spawn() will then fail with EBADF because the
    file-to-be-closed is not currently open in the parent process.

    This is neither useful nor rational.  The file is already
    closed, so another close() (returning EBADF) should be
    considered to be a no-operation.

    In addition, many if not most programs expect to be started
    with only file descriptors 0, 1, and 2 open (STDIN, STDOUT,
    STDERR).

    It would be useful to provide a posix_spawn() file action
    interface that provides the utility of the Solaris interface:

        void closefrom(int lowfd);

    that closes all open file descriptors greater than or equal
    to lowfd.  This is the purpose of the new interface:

       int posix_spawn_file_actions_addclosefrom_np(
           posix_spawn_file_actions_t *file_actions,
           int lowfiledes);
 
3.  Interface table

    The posix_spawn_file_actions_addclosefrom_np() interface
    is Committed.

4.  References

    6807216 posix_spawn() should provide a 'closefrom' file action

5.  Manual page differences

    (See the materials directory for the full old and new man pages.)

*** posix_spawn_file_actions_addclose.3c.old	Wed Feb 18 12:37:29 2009
--- posix_spawn_file_actions_addclose.3c	Wed Feb 18 13:33:36 2009
***************
*** 96,102 ****
       the specified operation could not be performed at  the  time
       of  the call. Any such error will be detected when the asso-
       ciated  file  actions  object  is  later   used   during   a
!      posix_spawn() or posix_spawnp() operation.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-
--- 96,105 ----
       the specified operation could not be performed at  the  time
       of  the call. Any such error will be detected when the asso-
       ciated  file  actions  object  is  later   used   during   a
!      posix_spawn() or posix_spawnp() operation, with one exception:
!      if a close operation is specified for a file descriptor that
!      is not open at the time of the call to posix_spawn(), the
!      close operation will not cause the posix_spawn() call to fail.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-

*** posix_spawn.3c.old	Wed Feb 18 12:37:19 2009
--- posix_spawn.3c	Wed Feb 18 14:33:02 2009
***************
*** 348,354 ****
--- 348,358 ----
       or  open(2),  respectively.  An  open  file action might, by
       itself, result in any of the errors described by close()  or
       dup2(), in addition to those described by open().
+      If a close() action is specified for a file descriptor that
+      is not open at the time of the call to posix_spawn() or 
+      posix_spawnp(), the action causes no error.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-
       butes:


From Roger.Faulkner@sun.com Wed Feb 18 16:51:37 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1J0pb5T026142
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 18 Feb 2009 16:51:37 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1J0pb3n014565
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Wed, 18 Feb 2009 16:51:37 -0800 (PST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFA00301FPZ9V00@nwk-avmta-2.sfbay.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 18 Feb 2009 16:51:35 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFA00MU7FPYCC60@nwk-avmta-2.sfbay.sun.com> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 18 Feb 2009 16:51:34 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com
 (jurassic-x4600.sfbay.sun.com [129.146.17.63])	by jurassic-x4600.sfbay.sun.com
 (8.14.3+Sun/8.14.3) with SMTP id n1J0pWOl658147; Wed,
 18 Feb 2009 16:51:32 -0800 (PST)
Date: Wed, 18 Feb 2009 16:51:32 -0800 (PST)
From: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Subject: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
To: psarc-ext@sun.com
Reply-to: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Message-id: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_98 SunOS 5.11 i86pc i386
Content-type: TEXT/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-MD5: c/uZhZzV4zLXeQ5aoRnZ8A==
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 4769

I am sponsoring this automatic case for myself.

1.  Introduction

    This case adds a new posix_spawn() support function to the C library:

       int posix_spawn_file_actions_addclosefrom_np(
           posix_spawn_file_actions_t *file_actions,
           int filedes);

    The committment level of this interface is Committed.
    The "_np" suffix indicates that this is a non-portable
    Solaris extension.

    The release binding is "minor release" so it can go
    into SunOS 5.11 (OpenSolaris) (there is no need or
    intention to back-port the interface to SunOS 5.10).

    This case also redefines the semantics of the
    posix_spawn_file_actions_addclose() interface:

    Previously, posix_spawn() would fail if any of the file descriptors
    specified in calls to posix_spawn_file_actions_addclose() were
    not open at the time of the call to posix_spawn() (posix_spawn()
    would return EBADF as a result).  The new semantic is that no
    error occurs if the file descriptors to be closed are not open
    at the time of the call to posix_spawn().

    See the materials directory of this case for the manual
    page change for posix_spawn_file_actions_addclose() and
    for the new posix_spawn_file_actions_addclosefrom_np()
    manual page.

2.  Discussion

    The posix_spawn() interface has a problem with MT-safeness,
    complained about on comp.unix.programmer and other places:

    One thread of a multithreaded process may want to create
    a child process/program using posix_spawn() and it wants
    to supply a list of file descriptors to be closed before
    the new program begins execution (by one or more calls
    to posix_spawn_file_actions_addclose() prior to the call
    to posix_spawn().

    However, between the call to posix_spawn_file_actions_addclose()
    and the call to posix_spawn(), some other thread in the process
    may close the specified file descriptor.

    The call to posix_spawn() will then fail with EBADF because the
    file-to-be-closed is not currently open in the parent process.

    This is neither useful nor rational.  The file is already
    closed, so another close() (returning EBADF) should be
    considered to be a no-operation.

    In addition, many if not most programs expect to be started
    with only file descriptors 0, 1, and 2 open (STDIN, STDOUT,
    STDERR).

    It would be useful to provide a posix_spawn() file action
    interface that provides the utility of the Solaris interface:

        void closefrom(int lowfd);

    that closes all open file descriptors greater than or equal
    to lowfd.  This is the purpose of the new interface:

       int posix_spawn_file_actions_addclosefrom_np(
           posix_spawn_file_actions_t *file_actions,
           int lowfiledes);
 
3.  Interface table

    The posix_spawn_file_actions_addclosefrom_np() interface
    is Committed.

4.  References

    6807216 posix_spawn() should provide a 'closefrom' file action

5.  Manual page differences

    (See the materials directory for the full old and new man pages.)

*** posix_spawn_file_actions_addclose.3c.old	Wed Feb 18 12:37:29 2009
--- posix_spawn_file_actions_addclose.3c	Wed Feb 18 13:33:36 2009
***************
*** 96,102 ****
       the specified operation could not be performed at  the  time
       of  the call. Any such error will be detected when the asso-
       ciated  file  actions  object  is  later   used   during   a
!      posix_spawn() or posix_spawnp() operation.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-
--- 96,105 ----
       the specified operation could not be performed at  the  time
       of  the call. Any such error will be detected when the asso-
       ciated  file  actions  object  is  later   used   during   a
!      posix_spawn() or posix_spawnp() operation, with one exception:
!      if a close operation is specified for a file descriptor that
!      is not open at the time of the call to posix_spawn(), the
!      close operation will not cause the posix_spawn() call to fail.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-

*** posix_spawn.3c.old	Wed Feb 18 12:37:19 2009
--- posix_spawn.3c	Wed Feb 18 14:33:02 2009
***************
*** 348,354 ****
--- 348,358 ----
       or  open(2),  respectively.  An  open  file action might, by
       itself, result in any of the errors described by close()  or
       dup2(), in addition to those described by open().
+      If a close() action is specified for a file descriptor that
+      is not open at the time of the call to posix_spawn() or 
+      posix_spawnp(), the action causes no error.
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-
       butes:


From carlsonj@phorcys.east.sun.com Thu Feb 19 04:54:11 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JCsAmG009033
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 04:54:11 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n1JCs885025121;
	Thu, 19 Feb 2009 12:54:08 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB0002RD67J100@nwk-avmta-1.sfbay.Sun.COM>; Thu,
 19 Feb 2009 04:54:07 -0800 (PST)
Received: from phorcys.east.sun.com ([129.148.174.143])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB00JZTD665U10@nwk-avmta-1.sfbay.Sun.COM>; Thu,
 19 Feb 2009 04:54:06 -0800 (PST)
Received: from phorcys.east.sun.com (localhost [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n1JCrxxL024777; Thu,
 19 Feb 2009 07:53:59 -0500 (EST)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n1JCrxDI024774; Thu,
 19 Feb 2009 07:53:59 -0500 (EST)
Date: Thu, 19 Feb 2009 07:53:59 -0500
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
In-reply-to: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
To: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Cc: psarc-ext@sun.com
Message-id: <18845.22119.759058.301086@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
Status: RO
Content-Length: 458

Roger A. Faulkner writes:
>     See the materials directory of this case for the manual
>     page change for posix_spawn_file_actions_addclose() and
>     for the new posix_spawn_file_actions_addclosefrom_np()
>     manual page.

+1

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

From roland.mainz@nrubsig.org Thu Feb 19 05:33:03 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JDX25R009644
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 05:33:02 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1JDX1TA037850;
	Thu, 19 Feb 2009 06:33:02 -0700 (MST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB00F05EZ1IJ00@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 06:33:01 -0700 (MST)
Received: from sca-ea-mail-1.sun.com ([192.18.43.24])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB00AD9EZ0PG30@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 06:33:00 -0700 (MST)
Received: from relay41i.sun.com ([192.5.209.70])
	by sca-ea-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n1JDWxGo000469;
 Thu, 19 Feb 2009 13:33:00 +0000 (GMT)
Received: from mmp42es.mmp.us.syntegra.com ([160.41.221.11] [160.41.221.11])
 by relay41i.sun.com with ESMTP id BT-MMP-1885487; Thu,
 19 Feb 2009 13:30:59 +0000 (Z)
Received: from relay43i.sun.com (relay43i.sun.com [192.5.209.74])
 by mmp42es.mmp.us.syntegra.com with ESMTP id BT-MMP-15010592; Thu,
 19 Feb 2009 13:30:59 +0000 (Z)
Received: from mail-in-05.arcor-online.net ([151.189.21.45] [151.189.21.45])
 by relay4i.sun.com with ESMTP id BT-MMP-17730432; Thu,
 19 Feb 2009 13:30:59 +0000 (Z)
Received: from mail-in-03-z2.arcor-online.net
 (mail-in-03-z2.arcor-online.net [151.189.8.15])	by mx.arcor.de (Postfix)
 with ESMTP id 14172332793; Thu, 19 Feb 2009 14:30:58 +0100 (CET)
Received: from mail-in-14.arcor-online.net
 (mail-in-14.arcor-online.net [151.189.21.54])
	by mail-in-03-z2.arcor-online.net (Postfix) with ESMTP id F30C32D3781; Thu,
 19 Feb 2009 14:30:57 +0100 (CET)
Received: from jupiterb48.nrubsig.org
 (dslb-094-219-214-118.pools.arcor-ip.net [94.219.214.118])
	by mail-in-14.arcor-online.net (Postfix) with ESMTPS id A3A6E28B22A; Thu,
 19 Feb 2009 14:30:56 +0100 (CET)
Received: from nrubsig.org (localhost [127.0.0.1])	by jupiterb48.nrubsig.org
 (8.13.8+Sun/8.13.8) with ESMTP id n1JDUsDH018797; Thu,
 19 Feb 2009 14:30:54 +0100 (CET)
Date: Thu, 19 Feb 2009 14:30:53 +0100
From: Roland Mainz <roland.mainz@nrubsig.org>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
Sender: gisburn@jupiterb48.nrubsig.org
To: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Cc: psarc-ext@sun.com
Message-id: <499D5F0D.7AB71967@nrubsig.org>
MIME-version: 1.0
X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.11 sun4u)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-Accept-Language: en
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-DKIM: Sendmail DKIM Filter v2.6.0 mail-in-14.arcor-online.net A3A6E28B22A
X-Virus-Scanned: ClamAV 0.94.2/9002/Wed Feb 18 12:16:50 2009 on
 mail-in-14.arcor-online.net
X-Virus-Status: Clean
X-Antispam: No, score=0.0/5.0, scanned in 0.114sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
Status: RO
Content-Length: 1478

"Roger A. Faulkner" wrote:
> 
> I am sponsoring this automatic case for myself.
> 
> 1.  Introduction
> 
>     This case adds a new posix_spawn() support function to the C library:
> 
>        int posix_spawn_file_actions_addclosefrom_np(
>            posix_spawn_file_actions_t *file_actions,
>            int filedes);
> 
>     The committment level of this interface is Committed.
>     The "_np" suffix indicates that this is a non-portable
>     Solaris extension.

Two nits:
- IMO it may be nice to use a different suffix than "_np", e.g. IMO
|posix_spawn_file_actions_addclosefrom_solaris()| may be better.
- What about adding a |flags| argument to allow that future extensions
can be made, e.g. change the prototype to...
-- snip --
int posix_spawn_file_actions_addclosefrom_solaris(
            posix_spawn_file_actions_t *file_actions,
            int filedes,
            uint32_t flags
            )
-- snip --

>     The release binding is "minor release" so it can go
>     into SunOS 5.11 (OpenSolaris) (there is no need or
>     intention to back-port the interface to SunOS 5.10).

Why ? It may be _nice_ to have it in Solaris 10 on demand, too (e.g. you
don't have to do the backport now but it keeps the option open to do a
backport to Solaris 10 without another ARC case).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

From carlsonj@phorcys.east.sun.com Thu Feb 19 05:56:54 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JDusR2010475
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 05:56:54 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n1JDuoHq002617;
	Thu, 19 Feb 2009 13:56:51 GMT
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB00H07G2PVD00@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 06:56:49 -0700 (MST)
Received: from phorcys.east.sun.com ([129.148.174.143])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB00ADYG2PPB60@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 06:56:49 -0700 (MST)
Received: from phorcys.east.sun.com (localhost [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n1JDnDOI025138; Thu,
 19 Feb 2009 08:49:13 -0500 (EST)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n1JDnDrl025135; Thu,
 19 Feb 2009 08:49:13 -0500 (EST)
Date: Thu, 19 Feb 2009 08:49:13 -0500
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
In-reply-to: <499D5F0D.7AB71967@nrubsig.org>
To: Roland Mainz <roland.mainz@nrubsig.org>
Cc: "Roger A. Faulkner" <Roger.Faulkner@sun.com>, psarc-ext@sun.com
Message-id: <18845.25433.64771.45763@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
 <499D5F0D.7AB71967@nrubsig.org>
Status: RO
Content-Length: 1387

Roland Mainz writes:
> - IMO it may be nice to use a different suffix than "_np", e.g. IMO
> |posix_spawn_file_actions_addclosefrom_solaris()| may be better.

There's substantial precedent for this in Solaris.  See:

	mq_reltimedreceive_np(3c)
	mq_reltimedsend_np(3c)
	posix_spawnattr_getsigignore_np(3c)
	posix_spawnattr_setsigignore_np(3c)
	pthread_cond_reltimedwait_np(3c)
	pthread_key_create_once_np(3c)
	pthread_mutex_reltimedlock_np(3c)
	pthread_rwlock_reltimedrdlock_np(3c)
	pthread_rwlock_reltimedwrlock_np(3c)
	sem_reltimedwait_np(3c)

Making this one different would not be a good idea.

> >     The release binding is "minor release" so it can go
> >     into SunOS 5.11 (OpenSolaris) (there is no need or
> >     intention to back-port the interface to SunOS 5.10).
> 
> Why ? It may be _nice_ to have it in Solaris 10 on demand, too (e.g. you
> don't have to do the backport now but it keeps the option open to do a
> backport to Solaris 10 without another ARC case).

I agree the new interface could possibly be backported, but the change
in semantics for the existing addclose might require something other
than a "closed approved automatic" case.

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

From Darren.Moffat@sun.com Thu Feb 19 05:57:42 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JDvftl010487
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 05:57:42 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n1JDvaMc003101
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Thu, 19 Feb 2009 13:57:41 GMT
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB00H05G43XE00@brm-avmta-1.central.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Thu, 19 Feb 2009 06:57:39 -0700 (MST)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB00ATPG42PO50@brm-avmta-1.central.sun.com> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Thu,
 19 Feb 2009 06:57:39 -0700 (MST)
Received: from fe-emea-09.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10])
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n1JDvc0H028600	for
 <psarc-ext@sun.com>; Thu, 19 Feb 2009 13:57:38 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008))
 id <0KFB00E00EUF4D00@fe-emea-09.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Thu, 19 Feb 2009 13:57:38 +0000 (GMT)
Received: from [129.156.173.21] ([unknown] [129.156.173.21])
 by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 23 2008))
 with ESMTPSA id <0KFB007IUG40XIB0@fe-emea-09.sun.com>; Thu,
 19 Feb 2009 13:57:38 +0000 (GMT)
Date: Thu, 19 Feb 2009 13:57:36 +0000
From: Darren J Moffat <Darren.Moffat@sun.com>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
In-reply-to: <499D5F0D.7AB71967@nrubsig.org>
Sender: Darren.Moffat@sun.com
To: Roland Mainz <roland.mainz@nrubsig.org>
Cc: "Roger A. Faulkner" <Roger.Faulkner@sun.com>, psarc-ext@sun.com
Message-id: <499D6550.1040408@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
 <499D5F0D.7AB71967@nrubsig.org>
User-Agent: Thunderbird 2.0.0.18 (X11/20081201)
Status: RO
Content-Length: 1541

Roland Mainz wrote:
> "Roger A. Faulkner" wrote:
>> I am sponsoring this automatic case for myself.
>>
>> 1.  Introduction
>>
>>     This case adds a new posix_spawn() support function to the C library:
>>
>>        int posix_spawn_file_actions_addclosefrom_np(
>>            posix_spawn_file_actions_t *file_actions,
>>            int filedes);
>>
>>     The committment level of this interface is Committed.
>>     The "_np" suffix indicates that this is a non-portable
>>     Solaris extension.
> 
> Two nits:
> - IMO it may be nice to use a different suffix than "_np", e.g. IMO
> |posix_spawn_file_actions_addclosefrom_solaris()| may be better.
> - What about adding a |flags| argument to allow that future extensions
> can be made, e.g. change the prototype to...
> -- snip --
> int posix_spawn_file_actions_addclosefrom_solaris(
>             posix_spawn_file_actions_t *file_actions,
>             int filedes,
>             uint32_t flags
>             )
> -- snip --

The suffix _np has existing precendent in pthread and posix_swan APIs.
Also using _solaris means that if another platform eg linux or bsd 
adopts this before it is part of the standard should they name it _linux 
or _bsd ?

	pthread_cond_reltimedwait_np
	pthread_mutex_consistent_np
	pthread_mutexattr_getrobust_np
	pthread_mutexattr_setrobust_np
	sem_reltimedwait_np
	...

and for posix_spawn itself:
	posix_spawnattr_setsigignore_np(3C)
	POSIX_SPAWN_SETSIGIGN_NP
	POSIX_SPAWN_NOSIGCHLD_NP
	POSIX_SPAWN_WAITPID_NP
	POSIX_SPAWN_NOEXECERR_NP


-- 
Darren J Moffat

From Joerg.Schilling@fokus.fraunhofer.de Thu Feb 19 07:22:19 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JFMIYJ011909
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 07:22:18 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n1JFMCIv000004;
	Thu, 19 Feb 2009 23:22:15 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB00201K11KY00@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 08:22:13 -0700 (MST)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB00AVVK11POD0@brm-avmta-1.central.sun.com>; Thu,
 19 Feb 2009 08:22:13 -0700 (MST)
Received: from relay44i.sun.com ([192.5.209.118])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n1JFFkLq016196; Thu,
 19 Feb 2009 15:22:12 +0000 (GMT)
Received: from mmp42es.mmp.us.syntegra.com ([160.41.221.11] [160.41.221.11])
 by relay44i.sun.com with ESMTP id BT-MMP-1895115; Thu,
 19 Feb 2009 15:22:12 +0000 (Z)
Received: from relay41i.sun.com (relay41i.sun.com [192.5.209.70])
 by mmp42es.mmp.us.syntegra.com with ESMTP id BT-MMP-15120119; Thu,
 19 Feb 2009 15:22:12 +0000 (Z)
Received: from iron02.fraunhofer.de ([153.96.1.56] [153.96.1.56])
 by relay4i.sun.com with ESMTP id BT-MMP-17804519; Thu,
 19 Feb 2009 15:22:11 +0000 (Z)
Received: from pluto.fokus.fraunhofer.de ([195.37.77.164])
 by iron02.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-SHA; Thu,
 19 Feb 2009 16:22:11 +0100
Received: from EXCHSRV.fokus.fraunhofer.de (bohr [10.147.9.231])
	by pluto.fokus.fraunhofer.de (8.13.7/8.13.7) with SMTP id n1JFMANm028146; Thu,
 19 Feb 2009 16:22:10 +0100 (MET)
Received: from rigel ([10.147.65.195]) by EXCHSRV.fokus.fraunhofer.de with
 Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Feb 2009 16:22:10 +0100
Date: Thu, 19 Feb 2009 16:22:10 +0100
From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
In-reply-to: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
To: Roger.Faulkner@sun.com, psarc-ext@sun.com
Message-id: <499d7922.pguTfZ+CYM6f1rnf%Joerg.Schilling@fokus.fraunhofer.de>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=0.0/5.0, scanned in 0.289sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <200902190051.n1J0pWOl658147@jurassic-x4600.sfbay.sun.com>
User-Agent: nail 11.22 3/20/05
X-OriginalArrivalTime: 19 Feb 2009 15:22:10.0611 (UTC)
 FILETIME=[D5823830:01C992A5]
Status: RO
Content-Length: 590

"Roger A. Faulkner" <Roger.Faulkner@sun.com> wrote:

> 2.  Discussion
>
>     The posix_spawn() interface has a problem with MT-safeness,
>     complained about on comp.unix.programmer and other places:

Isn't the problem with MT-safeness caused by the fact that posix_spawn() uses 
malloc()?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily

From Roger.Faulkner@sun.com Thu Feb 19 07:41:14 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JFfEN6012245
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 07:41:14 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n1JFf4dk027631
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Thu, 19 Feb 2009 07:41:13 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB0044DKWPCA00@brm-avmta-1.central.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Thu, 19 Feb 2009 08:41:13 -0700 (MST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.63])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB003JJKWPP400@brm-avmta-1.central.sun.com> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Thu,
 19 Feb 2009 08:41:13 -0700 (MST)
Received: from jurassic-x4600.sfbay.sun.com
 (jurassic-x4600.sfbay.sun.com [129.146.17.59])	by jurassic-x4600.sfbay.sun.com
 (8.14.3+Sun/8.14.3) with SMTP id n1JFfB51758781; Thu,
 19 Feb 2009 07:41:11 -0800 (PST)
Date: Thu, 19 Feb 2009 07:41:11 -0800 (PST)
From: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
To: psarc-ext@sun.com, Joerg.Schilling@fokus.fraunhofer.de
Reply-to: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Message-id: <200902191541.n1JFfB51758781@jurassic-x4600.sfbay.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_98 SunOS 5.11 i86pc i386
Content-type: TEXT/plain; charset=ISO-8859-1
Content-MD5: mMH34WQ5rDhb+wcO8qurew==
X-PMX-Version: 5.4.1.325704
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by sac.sfbay.sun.com id n1JFfEN6012245
Status: RO
Content-Length: 925


> Date: Thu, 19 Feb 2009 16:22:10 +0100
> From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
> Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
> To: Roger.Faulkner@sun.com, psarc-ext@sun.com
> 
> "Roger A. Faulkner" <Roger.Faulkner@sun.com> wrote:
> 
> > 2.  Discussion
> >
> >     The posix_spawn() interface has a problem with MT-safeness,
> >     complained about on comp.unix.programmer and other places:
> 
> Isn't the problem with MT-safeness caused by the fact that posix_spawn() uses 
> malloc()?
> 
> Jörg

That's async-signal safeness, not just MT-safeness.
malloc() is MT-safe, just not async-signal-safe.

It's a diversion, but for the record:
The Solaris libc uses a private async-signal-safe allocator
for some internal purposes, not malloc() in this case.
All of posix_spawn(), posix_spawnp(), and the posix_spawn_*()
support functions are async-signal-safe on Solaris.

Roger



From Roger.Faulkner@sun.com Thu Feb 19 09:22:10 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n1JHM93K005867
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 19 Feb 2009 09:22:10 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n1JHLwIq011825
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Fri, 20 Feb 2009 01:22:08 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KFB0006RPKVBJ00@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Thu, 19 Feb 2009 09:22:07 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.59])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KFB001AIPKT0FF0@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Thu,
 19 Feb 2009 09:22:05 -0800 (PST)
Received: from jurassic-x4600.sfbay.sun.com
 (jurassic-x4600.sfbay.sun.com [129.146.17.63])	by jurassic-x4600.sfbay.sun.com
 (8.14.3+Sun/8.14.3) with SMTP id n1JHM4e6778325; Thu,
 19 Feb 2009 09:22:04 -0800 (PST)
Date: Thu, 19 Feb 2009 09:22:04 -0800 (PST)
From: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
To: roland.mainz@nrubsig.org
Cc: psarc-ext@sun.com
Reply-to: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
Message-id: <200902191722.n1JHM4e6778325@jurassic-x4600.sfbay.sun.com>
MIME-version: 1.0
X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.7_98 SunOS 5.11 i86pc i386
Content-type: TEXT/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-MD5: BBN+jx3YrFyQMlYgKAAYAA==
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 1624


> Date: Thu, 19 Feb 2009 14:30:53 +0100
> From: Roland Mainz <roland.mainz@nrubsig.org>
> Subject: Re: PSARC/2009/116 posix_spawn_file_actions_addclosefrom_np
> To: "Roger A. Faulkner" <Roger.Faulkner@sun.com>
> Cc: psarc-ext@sun.com
> 
> "Roger A. Faulkner" wrote:
> > 
> > I am sponsoring this automatic case for myself.
> > 
> > 1.  Introduction
> > 
> >     This case adds a new posix_spawn() support function to the C library:
> > 
> >        int posix_spawn_file_actions_addclosefrom_np(
> >            posix_spawn_file_actions_t *file_actions,
> >            int filedes);
> > 
> >     The committment level of this interface is Committed.
> >     The "_np" suffix indicates that this is a non-portable
> >     Solaris extension.
> 
> Two nits:
> - IMO it may be nice to use a different suffix than "_np", e.g. IMO
> |posix_spawn_file_actions_addclosefrom_solaris()| may be better.

Others have commented anout this.  It needs to be "_np".

> - What about adding a |flags| argument to allow that future extensions
> can be made, e.g. change the prototype to...
> -- snip --
> int posix_spawn_file_actions_addclosefrom_solaris(
>             posix_spawn_file_actions_t *file_actions,
>             int filedes,
>             uint32_t flags
>             )

Future extension possibilities are desirable in general,
but the only extension I can imagine for this particular
interface would be to specify disjoint ranges of the
file descriptor space to be closed.  A flags argument
would not help with this.

I'd rather keep the interface simple, and consistent with
the existing closefrom(3C) Solaris interface.

Roger


