unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Some non-standard O_* flags are missing
@ 2021-01-31 21:13 Maxime Devos
  2021-03-09 20:36 ` Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Devos @ 2021-01-31 21:13 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

Hi guilers,

I noticed the following open flags are not defined:
O_NOFOLLOW, O_TMPFILE, O_IGNORE_CTTY, O_NOLINK,
O_SHLOCK, O_EXLOCK, O_ASYNC, O_NOATIME.

Some of these are Hurd-specific, Linux-specific
and BSD-specific.  I'm particularily interested
in O_NOFOLLOW, O_TMPFILE, O_IGNORE_CTTY, O_NOLINK
and O_NOATIME, the others don't matter for me,
though they may be useful for others.

Could extra O_* flags be exported to Guile (in libguile/filesys.c)
on systems where they are defined?

Greetings,
Maxime
-- 
Maxime Devos <maximedevos@telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7  011F 49E3 EE22 1917 25EE
Freenode handle: mdevos

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: Some non-standard O_* flags are missing
  2021-01-31 21:13 Some non-standard O_* flags are missing Maxime Devos
@ 2021-03-09 20:36 ` Andy Wingo
  2021-03-09 21:47   ` Maxime Devos
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Wingo @ 2021-03-09 20:36 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guile-devel

Hi :)  Sure, would be happy to accept a patch for these.  It's adding
more definitions to the base environment, which is usually a negative,
but we'll have to find some kind of module solution for all of these
flags at some point.  If you do send a patch, please update the manual
and NEWS also.

Cheers,

Andy

On Sun 31 Jan 2021 22:13, Maxime Devos <maximedevos@telenet.be> writes:

> Hi guilers,
>
> I noticed the following open flags are not defined:
> O_NOFOLLOW, O_TMPFILE, O_IGNORE_CTTY, O_NOLINK,
> O_SHLOCK, O_EXLOCK, O_ASYNC, O_NOATIME.
>
> Some of these are Hurd-specific, Linux-specific
> and BSD-specific.  I'm particularily interested
> in O_NOFOLLOW, O_TMPFILE, O_IGNORE_CTTY, O_NOLINK
> and O_NOATIME, the others don't matter for me,
> though they may be useful for others.
>
> Could extra O_* flags be exported to Guile (in libguile/filesys.c)
> on systems where they are defined?
>
> Greetings,
> Maxime



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

* Re: Some non-standard O_* flags are missing
  2021-03-09 20:36 ` Andy Wingo
@ 2021-03-09 21:47   ` Maxime Devos
  2021-03-10 20:08     ` Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Devos @ 2021-03-09 21:47 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

On Tue, 2021-03-09 at 21:36 +0100, Andy Wingo wrote:
> Hi :)  Sure, would be happy to accept a patch for these.
See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46220>
and messages above.  I'll look at updating NEWS and the manual
later.

>   It's adding
> more definitions to the base environment, which is usually a negative,
> but we'll have to find some kind of module solution for all of these
> flags at some point.

Would defining O_* in a new module (ice-9 open-flags)
(or the existing module (ice-9 posix) maybe?) be acceptable?
Or alternatively, a syntax (open-flag SYMBOL) that expands to
the flag's value --

the last one might be tricky in a
cross-compilation context, but I suppose it would be possible
to define some script "c-snarf" for gathering #define values
from some C include headers to generate a target-architecture specific
table "???/lib/guile/$VERSION/c-defines/$SYSTEM/open-flags.alist",
or something like that.

(Perhaps not really ideal for non-Scheme languages that don't
use Scheme's macro system, but on the plus side the flags would
be inlined in the .go.)

-- Well, that's a little complicated for this patch (-:.
But something to think about perhaps, for eventual native
compilation.  (IIRC Racket and Common Lisp have a FFI
that understands C include files to some degree.)

>   If you do send a patch, please update the manual
> and NEWS also.

The manual only documents O_RDONLY, O_WRONLY, O_RDWR,
O_APPEND and O_CREAT currently, and points the reader
at glibc's manual for additional flags.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: Some non-standard O_* flags are missing
  2021-03-09 21:47   ` Maxime Devos
@ 2021-03-10 20:08     ` Andy Wingo
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2021-03-10 20:08 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Andy Wingo, guile-devel

Heya :)

On Tue 09 Mar 2021 22:47, Maxime Devos <maximedevos@telenet.be> writes:

> On Tue, 2021-03-09 at 21:36 +0100, Andy Wingo wrote:
>> Hi :)  Sure, would be happy to accept a patch for these.
> See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46220>
> and messages above.  I'll look at updating NEWS and the manual
> later.

Great!

I agree it's weird that O_NOTRANS is defined but 0 on GNU/Linux.
Perhaps better not to define it if it's zero?  Dunno tho.

>>   It's adding
>> more definitions to the base environment, which is usually a negative,
>> but we'll have to find some kind of module solution for all of these
>> flags at some point.
>
> Would defining O_* in a new module (ice-9 open-flags)
> (or the existing module (ice-9 posix) maybe?) be acceptable?
> Or alternatively, a syntax (open-flag SYMBOL) that expands to
> the flag's value --

Let's punt for now :)

>>   If you do send a patch, please update the manual
>> and NEWS also.
>
> The manual only documents O_RDONLY, O_WRONLY, O_RDWR,
> O_APPEND and O_CREAT currently, and points the reader
> at glibc's manual for additional flags.

Ah yes.  Probably the flags (possibly) supported by Guile should be in
the manual.  Document them if you have a moment? :)  Otherwise just
document the new ones.

Andy



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

end of thread, other threads:[~2021-03-10 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31 21:13 Some non-standard O_* flags are missing Maxime Devos
2021-03-09 20:36 ` Andy Wingo
2021-03-09 21:47   ` Maxime Devos
2021-03-10 20:08     ` Andy Wingo

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).