/* bits/modes.h: S_* constants for stat(), mkdir(), open() and more. */ #ifndef _BITS_MODES_H #define _BITS_MODES_H #define S_IFMT 070000 #define S_IFREG 000000 #define S_IFDIR 040000 #define S_IFCHR 050000 #define __CHECK_TYPE(mode, type) (((mode)&S_IFMT) == type) #define S_ISREG(mode) __CHECK_TYPE(mode, S_IFREG) #define S_ISDIR(mode) __CHECK_TYPE(mode, S_IFDIR) #define S_ISCHR(mode) __CHECK_TYPE(mode, S_IFCHR) #define S_IRWXU 0700 #define S_IRUSR 0400 #define S_IWUSR 0200 #define S_IXUSR 0100 #define S_IRWXG 070 #define S_IRGRP 040 #define S_IWGRP 020 #define S_IXGRP 010 #define S_IRWXO 07 #define S_IROTH 04 #define S_IWOTH 02 #define S_IXOTH 01 #define S_ISUID 04000 #define S_ISGID 02000 #define S_ISVTX 01000 #endif