I am executing a binary with execl. This is all working OK, waitpid returns a correct pid, WIFEXITED(pidstatus) gives a 1 and WEXITSTATUS(pidstatus) a 0.
Now I change the permissions for that binary to restrict its access.
The binary is not being executed and execl now returns, which I believe it never should (with reason -1). However, waitpid still returns a correct pid and the macros WIFEXITED(pidstatus) and WEXITSTATUS(pidstatus) have not changed. Why do they still indicate a successful operation?