Luna/libs/libc/src/luna.cpp
apio d93a4062a2 libc: Do not use the heavy variadic syscall() function for wrappers
That function is meant more for user programs, and should still be rarely used, since it's not portable.
Instead, we already know the number of arguments. We just call __lc_fast_syscallN, which also sets errno.
2022-10-27 17:42:00 +02:00

25 lines
479 B
C++

#include <luna.h>
#include <luna/syscall.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
extern "C"
{
long getprocid(int field)
{
return __lc_fast_syscall1(SYS_getprocid, field);
}
unsigned int msleep(unsigned int ms)
{
return (unsigned int)__lc_fast_syscall1(SYS_sleep, ms);
}
__lc_noreturn void __luna_abort(const char* message)
{
fputs(message, stderr);
abort();
}
}