Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / Usermode / include / sys / stat.h
1 /*
2  * Acess2 C Library
3  * - By John Hodge (thePowersGang)
4  */
5 #ifndef _SYS_STAT_H_
6 #define _SYS_STAT_H_
7
8 #include <acess/intdefs.h>      /* Evil */
9 #include "../stddef.h"
10
11 ;
12 typedef void    *dev_t; /* TODO: How to identify a device with Acess */
13 typedef __uint64_t      ino_t;
14 typedef unsigned int    blksize_t;
15 typedef __uint64_t      blkcnt_t;
16 typedef unsigned int    nlink_t;
17 typedef __uint32_t      mode_t;
18
19 typedef __uint32_t      uid_t;
20 typedef __uint32_t      gid_t;
21
22 #define S_IFMT          0170000 /* type of file */
23 #define         S_IFDIR 0040000 /* directory */
24 #define         S_IFCHR 0020000 /* character special */
25 #define         S_IFBLK 0060000 /* block special */
26 #define         S_IFREG 0100000 /* regular */
27 #define         S_IFLNK 0120000 /* symbolic link */
28 #define         S_IFSOCK        0140000 /* socket */
29 #define         S_IFIFO 0010000 /* fifo */
30
31
32 struct stat
33 {
34         dev_t     st_dev;     /* ID of device containing file */
35         ino_t     st_ino;     /* inode number */
36         mode_t    st_mode;    /* protection */
37         nlink_t   st_nlink;   /* number of hard links */
38         uid_t     st_uid;     /* user ID of owner */
39         gid_t     st_gid;     /* group ID of owner */
40         dev_t     st_rdev;    /* device ID (if special file) */
41         off_t     st_size;    /* total size, in bytes */
42         blksize_t st_blksize; /* blocksize for file system I/O */
43         blkcnt_t  st_blocks;  /* number of 512B blocks allocated */
44         time_t    st_atime;   /* time of last access */
45         time_t    st_mtime;   /* time of last modification */
46         time_t    st_ctime;   /* time of last status change */
47 };
48
49 extern int stat(const char *path, struct stat *buf);
50 extern int fstat(int fd, struct stat *buf);
51
52 #endif

UCC git Repository :: git.ucc.asn.au