Luna/kernel/src/sys/version.cpp

19 lines
382 B
C++
Raw Normal View History

#include "config.h"
#include "errno.h"
#include "interrupts/Context.h"
#include "std/stdio.h"
2022-10-02 15:25:56 +00:00
void sys_getversion(Context* context, char* buffer, size_t max)
{
if (!max)
{
context->rax = -EINVAL;
return;
}
if (!buffer)
{
context->rax = -EINVAL;
return;
}
context->rax = snprintf(buffer, max, "moon %s", moon_version());
}