[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Fix 2.5 clock_settime.c compilation on ColdFire



The linux version of clock_settime.c has:

----------------------------------------------------------------------
#if __ASSUME_POSIX_CPU_TIMERS <= 0 && defined __NR_clock_settime
extern int __libc_missing_posix_timers attribute_hidden;
extern int __libc_missing_posix_cpu_timers attribute_hidden;

static int
maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
----------------------------------------------------------------------

but has no direct "#include <time.h>" to pull in the definition of
clockid_t.  However, all targets that have TLS support include
<time.h> at some point; either in lowlevellock.h at the latest or
(in some cases) indirectly via <stdlib.h> in tls.h itself.

The obvious fix would be to add an #include <time.h> to clock_settime.c.
However, upstream glibc is generally maintained on the principle that
if the supported toolchains' headers include something indirectly,
the unsupported ones should too.  The patch below therefore includes
time.h from sysdeps/generic/tls.h.

Tested on ColdFire.  OK for 2.5?

Richard


	* sysdeps/generic/tls.h: Include <time.h>.

Index: sysdeps/generic/tls.h
===================================================================
--- sysdeps/generic/tls.h	(revision 1541)
+++ sysdeps/generic/tls.h	(working copy)
@@ -79,3 +79,8 @@
      This normally is done using the the thread register which points
      to the dtv or the TCB (from which the DTV can found).
   */
+
+#ifndef __ASSEMBLER__
+/* All non-dummy versions of tls.h include this file.  */
+#include <time.h>
+#endif