libc: Add sched_yield()
This commit is contained in:
parent
b0e071e964
commit
523e88e5a9
16
libs/libc/include/sched.h
Normal file
16
libs/libc/include/sched.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef _SCHED_H
|
||||
#define _SCHED_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Yield the processor. */
|
||||
int sched_yield(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
11
libs/libc/src/sched.cpp
Normal file
11
libs/libc/src/sched.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <sched.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int sched_yield()
|
||||
{
|
||||
return (int)syscall(SYS_yield);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user