Subject: Re: sched.h is broken?
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Kouichirou Hiratsuka <hira@po6.nsk.ne.jp>
List: current-users
Date: 12/14/2004 04:02:31
Hello,
At 13 Dec 2004 11:08:34 -0500,
Nathan J. Williams wrote:
>
> Kouichirou Hiratsuka <hira@po6.nsk.ne.jp> writes:
>
> > Is revision 1.5 of src/include/sched.h broken? Because
> > `int sched_yield()' is replaced with `void __libc_thr_yield()', the
> > program that uses a return value of sched_yield() can't be compiled.
>
> Yes, it's broken; I didn't manage to check that the stub's signature
> was correct. I've fixed it. Thanks for pointing this out.
>
Thank you. However, this patch also seems to be needed.
best regards.
--
Kouichirou Hiratsuka
hira@po6.nsk.ne.jp
Index: include/threadlib.h
===================================================================
RCS file: /cvsroot/src/include/threadlib.h,v
retrieving revision 1.5
diff -u -r1.5 threadlib.h
--- include/threadlib.h 19 Jul 2003 05:05:28 -0000 1.5
+++ include/threadlib.h 13 Dec 2004 17:17:51 -0000
@@ -151,7 +151,7 @@
int __libc_thr_once(once_t *, void (*)(void));
int __libc_thr_sigsetmask(int, const sigset_t *, sigset_t *);
thr_t __libc_thr_self(void);
-void __libc_thr_yield(void);
+int __libc_thr_yield(void);
void __libc_thr_create(thr_t *, const thrattr_t *,
void *(*)(void *), void *);
void __libc_thr_exit(void *) __attribute__((__noreturn__));
Index: lib/libc/thread-stub/thread-stub.c
===================================================================
RCS file: /cvsroot/src/lib/libc/thread-stub/thread-stub.c,v
retrieving revision 1.11
diff -u -r1.11 thread-stub.c
--- lib/libc/thread-stub/thread-stub.c 13 Dec 2004 16:07:13 -0000 1.11
+++ lib/libc/thread-stub/thread-stub.c 13 Dec 2004 17:17:51 -0000
@@ -329,7 +329,7 @@
int __libc_thr_once_stub(once_t *, void (*)(void));
int __libc_thr_sigsetmask_stub(int, const sigset_t *, sigset_t *);
thr_t __libc_thr_self_stub(void);
-void __libc_thr_yield_stub(void);
+int __libc_thr_yield_stub(void);
int __libc_thr_create_stub(thr_t *, const thrattr_t *,
void *(*)(void *), void *);
void __libc_thr_exit_stub(void *);