Luna/libs/libc/src/luna.cpp

27 lines
490 B
C++
Raw Normal View History

#include <luna.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>
#define noreturn __attribute__((noreturn))
extern "C"
{
pid_t gettid()
{
return syscall(SYS_gettid);
}
unsigned int msleep(unsigned int ms)
{
2022-10-07 16:19:06 +00:00
return (unsigned int)syscall(SYS_sleep, ms);
}
noreturn void __luna_abort(const char* message)
{
fwrite(message, strlen(message), 1, stdout);
abort();
}
}