File: local-clock_gettime_MONOTONIC.diff

package info (click to toggle)
glibc 2.24-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 223,412 kB
  • sloc: ansic: 991,967; asm: 261,800; sh: 10,385; makefile: 9,710; cpp: 4,169; python: 3,971; perl: 2,254; awk: 1,753; pascal: 1,521; yacc: 291; sed: 80
file content (53 lines) | stat: -rw-r--r-- 2,056 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Use the realtime clock for the monotonic clock. This is of course not a proper
implementation (which is being done in Mach), but will permit to fix at least
the iceweasel stack.

vlc however doesn't build when _POSIX_CLOCK_SELECTION is enabled but
_POSIX_TIMERS is not, and they refuse to fix that (see #765578), so disable the
former.

---
 sysdeps/mach/hurd/bits/posix_opt.h |    2 +-
 sysdeps/unix/clock_gettime.c       |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Index: eglibc-2.16/sysdeps/unix/clock_gettime.c
===================================================================
--- eglibc-2.16.orig/sysdeps/unix/clock_gettime.c	2012-07-23 00:41:03.000000000 +0200
+++ eglibc-2.16/sysdeps/unix/clock_gettime.c	2012-07-23 00:41:10.000000000 +0200
@@ -100,6 +100,7 @@
 #endif
 
 #ifndef HANDLED_REALTIME
+    case CLOCK_MONOTONIC:
     case CLOCK_REALTIME:
       {
 	struct timeval tv;
--- eglibc/sysdeps/pthread/timer_create.c.orig	2016-07-14 14:34:19.721218728 +0200
+++ eglibc/sysdeps/pthread/timer_create.c	2016-07-14 14:34:25.881187804 +0200
@@ -48,7 +48,7 @@
       return -1;
     }
 
-  if (clock_id != CLOCK_REALTIME)
+  if (clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC)
     {
       __set_errno (EINVAL);
       return -1;
Index: eglibc-2.16/sysdeps/mach/hurd/bits/posix_opt.h
===================================================================
--- eglibc-2.16.orig/sysdeps/mach/hurd/bits/posix_opt.h	2012-07-23 00:41:03.000000000 +0200
+++ eglibc-2.16/sysdeps/mach/hurd/bits/posix_opt.h	2012-07-23 00:41:10.000000000 +0200
@@ -163,10 +163,10 @@
 #define _POSIX_THREAD_PROCESS_SHARED	-1
 
 /* The monotonic clock might be available.  */
-#define _POSIX_MONOTONIC_CLOCK	0
+#define _POSIX_MONOTONIC_CLOCK	200809L
 
-/* The clock selection interfaces are available.  */
+/* The clock selection interfaces are not really available yet.  */
-#define _POSIX_CLOCK_SELECTION	200809L
+#define _POSIX_CLOCK_SELECTION	-1
 
 /* Advisory information interfaces could be available in future.  */
 #define _POSIX_ADVISORY_INFO	0