struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; uid_t st_uid; gid_t st_gid; dev_t st_rdev; off_t st_size; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; blksize_t st_blksize; blkcnt_t st_blocks; }; int fstat(int dir_fd, char *path, int len, struct stat *statbuf, int flags);
This syscalls return information about a file, be it an already opened one with
dir_fd
and AT_EMPTY_PATH
in flags
, or by relatively
opening, either following or not following symlinks with
AT_SYMLINK_NOFOLLOW
.
0
is returned on success, -1
on failure, with the following errno:
EBADF
: The passed path or file descriptor is not valid.
ENOENT
: The file pointed by path
does not exist.
EFAULT
: The passed address for the path or stat buffer is not valid.