include/uapi/linux/stat.h

Source file repositories/reference/linux-study-clean/include/uapi/linux/stat.h

File Facts

System
Linux kernel
Corpus path
include/uapi/linux/stat.h
Extension
.h
Size
7879 bytes
Lines
261
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct statx_timestamp {
	__s64	tv_sec;
	__u32	tv_nsec;
	__s32	__reserved;
};

/*
 * Structures for the extended file attribute retrieval system call
 * (statx()).
 *
 * The caller passes a mask of what they're specifically interested in as a
 * parameter to statx().  What statx() actually got will be indicated in
 * st_mask upon return.
 *
 * For each bit in the mask argument:
 *
 * - if the datum is not supported:
 *
 *   - the bit will be cleared, and
 *
 *   - the datum will be set to an appropriate fabricated value if one is
 *     available (eg. CIFS can take a default uid and gid), otherwise
 *
 *   - the field will be cleared;
 *
 * - otherwise, if explicitly requested:
 *
 *   - the datum will be synchronised to the server if AT_STATX_FORCE_SYNC is
 *     set or if the datum is considered out of date, and
 *
 *   - the field will be filled in and the bit will be set;
 *
 * - otherwise, if not requested, but available in approximate form without any
 *   effort, it will be filled in anyway, and the bit will be set upon return
 *   (it might not be up to date, however, and no attempt will be made to
 *   synchronise the internal state first);
 *
 * - otherwise the field and the bit will be cleared before returning.
 *
 * Items in STATX_BASIC_STATS may be marked unavailable on return, but they
 * will have values installed for compatibility purposes so that stat() and
 * co. can be emulated in userspace.
 */
struct statx {
	/* 0x00 */
	/* What results were written [uncond] */
	__u32	stx_mask;

	/* Preferred general I/O size [uncond] */
	__u32	stx_blksize;

	/* Flags conveying information about the file [uncond] */
	__u64	stx_attributes;

	/* 0x10 */
	/* Number of hard links */
	__u32	stx_nlink;

	/* User ID of owner */
	__u32	stx_uid;

	/* Group ID of owner */
	__u32	stx_gid;

	/* File mode */
	__u16	stx_mode;
	__u16	__spare0[1];

	/* 0x20 */
	/* Inode number */
	__u64	stx_ino;

	/* File size */
	__u64	stx_size;

	/* Number of 512-byte blocks allocated */
	__u64	stx_blocks;

	/* Mask to show what's supported in stx_attributes */
	__u64	stx_attributes_mask;

	/* 0x40 */
	/* Last access time */
	struct statx_timestamp	stx_atime;

	/* File creation time */
	struct statx_timestamp	stx_btime;

	/* Last attribute change time */
	struct statx_timestamp	stx_ctime;

Annotation

Implementation Notes