Kernel: Add SYS_SLEEP

This commit is contained in:
Bananymous
2023-05-28 22:34:48 +03:00
parent 09666adc53
commit 998999a755
3 changed files with 21 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ __BEGIN_DECLS
#define SYS_GET_TERMIOS 11
#define SYS_SET_TERMIOS 12
#define SYS_FORK 13
#define SYS_SLEEP 14
__END_DECLS

View File

@@ -108,6 +108,12 @@ long syscall(long syscall, ...)
ret = Kernel::syscall(SYS_FORK);
break;
}
case SYS_SLEEP:
{
unsigned int seconds = va_arg(args, unsigned int);
ret = Kernel::syscall(SYS_SLEEP, seconds);
break;
}
default:
puts("LibC: Unhandeled syscall");
ret = -ENOSYS;
@@ -129,3 +135,8 @@ pid_t fork(void)
{
return syscall(SYS_FORK);
}
unsigned int sleep(unsigned int seconds)
{
return syscall(SYS_SLEEP, seconds);
}