Syntax | #include <sys/stat.h> Optional int fstat(int fildes, struct stat *buf); CRTE111A30 | |||||||||||||||||||||||||||||
Description |
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 contents of the structure pointed to by buf include the following members: mode_t st_mode; /* File mode (see mknod()) */ ino_t st_ino; /* Inode number (i-Node) */ dev_t st_dev; /* ID of device containing a directory entry for this file */ dev_t st_rdev; /* Device ID, only defined for character special or block special files */ nlink_t st_nlink; /* Number of links */ uid_t st_uid; /* User ID of the file's owner */ gid_t st_gid; /* Group ID of the file's group */ off_t st_size; /* File size in bytes */ time_t st_atime; /* Time of last access */ time_t st_mtime; /* Time of last data modification */ time_t st_ctime; /* Time of last file status change The time is measured in seconds since 00:00:00 UTC, Jan 1, 1970 */ long st_blksize; /* Preferred I/O block size */ blkcnt_t st_blocks; /* Number of st_blksize blocks allocated */ The elements of the structure ino64_t st_ino off64_t st_size and blkcnt64_t st_blocks statx and stat64x are defined like those of the structures stat bzw. stat64 , with the exception of the following components:time64_t st_atime; time64_t st_mtime; time64_t st_ctime;
The elements have the following meanings: BS2000 With BS2000 files the following elements of the mode_t st_mode File mode containing access permissions and file type. Access permissions: Here the Basic ACL is mapped to the file mode bits. The file mode bits are all 0 if the file does not have basic ACL protection. File type: Introduction of a new file type S_IFDVSBS2=X'10000000'. This type is, however, not disjoint to S_IFPOSIXBS2. The S_ISDVSBS2(mode) macro can be used to query. Introduction of a new file type S_IFDVSNODE=X'20000000'. This type is also not disjoint to S_IFPOSIXBS2. The S_ISDVSNODE(mode) macro can be used to query. A node file is also a BS2000 DVS file. I.e. for node files the bit time_t st_atime Last access time as is usual in BS2000, but in seconds since 1.1.1970 UTC). time_t st_mtime Last modification time. time_t st_ctime Creation time. long st_blksize Block size, 2K (i.e. 1 PAM page). long st_blocks Number of blocks on the disk that are occupied by the file. dev_t st_dev Contains the 4-byte The two consecutive fields
All other fields are set to 0. The In the flag parameter, the value The functions with the suffix x behave like the functions of the same name without a suffix, except that they also working correctly after 01/19/2038 03:14:07 UTC. | |||||||||||||||||||||||||||||
Return val. | 0 | if successful. | ||||||||||||||||||||||||||||
-1 | if an error occurs; for POSIX files | |||||||||||||||||||||||||||||
Errors |
| |||||||||||||||||||||||||||||
|
| fildes is not a valid file descriptor. | ||||||||||||||||||||||||||||
|
| buf points to an invalid address. | ||||||||||||||||||||||||||||
|
| An I/O error occurred while reading the file system. | ||||||||||||||||||||||||||||
|
| fildes refers to a remote computer, whereby the connection to this computer is not active anymore. | ||||||||||||||||||||||||||||
|
| A component is too large and cannot be stored in the structure pointed to by buf. | ||||||||||||||||||||||||||||
|
| A signal was caught during the | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| A timestamp is too large for a | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| The fd parameter was not opened with | ||||||||||||||||||||||||||||
|
| The path parameter does not specify an absolute pathname, and the fd parameter does not have the value | ||||||||||||||||||||||||||||
|
| The path parameter does not specify an absolute pathname, and the file descriptor fd is not connected with a directory. | ||||||||||||||||||||||||||||
|
| The value of the flag parameter is invalid. | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| POSIX-BC correction status < A47. | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| POSIX-BC correction status < A47. | ||||||||||||||||||||||||||||
See also |
|