mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 13:48:21 +00:00
30 lines
380 B
C
30 lines
380 B
C
#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;
|
|
|
|
}
|