summaryrefslogtreecommitdiff
path: root/x11-servers/xorg-server/files/patch-os-utils.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2008-03-06 00:48:43 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2008-03-06 00:48:43 +0000
commitba4bc11dc8860929b166610aa84cd3398d2c23d9 (patch)
tree1ec7e5455f5a4594cf3a03009ea10689148d6954 /x11-servers/xorg-server/files/patch-os-utils.c
parentAdd support for FreeBSD 7.0-STABLE and 8.0-CURRENT. (diff)
- Check correct POSIX spec. date for clock_gettime(2) whether
CLOCK_MONOTONIC is available. - If FreeBSD-specific CLOCK_MONOTONIC_FAST is available, use it instead of precise but slow gettimeofday(2) or CLOCK_MONOTONIC. Reviewed by: stable, x11
Notes
Notes: svn path=/head/; revision=208485
Diffstat (limited to 'x11-servers/xorg-server/files/patch-os-utils.c')
-rw-r--r--x11-servers/xorg-server/files/patch-os-utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/x11-servers/xorg-server/files/patch-os-utils.c b/x11-servers/xorg-server/files/patch-os-utils.c
new file mode 100644
index 000000000000..a5509b86539a
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-os-utils.c
@@ -0,0 +1,14 @@
+--- os/utils.c.orig 2007-08-23 15:04:55.000000000 -0400
++++ os/utils.c 2008-02-29 13:11:01.000000000 -0500
+@@ -525,7 +525,11 @@
+
+ #ifdef MONOTONIC_CLOCK
+ struct timespec tp;
++#if defined(__FreeBSD__) && defined(CLOCK_MONOTONIC_FAST)
++ if (clock_gettime(CLOCK_MONOTONIC_FAST, &tp) == 0)
++#else
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
++#endif
+ return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
+ #endif
+