boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

stat.h (911B)


      1 #ifndef _SYS_STAT_H
      2 #define _SYS_STAT_H
      3 #include <sys/types.h>
      4 struct stat {
      5     dev_t  st_dev;
      6     ino_t  st_ino;
      7     mode_t st_mode;
      8     nlink_t st_nlink;
      9     uid_t  st_uid;
     10     gid_t  st_gid;
     11     dev_t  st_rdev;
     12     off_t  st_size;
     13     blksize_t st_blksize;
     14     blkcnt_t  st_blocks;
     15     long   st_atime;
     16     long   st_mtime;
     17     long   st_ctime;
     18 };
     19 int stat(const char *, struct stat *);
     20 int fstat(int, struct stat *);
     21 int lstat(const char *, struct stat *);
     22 int mkdir(const char *, mode_t);
     23 int chmod(const char *, mode_t);
     24 #define S_IFMT   0170000
     25 #define S_IFREG  0100000
     26 #define S_IFDIR  0040000
     27 #define S_IFLNK  0120000
     28 #define S_ISREG(m)  (((m) & S_IFMT) == S_IFREG)
     29 #define S_ISDIR(m)  (((m) & S_IFMT) == S_IFDIR)
     30 #define S_ISLNK(m)  (((m) & S_IFMT) == S_IFLNK)
     31 #define S_IRWXU  0700
     32 #define S_IRUSR  0400
     33 #define S_IWUSR  0200
     34 #define S_IXUSR  0100
     35 #define S_IRWXG  0070
     36 #define S_IRWXO  0007
     37 #endif