diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-09-08 16:52:15 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-09-08 16:52:15 +0200 |
commit | a6cec708bcc74656b3d688d39b23a49ade260628 (patch) | |
tree | 9d3c2b421a9e3e7b35e00499bdb05c007ae2c8bd /debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch | |
parent | fe79bbddd41a9a56efc7254366cae987e897221d (diff) |
add patch series
Diffstat (limited to 'debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch')
-rw-r--r-- | debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch b/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch new file mode 100644 index 00000000..5f8af97f --- /dev/null +++ b/debian/patches/try-fence0002-libshouldbeinlibc-maptime-provide-a-mapped-time-sour.patch @@ -0,0 +1,59 @@ +From ed70f50b42f5f3e6e9f7af4fce9174df619a269a Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Tue, 8 Sep 2015 14:25:44 +0200 +Subject: [PATCH hurd 2/4] libshouldbeinlibc/maptime: provide a mapped time + source + +Automatically map an appropriate time device. I don't see any need to +customize this process, so we might as well just use the default one +everywhere. + +* libshouldbeinlibc/maptime.c (maptime_default_mtime): New variable. +(maptime_init): New function that initializes `maptime_default_mtime' +at load time. +* libshouldbeinlibc/maptime.h (maptime_default_mtime): New declaration. +--- + libshouldbeinlibc/maptime.c | 13 +++++++++++++ + libshouldbeinlibc/maptime.h | 2 ++ + 2 files changed, 15 insertions(+) + +diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c +index f0b69db..1e300d6 100644 +--- a/libshouldbeinlibc/maptime.c ++++ b/libshouldbeinlibc/maptime.c +@@ -24,6 +24,19 @@ + + #include "maptime.h" + ++volatile struct mapped_time_value *maptime_default_mtime; ++ ++/* Initialize maptime_default_mtime. Try to use the Hurd device ++ first, fall back to using the Mach device. */ ++static void __attribute__((__constructor__)) ++maptime_init (void) ++{ ++ error_t err; ++ err = maptime_map (0, NULL, &maptime_default_mtime); ++ if (err) ++ maptime_map (1, NULL, &maptime_default_mtime); ++} ++ + /* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then + the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is + used. If USE_MACH_DEV is true, the mach device DEV_NAME, or "time" if +diff --git a/libshouldbeinlibc/maptime.h b/libshouldbeinlibc/maptime.h +index 04ce035..d5086b1 100644 +--- a/libshouldbeinlibc/maptime.h ++++ b/libshouldbeinlibc/maptime.h +@@ -32,6 +32,8 @@ + #define MAPTIME_EI __extern_inline + #endif + ++extern volatile struct mapped_time_value *maptime_default_mtime; ++ + /* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then + the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is + used. If USE_MACH_DEV is true, the mach device DEV_NAME, or "time" if +-- +2.1.4 + |