| 1 |
Fromscip-debian debian libosmocore 1.14.2-1 libosmocore/patches/`0007-TIMER-constants-not-on-some-architectures.patch`#From.: Ruben Undheim <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 2 |
Datescip-debian debian libosmocore 1.14.2-1 libosmocore/patches/`0007-TIMER-constants-not-on-some-architectures.patch`#Date.: Sun, 18 Nov 2018 12:37:57 +0100 |
| 3 |
Subjectscip-debian debian libosmocore 1.14.2-1 libosmocore/patches/`0007-TIMER-constants-not-on-some-architectures.patch`#Subject.: TIMER constants not on some architectures |
| 4 |
Forwardedscip-debian debian libosmocore 1.14.2-1 libosmocore/patches/`0007-TIMER-constants-not-on-some-architectures.patch`#Forwarded.: not-needed |
| 5 |
|
| 6 |
--- |
| 7 |
src/timer_clockgettime.c | 18 ++++++++++++------ |
| 8 |
tests/timer/clk_override_test.c | 3 +++ |
| 9 |
2 files changed, 15 insertions(+), 6 deletions(-) |
| 10 |
|
| 11 |
--- a/tests/timer/clk_override_test.cscip-debian debian libosmocore 1.14.2-1 libosmocore/upstream/`tests/timer/clk_override_test.c`: |
| 12 |
+++ b/tests/timer/clk_override_test.cscip-debian debian libosmocore 1.14.2-1 libosmocore/upstream/`tests/timer/clk_override_test.c`: |
| 13 |
@@ -36,12 +36,15 @@ |
| 14 |
struct timespec read1, read2, res; |
| 15 |
struct timespec *mono; |
| 16 |
|
| 17 |
+#if defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 18 |
+#else |
| 19 |
osmo_clock_gettime(CLOCK_BOOTTIME, &read1); |
| 20 |
usleep(500); |
| 21 |
osmo_clock_gettime(CLOCK_BOOTTIME, &read2); |
| 22 |
if (!timespeccmp(&read2, &read1, >)) |
| 23 |
return EXIT_FAILURE; |
| 24 |
printf("Non implemented clocks work fine\n"); |
| 25 |
+#endif |
| 26 |
|
| 27 |
osmo_clock_gettime(CLOCK_MONOTONIC, &read1); |
| 28 |
usleep(500); |
| 29 |
--- a/src/core/timer_clockgettime.cscip-debian debian libosmocore 1.14.2-1 libosmocore/upstream/`src/core/timer_clockgettime.c`: |
| 30 |
+++ b/src/core/timer_clockgettime.cscip-debian debian libosmocore 1.14.2-1 libosmocore/upstream/`src/core/timer_clockgettime.c`: |
| 31 |
@@ -71,20 +71,26 @@ |
| 32 |
switch(clk_id) { |
| 33 |
case CLOCK_REALTIME: |
| 34 |
return &realtime; |
| 35 |
|
| 36 |
|
| 37 |
case CLOCK_MONOTONIC: |
| 38 |
return &mono; |
| 39 |
+ case CLOCK_PROCESS_CPUTIME_ID: |
| 40 |
+ return &proc_cputime_id; |
| 41 |
+ case CLOCK_THREAD_CPUTIME_ID: |
| 42 |
+ return &th_cputime_id; |
| 43 |
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 44 |
+#else |
| 45 |
+ case CLOCK_REALTIME_COARSE: |
| 46 |
+ return &realtime_coarse; |
| 47 |
case CLOCK_MONOTONIC_COARSE: |
| 48 |
return &mono_coarse; |
| 49 |
case CLOCK_MONOTONIC_RAW: |
| 50 |
return &mono_raw; |
| 51 |
+#endif |
| 52 |
+#if defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 53 |
+#else |
| 54 |
case CLOCK_BOOTTIME: |
| 55 |
return &boottime; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
+#endif |
| 61 |
default: |
| 62 |
return NULL; |
| 63 |
} |