system calls

This commit is contained in:
Matheus
2022-08-15 21:52:57 -03:00
parent 21e6a0ad1a
commit 432e85b837
17 changed files with 187 additions and 26 deletions
+29
View File
@@ -0,0 +1,29 @@
#include <kernel/syscalls.h>
#include <kernel/alloc.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
syscallret syscall_libc_log(char* str){
syscallret ret;
char* buf = alloc(strlen(str) + 1);
if(!buf){
ret.errno = ENOMEM;
ret.ret = -1;
return ret;
}
strcpy(buf, str);
printf("%s", str);
ret.errno = 0;
ret.ret = 0;
free(buf);
return ret;
}