diff --git a/headers/posix/sched.h b/headers/posix/sched.h new file mode 100644 index 0000000000..679dc2447a --- /dev/null +++ b/headers/posix/sched.h @@ -0,0 +1,18 @@ +/* + * Copyright 2008, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT license. + */ +#ifndef _SCHED_H_ +#define _SCHED_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int sched_yield(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _SCHED_H_ */ diff --git a/src/system/libroot/posix/Jamfile b/src/system/libroot/posix/Jamfile index 1d1020b53d..a30fc4d0f6 100644 --- a/src/system/libroot/posix/Jamfile +++ b/src/system/libroot/posix/Jamfile @@ -21,6 +21,7 @@ MergeObject posix_main.o : inttypes.c poll.c $(PWD_BACKEND) + scheduler.cpp semaphore.cpp syslog.cpp termios.c diff --git a/src/system/libroot/posix/scheduler.cpp b/src/system/libroot/posix/scheduler.cpp new file mode 100644 index 0000000000..ea88da6224 --- /dev/null +++ b/src/system/libroot/posix/scheduler.cpp @@ -0,0 +1,17 @@ +/* + * Copyright 2008, Andreas Färber, andreas.faerber@web.de + * Distributed under the terms of the MIT license. + */ + +#include + +#include + + +int +sched_yield(void) +{ + _kern_thread_yield(); + return 0; +} +