libc: Fix S_IS* macros

This commit is contained in:
apio 2023-05-01 20:00:10 +02:00
parent 48df90e636
commit 458e0a87cc
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -8,9 +8,11 @@
#define S_IFDIR 040000
#define S_IFCHR 050000
#define S_ISREG(mode) ((mode)&S_IFMT == S_IFREG)
#define S_ISDIR(mode) ((mode)&S_IFMT == S_IFDIR)
#define S_ISCHR(mode) ((mode)&S_IFMT == S_IFCHR)
#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