[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (fcntl fd F_GETLK ...) from Guile
From: |
dsmich |
Subject: |
Re: (fcntl fd F_GETLK ...) from Guile |
Date: |
Fri, 31 Aug 2007 10:19:14 -0400 |
---- Kaloian Doganov <address@hidden> wrote:
> Is there a way to use fcntl's F_GETLK command from Guile? According
> to the docs [1], only the following commands are available:
>
> F_DUPFD
> F_GETFD
> F_SETFD
> F_GETFL
> F_SETFL
> F_GETOWN
> F_SETOWN
> FD_CLOEXEC
>
> Neighter F_GETLK nor F_SETLK is there. Am I missing something?
Yes, Guile seems to be missing those. These are just numbers, so you can
probably just:
(define F_GETLK 5)
(define F_SETLK 6)
or whatever the proper values are on your platform.
Here is a patch for libguile/filesys.c to add them. Untested.
--- filesys.c.old 2006-10-03 23:35:07.000000000 -0400
+++ filesys.c 2007-08-31 10:14:01.118281135 -0400
@@ -1732,6 +1732,12 @@
#ifdef F_SETFL
scm_c_define ("F_SETFL", scm_from_long (F_SETFL));
#endif
+#ifdef F_GETLK
+ scm_c_define ("F_GETLK", scm_from_long (F_GETLK));
+#endif
+#ifdef F_SETLK
+ scm_c_define ("F_SETLK", scm_from_long (F_SETLK));
+#endif
#ifdef F_GETOWN
scm_c_define ("F_GETOWN", scm_from_long (F_GETOWN));
#endif
--Dale