Syntax | #include <sys/stat.h> int lstat (const char *path, struct stat *buf); CRTE111A30 int lstatx(const char *path, struct statx *buf); | |
Description | Like buf is a pointer to a There is no difference in functionality between The functions with the suffix x behave like the functions of the same name without a suffix, except that they return the file status in a corresponding The mode_t st_mode; /* File mode (see mknod()) */ ino_t st_ino; /* Inode number */ dev_t st_dev; /* Device ID which contains a directory entry for this file */ dev_t st_rdev; /* Device ID, defined for character-special or block-special files only */ nlink_t st_nlink; /* Number of links */ uid_t st_uid; /* User ID of the file owner */ gid_t st_gid; /* Group ID of the file owner */ off_t st_size; /* File size in bytes */ time_t st_atime; /* Time of the last access */ time_t st_mtime; /* Time of the last data modification */ time_t st_ctime; /* Time of the last change of file status The time is measured in seconds as of January 1, 1970, 00:00:00 */ long st_blksize; /* Preferred I/O block size */ blkcnt_t st_blocks; /* Number of assigned st_blksize blocks */ The elements of the structure ino64_t st_ino off64_t st_size and blkcnt64_t st_blocks The elements of the structures time64_t st_atime; time64_t st_mtime; time64_t st_ctime; In addition to the modes described in The | |
Return val. | 0 | if successful. |
-1 | if an error occurs. | |
Errors |
| |
|
| Search permission is denied for a component of the path. |
|
| An I/O error occurred when reading from or writing to the file system. |
|
| Too many symbolic links were encountered in resolving path. |
|
| |
The length of the pathname exceeds | ||
|
| A component of the pathname prefix is not a directory. |
|
| A component of the pathname does not exist, or path points to an empty string. |
|
| A component is too large to be stored in the structure pointed to by buf. |
| BS2000 | |
|
| An attempt was made to access a BS2000 file. |
|
| |
The resolving of symbolic links in the pathname leads to an interim result whose length exceeds | ||
|
| buf or path point to an invalid address. |
|
| A signal was caught during the |
| ||
|
| A timestamp is too large for a |
| ||
|
| POSIX-BC correction status < A47. |
See also |
|