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 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.


Home | Main Index | Thread Index | Old Index