Determines accessibility of a file.
Arguments
eax |
33 |
ebx |
Pointer to a null-terminated string that specifies the pathname of the file. |
ecx |
Mode to test for. Supported values:
F_OK - Test for existence.
X_OK - Test for execute permission.
W_OK - Test for write permission.
R_OK - Test for read permission. |
|
Return values
If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:
-EIO |
An I/O error occurred while reading from or writing to the file system. |
-EACCES |
Search permission is denied for one of the directories in the path prefix of the path. |
-ENOTDIR |
A component used as a directory in pathname is not, in fact, a directory |
-EIO |
An I/O error occurred while reading from or writing to the file system. |
-ELOOP |
Too many symbolic links were encountered in path resolving. |
-ENAMETOOLONG |
Path is too long. |
-ENOMEM |
Insufficient kernel memory was available. |
-ENOENT |
The file does not exist. |
-EINVAL |
Mode was incorrectly specified. |
-EFAULT |
ebx points outside your accessible address space. |
|
Remarks
The check is done with the process's real UID and GID, rather than with the effective IDs as is done when actually attempting an operation. This is to allow set-user-ID programs to easily determine the invoking user's authority.
If the process has appropriate privileges, an implementation may indicate success for X_OK even if none of the execute file permission bits are set.
Compatibility
n/a |