Re: OpenNTPd port
Martin-Éric Racine <[email protected]> Tue, 21 Jul 2026 16:12:54 +0300
| Newsgroups | gmane.os.hurd.bugs |
|---|---|
| Message-ID | <CAPZXPQfLNTLL82QsVKy6t1bVj=6VJHRaumrzZVq8bwmqQaoemA@mail.gmail.com> |
ti 21.7.2026 klo 0.11 Michael Kelly ([email protected]) kirjoitti: > On 19/07/2026 09:30, Martin-Éric Racine wrote: > > Since then, I got around packaging the latest upstream. If anybody > > feels like porting that one, diffs are welcome. > > I don't think the required fixes for adjtime, which were merged to the > glibc and gnumach sources, have made it to binary distribution yet. I'm > happy to try to get the latest upstream working once that has happened. I have the enclosed diff so far. It somehow barfs at compiling constraint.c: constraint.c: In function ‘priv_constraint_child’: constraint.c:395:13: error: implicit declaration of function ‘setresgid’; did you mean ‘setregid’? [-Wimplicit-function-declaration] 395 | setresgid(pw_gid, pw_gid, pw_gid) || | ^~~~~~~~~ | setregid constraint.c:396:13: error: implicit declaration of function ‘setresuid’; did you mean ‘setreuid’? [-Wimplicit-function-declaration] 396 | setresuid(pw_uid, pw_uid, pw_uid)) | ^~~~~~~~~ | setreuid constraint.c: In function ‘httpsdate_request’: constraint.c:1047:21: error: implicit declaration of function ‘strptime’; did you mean ‘strftime’? [-Wimplicit-function-declaration] 1047 | if (strptime(p, IMF_FIXDATE, | ^~~~~~~~ | strftime constraint.c:1048:41: warning: comparison between pointer and integer 1048 | &httpsdate->tls_tm) == NULL) { | ^~ make[2]: *** [Makefile:583: ntpd-constraint.o] Error 1 This shouldn't happen since unistd.h and time.h are included at the start of the file. Martin-Éric
02-port-to-Hurd.patch
(text/x-patch, 1.7 KB)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martin-Éric Racine <[email protected]> Date: Tue Jul 21 11:30:31 EEST 2026 Subject: [PATCH] Port to Hurd --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -53,6 +53,11 @@ endif endif +if HOST_GNU +libcompat_la_SOURCES += adjfreq_hurd.c +libcompat_la_SOURCES += hurd.c +endif + if HOST_OPENBSD libcompat_la_SOURCES += adjfreq_openbsd.c endif --- /dev/null +++ b/compat/adjfreq_hurd.c @@ -0,0 +1,18 @@ +#if defined(__GNU__) || defined(HOST_GNU) + +#include <stdint.h> +#include <errno.h> + +int +adjfreq(const int64_t * __restrict freq, int64_t * __restrict oldfreq) +{ + if (oldfreq) + *oldfreq = 0; + if (freq && *freq != 0) { + errno = ENOSYS; + return -1; + } + return 0; +} + +#endif --- /dev/null +++ b/compat/hurd.c @@ -0,0 +1,16 @@ +#if defined(__GNU__) || defined(HOST_GNU) + +#include <sys/types.h> +#include <errno.h> + +int +adjfreq(const int64_t *freq, int64_t *oldfreq) +{ + if (oldfreq) + *oldfreq = 0; + if (freq && *freq != 0) + return EINVAL; + return 0; +} + +#endif --- a/compat/imsg-buffer.c +++ b/compat/imsg-buffer.c @@ -32,6 +32,17 @@ #include "imsg.h" +/* Fix for GNU/Hurd: IOV_MAX */ +#if defined(__GNU__) || defined(HOST_GNU) +# if !defined(IOV_MAX) +# include <limits.h> +# include <sys/uio.h> +# if !defined(IOV_MAX) +# define IOV_MAX 1024 +# endif +# endif +#endif + struct ibufqueue { TAILQ_HEAD(, ibuf) bufs; uint32_t queued; --- openntpd-7.9p1.orig/configure.ac +++ openntpd-7.9p1/configure.ac @@ -20,6 +20,9 @@ AC_INIT([OpenNTPD], m4_esyscmd(tr -d '\n' < VERSION)) AC_CANONICAL_HOST + +AM_CONDITIONAL([HOST_GNU], [test "x$host_os" = xgnu]) + AM_INIT_AUTOMAKE([subdir-objects foreign]) AC_CONFIG_MACRO_DIR([m4])