unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Re: (fcntl fd F_GETLK ...) from Guile
@ 2007-08-31 14:19 dsmich
  0 siblings, 0 replies; 12+ messages in thread
From: dsmich @ 2007-08-31 14:19 UTC (permalink / raw)
  To: Kaloian Doganov; +Cc: guile-user


---- Kaloian Doganov <kaloian@doganov.org> 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


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: (fcntl fd F_GETLK ...) from Guile
@ 2007-09-01 17:58 dsmich
  0 siblings, 0 replies; 12+ messages in thread
From: dsmich @ 2007-09-01 17:58 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: guile-user


---- Kevin Ryde <user42@zip.com.au> wrote: 
> Kaloian Doganov <kaloian@doganov.org> writes:
> >
> > Neighter F_GETLK nor F_SETLK is there.
> 
> Yep, not there.  It'd need something for "struct flock" (and "struct
> flock64" when available), they're not plain integers like the other
> fcntl commands.

Oops!  Sorry about that.  Just ignore my previous post.

-Dale



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 12+ messages in thread
* (fcntl fd F_GETLK ...) from Guile
@ 2007-08-31 12:58 Kaloian Doganov
  2007-08-31 23:50 ` Kevin Ryde
  2007-09-02  3:34 ` Mike Gran
  0 siblings, 2 replies; 12+ messages in thread
From: Kaloian Doganov @ 2007-08-31 12:58 UTC (permalink / raw)
  To: guile-user

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?  May
be the file locking mechanism is available elsewhere in the Guile
libs?

[1] http://www.gnu.org/software/guile/manual/html_node/Ports-and-File-Descriptors.html#index-fcntl-2899

-- 
Protect your digital freedom and privacy, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-09-11 16:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31 14:19 (fcntl fd F_GETLK ...) from Guile dsmich
  -- strict thread matches above, loose matches on Subject: below --
2007-09-01 17:58 dsmich
2007-08-31 12:58 Kaloian Doganov
2007-08-31 23:50 ` Kevin Ryde
2007-09-01  9:53   ` Kaloian Doganov
2007-09-02  0:30     ` Kevin Ryde
2007-09-03  8:10       ` Kaloian Doganov
2007-09-02  3:34 ` Mike Gran
2007-09-03  8:08   ` Kaloian Doganov
2007-09-03 13:41     ` Mike Gran
2007-09-11 15:00       ` Kaloian Doganov
2007-09-11 16:03         ` Mike Gran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).