access has the wrong semantics. You could use euidaccess. But then that will has the wrong semantics if POSIX_SPAWN_RESETIDS was used. It quickly gets quite hairy. Trying to match the semantics that execve will use after everything that posix_spawn might be doing in the child side is a losing battle.