diff options
Diffstat (limited to 'include/sys.h')
-rw-r--r-- | include/sys.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/include/sys.h b/include/sys.h index 15fba2a..e7573bf 100644 --- a/include/sys.h +++ b/include/sys.h @@ -19,15 +19,33 @@ // ----------------------------------------------------------------------- // functions -/* - * system calls with errno-free interface - */ -int sys·call(int num, ...); +char *sys·errormsg(int num); /* file operations */ int sys·open(char *path, int flag, int mode, int *fd); int sys·close(int fd); -int sys·write(int fd, intptr len, void *buf, intptr *nw); -int sys·read(int fd, intptr len, void *buf, intptr *nr); +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·dup(int from, int to); + +/* directory operations */ +int sys·chdirfd(int fd); +int sys·chdir(char *path); +int sys·direntry(int fd, int len, void *buffer, uintptr *size); + +/* 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·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); +int sys·munmap(void *addr, uintptr len); +int sys·madvise(void *addr, uintptr len, int advice); +int sys·mprotect(void *addr, uintptr len, int prot); +int sys·mlock(void *addr, uintptr len); +int sys·munlock(void *addr, uintptr len); |