Tavian Barnes <taviana...@tavianator.com> writes: > One thing you'll probably run into is that posix_spawn() has no interface > for running the spawned process in a new working directory. That makes > implementing -execdir/-okdir somewhat awkward.
Couldn't you change the w.d. to the correct target, spawn, and then change the w.d. back? Alternatively, one could direct the spawned process to run a program that would set the working directory to, say, the first argument, and then use the remaining arguments to run/fork/spawn the target program. Indeed, I would expect Threos to have a system program to do exactly this, since other people must have seen the same problem. Dale