feat(userspace/libc): implement functions for porting apps

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-24 00:40:07 +00:00
parent 27356b7826
commit 0d8c65e44b
22 changed files with 615 additions and 25 deletions

View File

@ -19,6 +19,8 @@
#include <bits/libc.h>
#include <string.h>
extern int printf(const char *restrict format, ...);
void sysdep(Exit)(int Status)
{
call_exit(Status);
@ -209,3 +211,29 @@ int sysdep(FileControl)(int Descriptor, int Command, void *Arg)
{
return call_fcntl(Descriptor, Command, Arg);
}
int sysdep(ClockGetTime)(clockid_t ClockID, struct timespec *TP)
{
return call_clock_gettime(ClockID, TP);
}
time_t sysdep(Time)(void)
{
return call_time(NULL);
}
clock_t sysdep(Clock)()
{
printf("sysdep(Clock): unimplemented\n");
return 0;
}
int sysdep(RemoveDirectory)(const char *Pathname)
{
return call_rmdir(Pathname);
}
int sysdep(Unlink)(const char *Pathname)
{
return call_unlink(Pathname);
}