diff options
Diffstat (limited to 'src/user/lib/include/sys')
-rw-r--r-- | src/user/lib/include/sys/resource.h | 2 | ||||
-rw-r--r-- | src/user/lib/include/sys/stat.h | 16 | ||||
-rw-r--r-- | src/user/lib/include/sys/time.h | 0 | ||||
-rw-r--r-- | src/user/lib/include/sys/times.h | 13 | ||||
-rw-r--r-- | src/user/lib/include/sys/types.h | 1 | ||||
-rw-r--r-- | src/user/lib/include/sys/wait.h | 13 |
6 files changed, 45 insertions, 0 deletions
diff --git a/src/user/lib/include/sys/resource.h b/src/user/lib/include/sys/resource.h new file mode 100644 index 0000000..4582ce0 --- /dev/null +++ b/src/user/lib/include/sys/resource.h @@ -0,0 +1,2 @@ +#pragma once +struct rusage {}; 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 <bits/panic.h> #include <sys/stat.h> #include <sys/types.h> #include <time.h> // 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; diff --git a/src/user/lib/include/sys/time.h b/src/user/lib/include/sys/time.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/user/lib/include/sys/time.h diff --git a/src/user/lib/include/sys/times.h b/src/user/lib/include/sys/times.h new file mode 100644 index 0000000..4a8d3ef --- /dev/null +++ b/src/user/lib/include/sys/times.h @@ -0,0 +1,13 @@ +#pragma once +#include <bits/panic.h> + +struct tms { + clock_t tms_utime; + clock_t tms_stime; + clock_t tms_cutime; + clock_t tms_cstime; +}; + +static inline clock_t times(struct tms *buf) { + __libc_panic("unimplemented"); +} diff --git a/src/user/lib/include/sys/types.h b/src/user/lib/include/sys/types.h index 3b04988..faf656a 100644 --- a/src/user/lib/include/sys/types.h +++ b/src/user/lib/include/sys/types.h @@ -15,3 +15,4 @@ typedef int uid_t; typedef int gid_t; typedef int blksize_t; typedef int blkcnt_t; +typedef int pid_t; diff --git a/src/user/lib/include/sys/wait.h b/src/user/lib/include/sys/wait.h index e69de29..c71418c 100644 --- a/src/user/lib/include/sys/wait.h +++ b/src/user/lib/include/sys/wait.h @@ -0,0 +1,13 @@ +#pragma once +#include <sys/types.h> + +#define WIFSTOPPED(x) 0 +#define WEXITSTATUS(x) 0 +#define WIFEXITED(x) 0 +#define WSTOPSIG(x) 0 +#define WTERMSIG(x) 0 + +#define WNOHANG 0 +#define WUNTRACED 0 + +pid_t wait3(int *wstatus, int opts, struct rusage *rusage); |