30 lines
592 B
C
30 lines
592 B
C
/* 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_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
|
|
|
|
#define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
|
|
#define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
|
|
|
|
#endif
|