unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob c4e9fd51052db8fd1c4a703bb5e8112c12b20ca8 1994 bytes (raw)
name: gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch 	 # note: path name is non-authoritative(*)

 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
54
55
56
57
58
59
60
61
62
63
 
Upstream status: taken from upstream:

    https://salsa.debian.org/glibc-team/glibc/-/blob/sid/debian/patches/hurd-i386/unsubmitted-clock_t_centiseconds.diff

Some applications assume centisecond precision, or at most millisecond precision
(e.g. guile).  This is a work-around for them.

---
 getclktck.c |    5 ++---
 setitimer.c |    2 +-
 times.c     |    2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)
commit d57f2f9b4bd007846af2fb4217486ea572579010
Author: Richard Braun <rbraun@sceen.net>
Date:   Tue Aug 27 11:35:31 2013 +0200

    Express CPU time (clock_t of times(2)) in centiseconds

diff --git a/sysdeps/mach/hurd/getclktck.c b/sysdeps/mach/hurd/getclktck.c
index 69be2cc..5f7d946 100644
--- a/sysdeps/mach/hurd/getclktck.c
+++ b/sysdeps/mach/hurd/getclktck.c
@@ -18,12 +18,11 @@
 
 #include <time.h>
 
-/* Return frequency of `times'.
-   Since Mach reports CPU times in microseconds, we always use 1 million.  */
+/* Return frequency of `times'.  */
 int
 __getclktck (void)
 {
-  return 1000000;
+  return 100;
 }
 
 /* Before glibc 2.2, the Hurd actually did this differently, so we
diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
index 39b6b16..4992c89 100644
--- a/sysdeps/mach/hurd/setitimer.c
+++ b/sysdeps/mach/hurd/setitimer.c
@@ -42,7 +42,7 @@ quantize_timeval (struct timeval *tv)
   static time_t quantum = -1;
 
   if (quantum == -1)
-    quantum = 1000000 / __getclktck ();
+    quantum = 100 / __getclktck ();
 
   tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
   if (tv->tv_usec >= 1000000)
diff --git a/sysdeps/mach/hurd/times.c b/sysdeps/mach/hurd/times.c
index 9e13a75..593c33a 100644
--- a/sysdeps/mach/hurd/times.c
+++ b/sysdeps/mach/hurd/times.c
@@ -29,7 +29,7 @@
 static inline clock_t
 clock_from_time_value (const time_value_t *t)
 {
-  return t->seconds * 1000000 + t->microseconds;
+  return t->seconds * 100 + t->microseconds / 10000;
 }
 
 /* Store the CPU time used by this process and all its

debug log:

solving c4e9fd5105 ...
found c4e9fd5105 in https://yhetil.org/guix-patches/23790bf9a3383c0adf74ec209eb9222c410f667b.1684402361.git.janneke@gnu.org/

applying [1/1] https://yhetil.org/guix-patches/23790bf9a3383c0adf74ec209eb9222c410f667b.1684402361.git.janneke@gnu.org/
diff --git a/gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch b/gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch
new file mode 100644
index 0000000000..c4e9fd5105

1:30: trailing whitespace.
 
1:32: trailing whitespace.
 
1:42: trailing whitespace.
 
1:50: trailing whitespace.
 
1:54: trailing whitespace.
 
Checking patch gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch...
Applied patch gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 c4e9fd51052db8fd1c4a703bb5e8112c12b20ca8	gnu/packages/patches/glibc-2.35-hurd-clock_t_centiseconds.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).