Re: [PATCH] Add posix_spawn_file_actions_addclosefrom_np

Chris Hanson <[email protected]> Tue, 30 Jun 2026 14:43:59 -0700
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Jun 30, 2026, at 4:15=E2=80=AFAM, Greg Troxel <[email protected]> wrote:
> Visibility defines are tricky business.

Indeed, a business I=E2=80=99m quite familiar with.

(My bona fides: I spent a good chunk of my career working on Xcode at =
Apple, so I=E2=80=99m familiar with the needs of backwards and forwards =
binary compatibility and how to introduce and deprecate API across a =
range of OS versions. One of the things I did was enable Xcode to build =
like other Mac applications, such that it could run on multiple versions =
of macOS, and take advantage of new APIs only when running on the =
versions that had them. And I also explained a lot of how all this =
worked to other internal and third party developers.)

> Chris: If you build a test program with no visibility defines that =
uses
> this API, does it build?

I think based on Taylor=E2=80=99s reply this isn=E2=80=99t necessary and =
that guarding the non-POSIX API with _NETBSD_SOURCE is the right thing =
since the =E2=80=9Cnatural=E2=80=9D build environment on NetBSD, with on =
other visibility defines, will set it.

It=E2=80=99s disappointing that some other platforms play more fast and =
loose with these definitions, it=E2=80=99s not very in the spirit of SUS =
or X/Open or POSIX to do so, but I don=E2=80=99t think NetBSD should let =
that really drive its choices. What NetBSD is doing is fine and works, =
and if someone is going to set one of the X/Open or POSIX or SUS defines =
they should really know what they=E2=80=99re getting themselves into and =
why.

  -- Chris