#if _lib_posix_spawn < 2
        if (waitpid(pid, &err, WNOHANG|WNOWAIT) == pid && EXIT_STATUS(err) == 
127)
        {
                while (waitpid(pid, NiL, 0) == -1 && errno == EINTR);
                if (!access(path, X_OK))
                        errno = ENOEXEC;
                pid = -1;
        }
#endif

It will fail with EINVAL, because of WNOWAIT. This option is not supported in waitpid. It's supported only in waitid().

so you'd have to use something like

pid_t pid;
siginfo_t err;
if (!waitid(P_PID, pid, &err, WEXITED|WNOHANG|WNOWAIT) && err.si_status == 127)


_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to