Skip to contentSkip to conversation

1/5: FreeBSD also has clock_gettime

PATCH Applied Juergen Lock 2 participants 2 messages Oct 1, 2008 – Oct 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 1/5: FreeBSD also has clock_gettime

Index: qemu/vl.c
@@ -541,7 +541,7 @@
static void init_get_clock(void)

 {
     use_rt_clock = 0;
-#if defined(__linux__)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
     {
         struct timespec ts;
         if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {

@@ -553,7 +553,7 @@

static int64_t get_clock(void)
{
-#if defined(__linux__)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)

     if (use_rt_clock) {
         struct timespec ts;
         clock_gettime(CLOCK_MONOTONIC, &ts);
#1 lore raw

Applied, thanks.

Quoted 24 lines · Juergen Lock

Index: qemu/vl.c

(quoted diff) +2 -2
@@ -541,7 +541,7 @@
 static void init_get_clock(void)
 {
     use_rt_clock = 0;
-#if defined(__linux__)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
     {
         struct timespec ts;
         if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
@@ -553,7 +553,7 @@
 
 static int64_t get_clock(void)
 {
-#if defined(__linux__)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
     if (use_rt_clock) {
         struct timespec ts;
         clock_gettime(CLOCK_MONOTONIC, &ts);
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net