Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/stat.h
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
* XXX We get miscellaneous namespace pollution with this. | * XXX We get miscellaneous namespace pollution with this. | ||||
*/ | */ | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#endif | #endif | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct ostat { | struct ostat { | ||||
__uint16_t st_dev; /* inode's device */ | __uint16_t st_dev; /* inode's device */ | ||||
ino_t st_ino; /* inode's number */ | __uint32_t st_ino; /* inode's number */ | ||||
mode_t st_mode; /* inode protection mode */ | mode_t st_mode; /* inode protection mode */ | ||||
nlink_t st_nlink; /* number of hard links */ | __uint16_t st_nlink; /* number of hard links */ | ||||
__uint16_t st_uid; /* user ID of the file's owner */ | __uint16_t st_uid; /* user ID of the file's owner */ | ||||
__uint16_t st_gid; /* group ID of the file's group */ | __uint16_t st_gid; /* group ID of the file's group */ | ||||
__uint16_t st_rdev; /* device type */ | __uint16_t st_rdev; /* device type */ | ||||
__int32_t st_size; /* file size, in bytes */ | __int32_t st_size; /* file size, in bytes */ | ||||
struct timespec st_atim; /* time of last access */ | struct timespec st_atim; /* time of last access */ | ||||
struct timespec st_mtim; /* time of last data modification */ | struct timespec st_mtim; /* time of last data modification */ | ||||
struct timespec st_ctim; /* time of last file status change */ | struct timespec st_ctim; /* time of last file status change */ | ||||
__int32_t st_blksize; /* optimal blocksize for I/O */ | __int32_t st_blksize; /* optimal blocksize for I/O */ | ||||
__int32_t st_blocks; /* blocks allocated for file */ | __int32_t st_blocks; /* blocks allocated for file */ | ||||
fflags_t st_flags; /* user defined flags for file */ | fflags_t st_flags; /* user defined flags for file */ | ||||
__uint32_t st_gen; /* file generation number */ | __uint32_t st_gen; /* file generation number */ | ||||
}; | }; | ||||
#endif | #endif | ||||
struct stat { | #if defined(_WANT_FREEBSD11_STAT) || defined(_KERNEL) | ||||
__dev_t st_dev; /* inode's device */ | struct freebsd11_stat { | ||||
ino_t st_ino; /* inode's number */ | __uint32_t st_dev; /* inode's device */ | ||||
__uint32_t st_ino; /* inode's number */ | |||||
mode_t st_mode; /* inode protection mode */ | mode_t st_mode; /* inode protection mode */ | ||||
nlink_t st_nlink; /* number of hard links */ | __uint16_t st_nlink; /* number of hard links */ | ||||
uid_t st_uid; /* user ID of the file's owner */ | uid_t st_uid; /* user ID of the file's owner */ | ||||
gid_t st_gid; /* group ID of the file's group */ | gid_t st_gid; /* group ID of the file's group */ | ||||
__dev_t st_rdev; /* device type */ | __uint32_t st_rdev; /* device type */ | ||||
struct timespec st_atim; /* time of last access */ | struct timespec st_atim; /* time of last access */ | ||||
struct timespec st_mtim; /* time of last data modification */ | struct timespec st_mtim; /* time of last data modification */ | ||||
struct timespec st_ctim; /* time of last file status change */ | struct timespec st_ctim; /* time of last file status change */ | ||||
off_t st_size; /* file size, in bytes */ | off_t st_size; /* file size, in bytes */ | ||||
blkcnt_t st_blocks; /* blocks allocated for file */ | blkcnt_t st_blocks; /* blocks allocated for file */ | ||||
blksize_t st_blksize; /* optimal blocksize for I/O */ | blksize_t st_blksize; /* optimal blocksize for I/O */ | ||||
fflags_t st_flags; /* user defined flags for file */ | fflags_t st_flags; /* user defined flags for file */ | ||||
__uint32_t st_gen; /* file generation number */ | __uint32_t st_gen; /* file generation number */ | ||||
__int32_t st_lspare; | __int32_t st_lspare; | ||||
struct timespec st_birthtim; /* time of file creation */ | struct timespec st_birthtim; /* time of file creation */ | ||||
/* | /* | ||||
* Explicitly pad st_birthtim to 16 bytes so that the size of | * Explicitly pad st_birthtim to 16 bytes so that the size of | ||||
* struct stat is backwards compatible. We use bitfields instead | * struct stat is backwards compatible. We use bitfields instead | ||||
* of an array of chars so that this doesn't require a C99 compiler | * of an array of chars so that this doesn't require a C99 compiler | ||||
* to compile if the size of the padding is 0. We use 2 bitfields | * to compile if the size of the padding is 0. We use 2 bitfields | ||||
* to cover up to 64 bits on 32-bit machines. We assume that | * to cover up to 64 bits on 32-bit machines. We assume that | ||||
* CHAR_BIT is 8... | * CHAR_BIT is 8... | ||||
*/ | */ | ||||
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | ||||
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | ||||
}; | }; | ||||
#endif /* _WANT_FREEBSD11_STAT || _KERNEL */ | |||||
#if defined(__i386__) | |||||
#define __STAT_TIME_T_EXT 1 | |||||
#endif | |||||
struct stat { | |||||
dev_t st_dev; /* inode's device */ | |||||
ino_t st_ino; /* inode's number */ | |||||
nlink_t st_nlink; /* number of hard links */ | |||||
mode_t st_mode; /* inode protection mode */ | |||||
__int16_t st_padding0; | |||||
uid_t st_uid; /* user ID of the file's owner */ | |||||
gid_t st_gid; /* group ID of the file's group */ | |||||
__int32_t st_padding1; | |||||
dev_t st_rdev; /* device type */ | |||||
#ifdef __STAT_TIME_T_EXT | |||||
__int32_t st_atim_ext; | |||||
#endif | |||||
struct timespec st_atim; /* time of last access */ | |||||
#ifdef __STAT_TIME_T_EXT | |||||
__int32_t st_mtim_ext; | |||||
#endif | |||||
struct timespec st_mtim; /* time of last data modification */ | |||||
#ifdef __STAT_TIME_T_EXT | |||||
__int32_t st_ctim_ext; | |||||
#endif | |||||
struct timespec st_ctim; /* time of last file status change */ | |||||
#ifdef __STAT_TIME_T_EXT | |||||
__int32_t st_btim_ext; | |||||
#endif | |||||
struct timespec st_birthtim; /* time of file creation */ | |||||
off_t st_size; /* file size, in bytes */ | |||||
blkcnt_t st_blocks; /* blocks allocated for file */ | |||||
blksize_t st_blksize; /* optimal blocksize for I/O */ | |||||
fflags_t st_flags; /* user defined flags for file */ | |||||
__uint64_t st_gen; /* file generation number */ | |||||
__uint64_t st_spare[10]; | |||||
}; | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
struct nstat { | struct nstat { | ||||
__dev_t st_dev; /* inode's device */ | __uint32_t st_dev; /* inode's device */ | ||||
ino_t st_ino; /* inode's number */ | __uint32_t st_ino; /* inode's number */ | ||||
__uint32_t st_mode; /* inode protection mode */ | __uint32_t st_mode; /* inode protection mode */ | ||||
__uint32_t st_nlink; /* number of hard links */ | __uint32_t st_nlink; /* number of hard links */ | ||||
uid_t st_uid; /* user ID of the file's owner */ | uid_t st_uid; /* user ID of the file's owner */ | ||||
gid_t st_gid; /* group ID of the file's group */ | gid_t st_gid; /* group ID of the file's group */ | ||||
__dev_t st_rdev; /* device type */ | __uint32_t st_rdev; /* device type */ | ||||
struct timespec st_atim; /* time of last access */ | struct timespec st_atim; /* time of last access */ | ||||
struct timespec st_mtim; /* time of last data modification */ | struct timespec st_mtim; /* time of last data modification */ | ||||
struct timespec st_ctim; /* time of last file status change */ | struct timespec st_ctim; /* time of last file status change */ | ||||
off_t st_size; /* file size, in bytes */ | off_t st_size; /* file size, in bytes */ | ||||
blkcnt_t st_blocks; /* blocks allocated for file */ | blkcnt_t st_blocks; /* blocks allocated for file */ | ||||
blksize_t st_blksize; /* optimal blocksize for I/O */ | blksize_t st_blksize; /* optimal blocksize for I/O */ | ||||
fflags_t st_flags; /* user defined flags for file */ | fflags_t st_flags; /* user defined flags for file */ | ||||
__uint32_t st_gen; /* file generation number */ | __uint32_t st_gen; /* file generation number */ | ||||
struct timespec st_birthtim; /* time of file creation */ | struct timespec st_birthtim; /* time of file creation */ | ||||
/* | /* | ||||
* See above about the following padding. | * See comment in the definition of struct freebsd11_stat | ||||
* above about the following padding. | |||||
*/ | */ | ||||
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | ||||
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); | ||||
}; | }; | ||||
#endif | #endif | ||||
#ifndef _KERNEL | #ifndef _KERNEL | ||||
#define st_atime st_atim.tv_sec | #define st_atime st_atim.tv_sec | ||||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |