From 112eafe13c3628cad6e692179c064dbbc3be2d8b Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 9 Jun 2023 17:22:31 +0200 Subject: ports/dash: stub out everything needed for dash to compile --- src/user/lib/include/sys/stat.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/user/lib/include/sys/stat.h') diff --git a/src/user/lib/include/sys/stat.h b/src/user/lib/include/sys/stat.h index 9b9523c..26c8323 100644 --- a/src/user/lib/include/sys/stat.h +++ b/src/user/lib/include/sys/stat.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include // struct timespec @@ -33,6 +34,9 @@ struct stat { #define S_IFDIR 0040000 #define S_IFCHR 0020000 #define S_IFIFO 0010000 +#define S_ISUID 04000 +#define S_ISGID 02000 +#define S_ISVTX 01000 /* inode(7) */ #define S_ISREG(m) ((m & S_IFMT) == S_IFREG) @@ -49,6 +53,12 @@ static inline int fstat(int fd, struct stat *sb) { return -1; } +static inline int stat(const char *restrict path, struct stat *restrict sb) { + (void)path; (void)sb; + errno = ENOSYS; + return -1; +} + static inline int lstat(const char *restrict path, struct stat *restrict sb) { (void)path; (void)sb; errno = ENOSYS; @@ -56,6 +66,12 @@ static inline int lstat(const char *restrict path, struct stat *restrict sb) { } int mkdir(const char *path, mode_t mode); + +static inline mode_t umask(mode_t mask) { + (void)mask; + __libc_panic("unimplemented"); +} + static inline int chmod(const char *path, mode_t mode) { (void)path; (void)mode; errno = ENOSYS; -- cgit v1.2.3