2020-06-15 14:18:57 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_STAT_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_STAT_H_
|
|
|
|
#include "libc/calls/struct/timespec.h"
|
2022-08-13 20:11:56 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2021-09-04 05:19:41 +00:00
|
|
|
struct stat { /* cosmo abi */
|
|
|
|
uint64_t st_dev; /* 0: id of device with file */
|
|
|
|
uint64_t st_ino; /* 8: inode number in disk b-tree */
|
|
|
|
uint64_t st_nlink; /* 16: hard link count */
|
|
|
|
uint32_t st_mode; /* 24: octal file mask thing */
|
|
|
|
uint32_t st_uid; /* 28: user id of owner */
|
|
|
|
uint32_t st_gid; /* group id of owning group */
|
2022-04-26 04:16:05 +00:00
|
|
|
uint32_t st_flags; /* nt/xnu/bsd-only */
|
2021-09-04 05:19:41 +00:00
|
|
|
uint64_t st_rdev; /* id of device if a special file */
|
|
|
|
int64_t st_size; /* bytes in file */
|
|
|
|
int64_t st_blksize; /* preferred chunking for underlying filesystem */
|
|
|
|
int64_t st_blocks; /* number of 512-byte pages allocated to file */
|
|
|
|
struct timespec st_atim; /* access time */
|
|
|
|
struct timespec st_mtim; /* modified time */
|
|
|
|
struct timespec st_ctim; /* complicated time */
|
|
|
|
struct timespec st_birthtim;
|
2022-04-26 04:16:05 +00:00
|
|
|
uint64_t st_gen; /* xnu/bsd only */
|
2020-06-15 14:18:57 +00:00
|
|
|
};
|
|
|
|
|
2022-06-09 03:01:28 +00:00
|
|
|
int stat(const char *, struct stat *);
|
|
|
|
int lstat(const char *, struct stat *);
|
|
|
|
int fstat(int, struct stat *);
|
|
|
|
int fstatat(int, const char *, struct stat *, int);
|
|
|
|
|
2022-08-13 20:11:56 +00:00
|
|
|
COSMOPOLITAN_C_END_
|
2020-06-15 14:18:57 +00:00
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_STAT_H_ */
|