You were planning to use stat, right? Are you planning to stat the interperter specified in shebang as well? Some of the races can be avoided by opening the file before posix_spawn and then using fstat on the fd. Alternatively that posix_spawn check from configure.ac can be executed at runtime to support cross compilation.
regards, Dmitry On Mon, Sep 2, 2019 at 9:44 AM Paul Smith <psm...@gnu.org> wrote: > > On Sun, 2019-09-01 at 15:33 -0400, Dmitry Goncharov via Bug reports and > discussion for GNU make wrote: > > This patch executes posix_spawnp at configuration time and then > > disables posix_spawn if posix_spawn returns 0 on an attempt to exec a > > missing file. > > This solution won't work for cross compilation. > > Thanks Dmitry. I guessed at this issue during testing: > > https://lists.gnu.org/archive/html/bug-make/2019-08/msg00063.html > > I have a different solution in mind that doesn't require using > configure tests and won't have issues with cross-compilation: I'm just > handling the 127 exit code and generating the appropriate error message > directly. > _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make