tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix pkg_install on macOS Monterey

* On 2021-11-03 at 14:16 GMT, Joerg Sonnenberger wrote:

On Wed, Nov 03, 2021 at 12:28:39PM +0000, Jonathan Perkin wrote:
* On 2021-11-03 at 11:49 GMT, David Brownlee wrote:

> Dumb question - could posix_spawn be used (and does it exhibit the same issue)?

Yeh it could, I discounted it as it has the same problems as system() (the
chdir() is being performed in the parent process), and I'm not convinced
it's very portable, but I could be wrong.

I added that implementation as a comment here:

Try something like:

  int old_cwd = open(".", O_RDONLY|O_CLOEXEC|O_DIRECTORY);

Modulo error checking and defining O_CLOEXEC/O_DIRECTORY to 0 if they
don't exist.

Ok, how about this one:

I went back and looked through the xnu history and it looks like posix_spawn was added in 10.5, or at least around then (xnu-1228), so I'd be happy to turn this on for __APPLE__ as even trying to support 10.6 a few years back was a miserable experience.

Jonathan Perkin  -  Joyent, Inc.  -

Home | Main Index | Thread Index | Old Index