mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibC: Add sched_yield(), needed for GCC 8.3.0 build.
This commit is contained in:
parent
a9d09e9020
commit
f9d3abf5d0
3 changed files with 25 additions and 1 deletions
|
@ -43,7 +43,8 @@ LIBC_OBJS = \
|
||||||
poll.o \
|
poll.o \
|
||||||
locale.o \
|
locale.o \
|
||||||
arpa/inet.o \
|
arpa/inet.o \
|
||||||
netdb.o
|
netdb.o \
|
||||||
|
sched.o
|
||||||
|
|
||||||
ASM_OBJS = setjmp.no crti.ao crtn.ao
|
ASM_OBJS = setjmp.no crti.ao crtn.ao
|
||||||
|
|
||||||
|
|
14
LibC/sched.cpp
Normal file
14
LibC/sched.cpp
Normal 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
9
LibC/sched.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
int sched_yield();
|
||||||
|
|
||||||
|
__END_DECLS
|
Loading…
Add table
Add a link
Reference in a new issue