2023-03-12 15:55:46 +00:00
|
|
|
/* 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
|
2023-05-20 19:46:31 +00:00
|
|
|
#define S_IFLNK 010000
|
2023-05-23 18:54:25 +00:00
|
|
|
#define S_IFIFO 020000
|
2023-05-26 18:27:47 +00:00
|
|
|
#define S_IFBLK 030000
|
2023-03-12 15:55:46 +00:00
|
|
|
#define S_IFDIR 040000
|
2023-04-10 17:56:03 +00:00
|
|
|
#define S_IFCHR 050000
|
|
|
|
|
2023-05-01 18:00:10 +00:00
|
|
|
#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)
|
2023-05-26 18:27:47 +00:00
|
|
|
#define S_ISBLK(mode) __CHECK_TYPE(mode, S_IFBLK)
|
2023-05-20 19:46:31 +00:00
|
|
|
#define S_ISLNK(mode) __CHECK_TYPE(mode, S_IFLNK)
|
2023-05-23 18:54:25 +00:00
|
|
|
#define S_ISFIFO(mode) __CHECK_TYPE(mode, S_IFIFO)
|
2023-03-12 15:55:46 +00:00
|
|
|
|
|
|
|
#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
|