Hi,

Please check the attached patch, which fixes a build issue on GNU Hurd.

All the best.
Mario
-- 
https://parenteses.org/mario
>From 2b294c07a74759199dd2c9dc0b4e14d562607366 Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <[email protected]>
Date: Thu, 14 May 2026 12:47:03 +0200
Subject: [PATCH] posixunix.scm: Support flock on GNU Hurd

e7aec6fcda introduced support for flock, which requires sys/file.h on
some platforms.  The inclusion of sys/file.h was conditioned to the
definition of __linux__ only, which causes flock-related code to be
undefined on GNU Hurd.

Fix this by including sys/file.h on systems where __GLIBC__ is
defined.  The check for __linux__ has been kept for compatibility with
Linux systems that do not use the GNU libc (e.g., musl is used).

Tested on:
* GNU debian 0.9 GNU-Mach 1.8+git20260224-up-amd64/Hurd-0.9 x86_64 GNU
* OpenBSD 7.6
* Alpine Linux 3.23.4 (musl)
* Haiku R1/beta5
* Termux on LineageOS 23.2 (Android 16)
---
 posixunix.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/posixunix.scm b/posixunix.scm
index 4ffdf531..0f624648 100644
--- a/posixunix.scm
+++ b/posixunix.scm
@@ -49,7 +49,7 @@ static int C_wait_status;
 # include <termios.h>
 #endif
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 # include <sys/file.h>
 #endif
 
-- 
2.47.3

  • [PATCH] posixunix.scm: Support ... Mario Domenech Goulart via Chicken-hackers

Reply via email to