Luna/libs/libc/src/luna.cpp

26 lines
472 B
C++
Raw Normal View History

#include <luna.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)
{
syscall(SYS_write, message, strlen(message));
abort();
}
}