From b353808b13db85abbbc0c3331c04c778620ed017 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 20 Nov 2023 00:41:29 +0100 Subject: LibC: Add macros for file regnition --- userland/libc/include/dirent.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/userland/libc/include/dirent.h b/userland/libc/include/dirent.h index f190a7c..eda2b04 100644 --- a/userland/libc/include/dirent.h +++ b/userland/libc/include/dirent.h @@ -7,6 +7,12 @@ #include #include +#define STAT_REG 0 +#define STAT_DIR 1 + +#define S_ISREG(_m) (_m & (1 << STAT_REG)) +#define S_ISDIR(_m) (_m & (1 << STAT_DIR)) + struct dirent { ino_t d_ino; // File serial number. char d_name[PATH_MAX]; // Filename string of entry. -- cgit v1.2.3