LibC: Add sched_yield(), needed for GCC 8.3.0 build.

This commit is contained in:
Andreas Kling 2019-04-22 00:13:41 +02:00
parent a9d09e9020
commit f9d3abf5d0
Notes: sideshowbarker 2024-07-19 14:37:36 +09:00
3 changed files with 25 additions and 1 deletions

View File

@ -43,7 +43,8 @@ LIBC_OBJS = \
poll.o \
locale.o \
arpa/inet.o \
netdb.o
netdb.o \
sched.o
ASM_OBJS = setjmp.no crti.ao crtn.ao

14
LibC/sched.cpp Normal file
View File

@ -0,0 +1,14 @@
#include <sched.h>
#include <errno.h>
#include <Kernel/Syscall.h>
extern "C" {
int sched_yield()
{
int rc = syscall(SC_yield);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}

9
LibC/sched.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include <sys/cdefs.h>
__BEGIN_DECLS
int sched_yield();
__END_DECLS