Hi,

Please check the attached patch for a fix that makes chicken-install for
CHICKEN 6 work on Haiku.

All the best.
Mario
-- 
https://parenteses.org/mario
>From 0a52a57c3df5d8d2951b735dc2bcd3015209e0db Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <[email protected]>
Date: Thu, 14 May 2026 10:10:32 +0200
Subject: [PATCH] posixunix.scm: Support flock on Haiku

Without this fix, chicken-install fails on Haiku with:

  Error: (file-lock) locking file failed - No such file or directory: 3

c0fc517bd6 disabled support for flock on Haiku because the build of
CHICKEN would fail on that system due to references to undeclared
constants LOCK_SH, LOCK_EX, LOCK_NB and LOCK_UN.  Those actually
exist, but are declared in posix/sys/file.h, which was not being
included.

Tested on Haiku R1/beta5.
---
 posixunix.scm | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/posixunix.scm b/posixunix.scm
index bb598c89..4ffdf531 100644
--- a/posixunix.scm
+++ b/posixunix.scm
@@ -53,6 +53,10 @@ static int C_wait_status;
 # include <sys/file.h>
 #endif
 
+#ifdef __HAIKU__
+# include <posix/sys/file.h>
+#endif
+
 #include <sys/mman.h>
 #include <poll.h>
 
@@ -161,15 +165,7 @@ static int C_uw;
 
 static C_word C_flock(C_word n, C_word f)
 {
-#ifdef __HAIKU__
-# define LOCK_SH	0
-# define LOCK_EX	0
-# define LOCK_NB 	0
-# define LOCK_UN	0
-	return C_fix(-1);
-#else
     return C_fix(flock(C_unfix(n), C_unfix(f)));
-#endif
 }
 
 static sigset_t C_sigset;
-- 
2.47.3

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

Reply via email to