This is needed to run Python on the Hurd, especially during the build of python-boot0. Adapted from https://salsa.debian.org/glibc-team/glibc/-/blob/glibc-2.31/debian/patches/hurd-i386/unsubmitted-clock_t_centiseconds.diff 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. From 0aa1dfd580cf9ad7b812c307b128decb782b825f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 2 Mar 2020 18:59:04 +0100 Subject: [PATCH 2/2] Use realtime clock for the monotonic clock. --- sysdeps/mach/clock_gettime.c | 2 +- sysdeps/mach/hurd/bits/posix_opt.h | 6 +++--- sysdeps/posix/clock_getres.c | 1 + sysdeps/pthread/timer_create.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c index ac3547df3c..af8681ba4e 100644 --- a/sysdeps/mach/clock_gettime.c +++ b/sysdeps/mach/clock_gettime.c @@ -25,7 +25,7 @@ int __clock_gettime (clockid_t clock_id, struct timespec *ts) { - if (clock_id != CLOCK_REALTIME) + if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME) { errno = EINVAL; return -1; diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h index 0050151332..27b3a28ab7 100644 --- a/sysdeps/mach/hurd/bits/posix_opt.h +++ b/sysdeps/mach/hurd/bits/posix_opt.h @@ -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. */ -#define _POSIX_CLOCK_SELECTION;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015-2023 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> ;;; Copyright © 2016, 2018, 2020-2024 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 David Thompson <davet@gnu.org> ;;; Copyright © 2016-2019, 2021, 2023 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org> ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; Copyright © 2018, 2019, 2020 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz> ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net> ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com> ;;; Copyright © 2019 J