Kernel/LibC: Implement alarm() and setitimer()

This makes vim able to start!
This commit is contained in:
2024-08-01 21:09:31 +03:00
parent da3b30cd94
commit a33b63d066
6 changed files with 139 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
#include <sys/syscall.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp)
{
@@ -13,3 +15,8 @@ int gettimeofday(struct timeval* __restrict tp, void* __restrict tzp)
tp->tv_usec = ts.tv_nsec / 1000;
return 0;
}
int setitimer(int which, const struct itimerval* __restrict value, struct itimerval* __restrict ovalue)
{
return syscall(SYS_SETITIMER, which, value, ovalue);
}