On 2026-06-14 06:07, Thomas Klausner wrote:
According to the NetBSD man page, utimens and lutimens exist and are
provided by sys/time.h and sys/stat.h, but both of these headers are
already included, so I'm not sure what the problem is, perhaps a
namespace restriction.

It's actually <sys/stat.h>, not <sys/time.h>. That Gnulib bug should be fixed by the attached patch, which has been installed in Gnulib and should appear in the next gzip release. In the meantime you can suppress the warnings, as you mentioned.
From 39db933c36305612b79300aa34f4d0d926816cd3 Mon Sep 17 00:00:00 2001
From: Collin Funk <[email protected]>
Date: Sun, 23 Mar 2025 16:36:26 -0700
Subject: [PATCH] utimens: Fix missing declarations on NetBSD (regr.
 2024-09-16).

* lib/utimens.h [HAVE_UTIMENS || HAVE_LUTIMENS]: Include <sys/stat.h>
instead of <sys/time.h> for the declarations of these functions on
NetBSD.
---
 ChangeLog     | 5 +++++
 lib/utimens.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 10c428e81f..c849ceb122 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2025-03-23  Collin Funk  <[email protected]>
 
+	utimens: Fix missing declarations on NetBSD (regr. 2024-09-16).
+	* lib/utimens.h [HAVE_UTIMENS || HAVE_LUTIMENS]: Include <sys/stat.h>
+	instead of <sys/time.h> for the declarations of these functions on
+	NetBSD.
+
 	newlocale: Fix implicit function declarations.
 	* lib/newlocale.c [HAVE_NEWLOCALE]: Include string.h for strlen and
 	strcmp, stdio.h for sprintf, and stdlib.h for free.
diff --git a/lib/utimens.h b/lib/utimens.h
index 007958dd93..62ea7d8f5f 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -25,7 +25,7 @@
 #include <time.h>
 
 #if HAVE_UTIMENS || HAVE_LUTIMENS
-# include <sys/time.h>
+# include <sys/stat.h>
 #endif
 
 #ifdef __cplusplus
-- 
2.53.0

Reply via email to