summaryrefslogtreecommitdiff
path: root/src/user/lib/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/include/sys')
-rw-r--r--src/user/lib/include/sys/ioctl.h13
-rw-r--r--src/user/lib/include/sys/mman.h18
-rw-r--r--src/user/lib/include/sys/param.h2
-rw-r--r--src/user/lib/include/sys/resource.h2
-rw-r--r--src/user/lib/include/sys/stat.h70
-rw-r--r--src/user/lib/include/sys/sysmacros.h3
-rw-r--r--src/user/lib/include/sys/time.h0
-rw-r--r--src/user/lib/include/sys/times.h13
-rw-r--r--src/user/lib/include/sys/types.h18
-rw-r--r--src/user/lib/include/sys/wait.h13
10 files changed, 0 insertions, 152 deletions
diff --git a/src/user/lib/include/sys/ioctl.h b/src/user/lib/include/sys/ioctl.h
deleted file mode 100644
index 708bc3f..0000000
--- a/src/user/lib/include/sys/ioctl.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-#include <errno.h> // only for ENOSYS
-
-#define TIOCGWINSZ 0
-struct winsize {
- int ws_row, ws_col;
-};
-
-static inline int ioctl(int fd, int req, ...) {
- (void)fd; (void)req;
- errno = ENOSYS;
- return -1;
-}
diff --git a/src/user/lib/include/sys/mman.h b/src/user/lib/include/sys/mman.h
deleted file mode 100644
index 074ebe2..0000000
--- a/src/user/lib/include/sys/mman.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-#include <camellia/flags.h>
-#include <sys/types.h>
-
-#define MMAP_UNSUPPORTED 0xFFFF
-
-#define PROT_EXEC 1
-#define PROT_NONE MMAP_UNSUPPORTED
-#define PROT_READ 1
-#define PROT_WRITE 1
-
-#define MAP_FIXED MMAP_UNSUPPORTED
-#define MAP_PRIVATE 0
-#define MAP_SHARED MMAP_UNSUPPORTED
-#define MAP_ANONYMOUS 1
-
-void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off);
-int munmap(void *addr, size_t len);
diff --git a/src/user/lib/include/sys/param.h b/src/user/lib/include/sys/param.h
deleted file mode 100644
index e6c9d6f..0000000
--- a/src/user/lib/include/sys/param.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define MIN(a, b) ((a)<(b) ? (a):(b))
-#define MAX(a, b) ((a)<(b) ? (b):(a))
diff --git a/src/user/lib/include/sys/resource.h b/src/user/lib/include/sys/resource.h
deleted file mode 100644
index 4582ce0..0000000
--- a/src/user/lib/include/sys/resource.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-struct rusage {};
diff --git a/src/user/lib/include/sys/stat.h b/src/user/lib/include/sys/stat.h
deleted file mode 100644
index 343db55..0000000
--- a/src/user/lib/include/sys/stat.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#pragma once
-#include <bits/panic.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <time.h> // struct timespec
-#include <errno.h> // only for ENOSYS
-
-struct stat {
- dev_t st_dev;
- ino_t st_ino;
- mode_t st_mode;
- nlink_t st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- off_t st_size;
- blksize_t st_blksize;
- blkcnt_t st_blocks;
-
- struct timespec st_atim;
- struct timespec st_mtim;
- struct timespec st_ctim;
-
-#define st_atime st_atim.tv_sec
-#define st_mtime st_mtim.tv_sec
-#define st_ctime st_ctim.tv_sec
-};
-
-#define S_IFMT 0170000
-#define S_IFSOCK 0140000
-#define S_IFLNK 0120000
-#define S_IFREG 0100000
-#define S_IFBLK 0060000
-#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)
-#define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
-#define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
-#define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK)
-#define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
-#define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
-#define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
-
-int fstat(int fd, struct stat *sb);
-int stat(const char *restrict path, struct stat *restrict sb);
-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;
- return -1;
-}
-
-static inline int mknod(const char *path, mode_t mode, dev_t dev) {
- (void)path; (void)mode; (void)dev;
- errno = ENOSYS;
- return -1;
-}
diff --git a/src/user/lib/include/sys/sysmacros.h b/src/user/lib/include/sys/sysmacros.h
deleted file mode 100644
index 30e0efd..0000000
--- a/src/user/lib/include/sys/sysmacros.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define makedev(maj, min) 0
-#define major(x) 0
-#define minor(x) 0
diff --git a/src/user/lib/include/sys/time.h b/src/user/lib/include/sys/time.h
deleted file mode 100644
index e69de29..0000000
--- a/src/user/lib/include/sys/time.h
+++ /dev/null
diff --git a/src/user/lib/include/sys/times.h b/src/user/lib/include/sys/times.h
deleted file mode 100644
index 4a8d3ef..0000000
--- a/src/user/lib/include/sys/times.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#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
deleted file mode 100644
index faf656a..0000000
--- a/src/user/lib/include/sys/types.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-#include <stddef.h>
-#include <stdint.h>
-
-typedef long long off_t;
-typedef int64_t time_t;
-typedef uint64_t clock_t;
-typedef int mode_t;
-
-typedef int dev_t;
-typedef int ino_t;
-typedef int mode_t;
-typedef int nlink_t;
-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
deleted file mode 100644
index cff407e..0000000
--- a/src/user/lib/include/sys/wait.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-#include <sys/types.h>
-
-#define WIFSTOPPED(x) 0
-#define WEXITSTATUS(x) ((x)&0xFF)
-#define WIFEXITED(x) 1
-#define WSTOPSIG(x) 0
-#define WTERMSIG(x) 0
-
-#define WNOHANG 0
-#define WUNTRACED 0
-
-pid_t wait3(int *wstatus, int opts, struct rusage *rusage);