include/sys/stat.h and include/sys/types.h: Update struct stat to confirm opengroup spec:

https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html
This commit is contained in:
Xiang Xiao 2019-11-19 09:54:57 -06:00 committed by Gregory Nutt
parent b72f7cf47f
commit b58ccc96e4
2 changed files with 12 additions and 2 deletions

View File

@ -124,13 +124,19 @@ struct stat
{
/* Required, standard fields */
dev_t st_dev; /* Device ID of device containing file */
ino_t st_ino; /* File serial number */
mode_t st_mode; /* File type, attributes, and access mode bits */
nlink_t st_nlink; /* Number of hard links to the file */
uid_t st_uid; /* User ID of file */
gid_t st_gid; /* Group ID of file */
dev_t st_rdev; /* Device ID (if file is character or block special) */
off_t st_size; /* Size of file/directory, in bytes */
blksize_t st_blksize; /* Block size used for filesystem I/O */
blkcnt_t st_blocks; /* Number of blocks allocated */
time_t st_atime; /* Time of last access */
time_t st_mtime; /* Time of last modification */
time_t st_ctime; /* Time of last status change */
blksize_t st_blksize; /* Block size used for filesystem I/O */
blkcnt_t st_blocks; /* Number of blocks allocated */
/* Internal fields. These are part this specific implementation and
* should not referenced by application code for portability reasons.

View File

@ -165,6 +165,10 @@ typedef uint16_t dev_t;
typedef uint16_t ino_t;
/* nlink_t is used for link counts */
typedef uint16_t nlink_t;
/* pid_t is used for process IDs and process group IDs. It must be signed because
* negative PID values are used to represent invalid PIDs.
*/