9.51 access

#define F_OK 0b0001
#define R_OK 0b0010
#define W_OK 0b0100
#define X_OK 0b1000

#define AT_EACCESS 512

int access(int dir_fd, char *path, int len, mode_t mode, int flags);

This syscall whether the callee process can access the passed file against POSIX file permissions and Ironclad’s MAC. What to check for is specified in mode as an ORd list, as such:

Permissions are checked with the real user and group IDs, instead of the effective ones, that behaviour can be changed by passing AT_EACCESS in flags, which can also be used for other common AT flags. AT_EMPTY_PATH is not accepted because that does not make any sense with this syscall.

The syscall returns 0 on success when the passed mode is checked valid, or -1 on check failure, with the following errno: