3 * - By John Hodge (thePowersGang)
8 #include <stdint.h> //EVIL!
10 typedef uintptr_t dev_t; // TODO: How to identify a device with Acess
11 typedef uint64_t ino_t;
12 typedef unsigned int blksize_t;
13 typedef uint64_t blkcnt_t;
14 typedef unsigned int nlink_t;
15 typedef uint32_t mode_t;
17 typedef uint32_t uid_t;
18 typedef uint32_t gid_t;
20 #define S_IFMT 0170000 /* type of file */
21 #define S_IFDIR 0040000 /* directory */
22 #define S_IFCHR 0020000 /* character special */
23 #define S_IFBLK 0060000 /* block special */
24 #define S_IFREG 0100000 /* regular */
25 #define S_IFLNK 0120000 /* symbolic link */
26 #define S_IFSOCK 0140000 /* socket */
27 #define S_IFIFO 0010000 /* fifo */
32 dev_t st_dev; /* ID of device containing file */
33 ino_t st_ino; /* inode number */
34 mode_t st_mode; /* protection */
35 nlink_t st_nlink; /* number of hard links */
36 uid_t st_uid; /* user ID of owner */
37 gid_t st_gid; /* group ID of owner */
38 dev_t st_rdev; /* device ID (if special file) */
39 off_t st_size; /* total size, in bytes */
40 blksize_t st_blksize; /* blocksize for file system I/O */
41 blkcnt_t st_blocks; /* number of 512B blocks allocated */
42 time_t st_atime; /* time of last access */
43 time_t st_mtime; /* time of last modification */
44 time_t st_ctime; /* time of last status change */
47 extern int stat(const char *path, struct stat *buf);
48 extern int fstat(int fd, struct stat *buf);