Question + Patch for i386/getcpuclockid
Andreas Jaeger
aj@suse.de
Thu May 4 05:06:00 GMT 2000
With the current CVS version I get this warning:
../linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c:30: warning: comparison of distinct pointer types lacks a cast
gcc complains about this test:
/* We don't allow any process ID but our own. */
if (thread_handle (thread_id) != thread_self ())
return EPERM;
The types used here are:
static inline pthread_handle thread_handle(pthread_t id)
static inline pthread_descr thread_self (void) __attribute__ ((const));
Is this really correct? The types are different and I don't see
directly how the contents can be the same.
I propose the appended patch to fix this,
Andreas
2000-05-04 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/i386/getcpuclockid.c
(pthread_getcpuclockid): Correct test for ourselves.
============================================================
Index: linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c
--- linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c 2000/04/18 06:35:42 1.3
+++ linuxthreads/sysdeps/unix/sysv/linux/i386/getcpuclockid.c 2000/05/04 12:06:02
@@ -27,7 +27,7 @@
pthread_getcpuclockid (pthread_t thread_id, clockid_t *clock_id)
{
/* We don't allow any process ID but our own. */
- if (thread_handle (thread_id) != thread_self ())
+ if (thread_handle (thread_id)->h_descr != thread_self ())
return EPERM;
/* Store the number. */
--
Andreas Jaeger
SuSE Labs aj@suse.de
More information about the Libc-hacker
mailing list