Kernel/LibC: Implement sched_yield

This commit is contained in:
2025-04-02 02:44:31 +03:00
parent 5549696c3a
commit 9066e62a97
5 changed files with 17 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ set(LIBC_SOURCES
pthread.cpp
pwd.cpp
scanf_impl.cpp
sched.cpp
setjmp.cpp
signal.cpp
stdio.cpp

View File

@@ -90,6 +90,7 @@ __BEGIN_DECLS
O(SYS_FSYNC, fsync) \
O(SYS_SYMLINKAT, symlinkat) \
O(SYS_HARDLINKAT, hardlinkat) \
O(SYS_YIELD, yield) \
O(SYS_PTHREAD_CREATE, pthread_create) \
O(SYS_PTHREAD_EXIT, pthread_exit) \
O(SYS_PTHREAD_SELF, pthread_self) \

View File

@@ -0,0 +1,8 @@
#include <sched.h>
#include <sys/syscall.h>
#include <unistd.h>
int sched_yield(void)
{
return syscall(SYS_YIELD);
}