When a program wants to read or write to a file, it needs to call the system call
open() for the file first.
One of the arguments to the call specifies which operations the program wants to be able to do.
It the program indicates it wants to read or write the file, and the process does not have the perspective for the operations, the
open() call ends up in the error
EACCESS, and the file can not be used.
In a similar way, when a program - for example, your shell - needs to execute a program file, it uses the system call
execve(). This returns the error
EACCESS if the execute permission is not given by the file mode.
Below are some relevant parts of the man pages in section 2, "system calls"
From the man page for open(2)
man 2 open:
OPEN(2) Linux Programmer's Manual OPEN(2)
open, creat - open and possibly create a file or device
int open(const char *pathname, int flags);
[ ... ]
The argument flags must include one of the following access modes:
O_RDONLY, O_WRONLY, or O_RDWR. These request opening the file read-
only, write-only, or read/write, respectively.
[ ... ]
EACCES The requested access to the file is not allowed, or search per‐
mission is denied for one of the directories in the path prefix
of pathname, or the file did not exist yet and write access to
the parent directory is not allowed. (See also path_resolu‐
From the man page for execve(2)
man 2 execve:
EXECVE(2) Linux Programmer's Manual EXECVE(2)
execve - execute program
int execve(const char *filename, char *const argv,
char *const envp);
[ ... ]
EACCES Execute permission is denied for the file or a script or ELF interpreter.