aboutsummaryrefslogtreecommitdiff
path: root/include/sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys.h')
-rw-r--r--include/sys.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/include/sys.h b/include/sys.h
index e7573bf..a838fe8 100644
--- a/include/sys.h
+++ b/include/sys.h
@@ -1,7 +1,11 @@
#pragma once
-#include <arch/constants.h>
-#include <arch/errno.h>
+/* types declarations */
+#include <arch/types.h>
+
+#include <os/types.h>
+#include <os/constants.h>
+#include <os/errno.h>
// -----------------------------------------------------------------------
// global constants
@@ -16,9 +20,15 @@
#define sys·SeekCur 1u
#define sys·SeekEnd 2u
+/* special file descriptors */
+#define sys·Stdin 0
+#define sys·Stdout 1
+#define sys·Stderr 2
+
// -----------------------------------------------------------------------
// functions
+/* errors */
char *sys·errormsg(int num);
/* file operations */
@@ -27,20 +37,32 @@ int sys·close(int fd);
int sys·write(int fd, uintptr len, void *buf, intptr *nw);
int sys·read(int fd, uintptr len, void *buf, intptr *nr);
int sys·seek(int fd, intptr offset, int from, intptr *pos);
+
+int sys·info(char *path, sys·Info *ret);
+int sys·infofd(int fd, sys·Info *ret);
+int sys·infoat(int dirfd, char *path, int flag, uint mask, sys·Info *ret);
+
int sys·dup(int from, int to);
/* directory operations */
-int sys·chdirfd(int fd);
int sys·chdir(char *path);
+int sys·chdirfd(int fd);
+int sys·mkdir(char *path, uint mode);
+int sys·mkdirat(int fd, char *path, uint mode);
+
int sys·direntry(int fd, int len, void *buffer, uintptr *size);
+/* file node */
+int sys·mknode(char *path, uint mode, uint64 dev);
+int sys·mknodeat(int dirfd, char *path, uint mode, uint64 device);
+
/* process operations */
int sys·fork(void);
int sys·exec(char *program, char *argv[], char *env[]);
/* memory operations */
int sys·brk(void *addr);
-int sys·sbrk(intptr delta, void **ret);
+//int sys·sbrk(intptr delta, void **ret);
int sys·mmap(void *addr, uintptr len, int prot, int flags, int fd, intptr off, void **ret);
int sys·mremap(void *old, uintptr from, uintptr to, int flags, void **new);