From f9d3abf5d041f574304d2e585c5cf51448a77063 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 22 Apr 2019 00:13:41 +0200 Subject: [PATCH] LibC: Add sched_yield(), needed for GCC 8.3.0 build. --- LibC/Makefile | 3 ++- LibC/sched.cpp | 14 ++++++++++++++ LibC/sched.h | 9 +++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 LibC/sched.cpp create mode 100644 LibC/sched.h diff --git a/LibC/Makefile b/LibC/Makefile index fbb3de5346..9c690d3f39 100644 --- a/LibC/Makefile +++ b/LibC/Makefile @@ -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 diff --git a/LibC/sched.cpp b/LibC/sched.cpp new file mode 100644 index 0000000000..ce48add522 --- /dev/null +++ b/LibC/sched.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +extern "C" { + +int sched_yield() +{ + int rc = syscall(SC_yield); + __RETURN_WITH_ERRNO(rc, rc, -1); +} + +} + diff --git a/LibC/sched.h b/LibC/sched.h new file mode 100644 index 0000000000..5c472a27b7 --- /dev/null +++ b/LibC/sched.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +__BEGIN_DECLS + +int sched_yield(); + +__END_DECLS