summaryrefslogtreecommitdiff
path: root/include/sys/stat.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-21 18:39:36 +0200
committerAnton Kling <anton@kling.gg>2024-04-21 19:29:50 +0200
commit821eb5ff9ed60d4b1c7a50ebf406f22bc0da9bd4 (patch)
tree4562261e5bd41e215c277998f20d736d28a33430 /include/sys/stat.h
parenta8959b3da1b160c84da6ead6f12188b1824d76e6 (diff)
LibC: Add different isX() functions
Diffstat (limited to 'include/sys/stat.h')
-rw-r--r--include/sys/stat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 9f3dfe9..e33b14e 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -5,6 +5,11 @@
#define STAT_REG (1 << 0)
#define STAT_DIR (1 << 1)
+#define STAT_FIFO (1 << 2)
+
+#define S_ISREG(_v) (((_v) >> 0) & 1)
+#define S_ISDIR(_v) (((_v) >> 1) & 1)
+#define S_ISFIFO(_v) (((_v) >> 2) & 1)
struct stat {
dev_t st_dev; // Device ID of device containing file.