[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined
From: |
Wolfgang Schildbach |
Subject: |
[Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined |
Date: |
Mon, 23 Oct 2006 13:39:54 +0200 |
I stumbled upon the same problem as Bill Rossi (see his post below):
The current cvs version of qemu fails to compile on my machine because
CLOCK_MONOTONIC is not defined in my glibc. According to clock_gettime(3),
systems that define this functionality have _POSIX_MONOTONIC_CLOCK and
_POSIX_TIMERS set. Updating the ifdef (see patch below) to include these
makes the offending code go away on my CLOCK_MONOTONIC-less system
(gcc3.3), but continues to include it on a newer system with a later
libgcc. Not sure if the __linux__ in there is still necessary, but I left
it in for good measure.
Please consider for inclusing into CVS.
Thx,
- Wolfgang Schildbach
Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.217
diff -r1.217 vl.c
550c550
< #if defined(__linux__)
---
> #if defined (__linux__) && defined(_POSIX_TIMERS) &&
defined(_POSIX_MONOTONIC_CLOCK)
562c562
< #if defined(__linux__)
---
> #if defined (__linux__) && defined(_POSIX_TIMERS) &&
defined(_POSIX_MONOTONIC_CLOCK)
Bill Rossi wrote on 26.07.2006 19:38:08:
>
> Fails to compile on Linux with glibc 2.2.5. CLOCK_MONOTONIC isn't
> defined in glibc 2.2.5. The following patch is a workaround:
>
> --- qemu-0.8.2/vl.c 2006-07-22 13:23:34.000000000 -0400
> +++ ../qemu-0.8.2/vl.c 2006-07-26 11:37:34.000000000 -0400
> @@ -541,7 +541,7 @@
> static void init_get_clock(void)
> {
> use_rt_clock = 0;
> -#if defined(__linux__)
> +#if 0 //defined(__linux__)
> {
> struct timespec ts;
> if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
> @@ -553,7 +553,7 @@
>
> static int64_t get_clock(void)
> {
> -#if defined(__linux__)
> +#if 0 //defined(__linux__)
> if (use_rt_clock) {
> struct timespec ts;
> clock_gettime(CLOCK_MONOTONIC, &ts);
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
--
Wolfgang Schildbach
Group Manager Systems Engineering and Consulting
Coding Technologies GmbH
- [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined,
Wolfgang Schildbach <=