unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
Cc: 46220@debbugs.gnu.org
Subject: bug#46220: Some non-standard O_* flags are missing
Date: Tue, 02 Mar 2021 19:30:01 +0100	[thread overview]
Message-ID: <3c00deee4082fe28fa9fd442ecf7239d049c5333.camel@telenet.be> (raw)
In-Reply-To: <eee99a01c43dec23cd119f71b9a9758c7986aceb.camel@telenet.be>


[-- Attachment #1.1: Type: text/plain, Size: 679 bytes --]

Hi guilers,

Attached is a patch that exports O_NOFOLLOW & others
when available.  While testing, I found some weirdness
(kernel: Linux).

$ ./meta/build-env guile
scheme@(guile-user)> O_NOFOLLOW
$1 = 131072
scheme@(guile-user)> O_NOTRANS
$2 = 0
scheme@(guile-user)> O_LARGEFILE
$3 = 0

O_NOFOLLOW is exported as expected.  O_NOTRANS is exported,
even though on the Linux kernel (O_NOTRANS is Hurd-specific).
O_LARGEFILE is 0, which could be correct I suppose, but if
files are opened in large file mode by default I don't really
see a point in defining O_LARGEFILE.

This seems orthogonal to this bug (well, feature request), though.

Greetings,
Maxime.

[-- Attachment #1.2: 0001-Define-O_NOFOLLOW-and-various-other-flags-when-suppo.patch --]
[-- Type: text/x-patch, Size: 2033 bytes --]

From 885c0886295eded82188c32b3b5ae52dd08b306c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 2 Mar 2021 18:03:22 +0100
Subject: [PATCH] Define `O_NOFOLLOW' and various other flags when supported.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* libguile/filesys.c (scm_init_filesys): Define ‘O_IGNORE_CTTY’,
  ‘O_NOLINK’, ‘O_NOFOLLOW’, ‘O_TMPFILE’, ‘O_SHLOCK’, ‘O_EXLOCK’,
  ‘O_ASYNC’, ‘O_NOATIME’, ‘O_DIRECTORY’, ‘O_CLOEXEC’ and ‘O_DIRECT’
  when available.
---
 libguile/filesys.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/libguile/filesys.c b/libguile/filesys.c
index 1b0af6e14..020c9cf7b 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1958,9 +1958,42 @@ scm_init_filesys ()
 #ifdef O_LARGEFILE  
   scm_c_define ("O_LARGEFILE", scm_from_int (O_LARGEFILE));
 #endif
+#ifdef O_IGNORE_CTTY
+  scm_c_define ("O_IGNORE_CTTY", scm_from_int (O_IGNORE_CTTY));
+#endif
+#ifdef O_NOLINK
+  scm_c_define ("O_NOLINK", scm_from_int (O_NOLINK));
+#endif
 #ifdef O_NOTRANS
   scm_c_define ("O_NOTRANS", scm_from_int (O_NOTRANS));
 #endif
+#ifdef O_NOFOLLOW
+  scm_c_define ("O_NOFOLLOW", scm_from_int (O_NOFOLLOW));
+#endif
+#ifdef O_TMPFILE
+  scm_c_define ("O_TMPFILE", scm_from_int (O_TMPFILE));
+#endif
+#ifdef O_SHLOCK
+  scm_c_define ("O_SHLOCK", scm_from_int (O_SHLOCK));
+#endif
+#ifdef O_EXLOCK
+  scm_c_define ("O_EXLOCK", scm_from_int (O_EXLOCK));
+#endif
+#ifdef O_ASYNC
+  scm_c_define ("O_ASYNC", scm_from_int (O_ASYNC));
+#endif
+#ifdef O_NOATIME
+  scm_c_define ("O_NOATIME", scm_from_int (O_NOATIME));
+#endif
+#ifdef O_DIRECTORY
+  scm_c_define ("O_DIRECTORY", scm_from_int (O_DIRECTORY));
+#endif
+#ifdef O_CLOEXEC
+  scm_c_define ("O_CLOEXEC", scm_from_int (O_CLOEXEC));
+#endif
+#ifdef O_DIRECT
+  scm_c_define ("O_DIRECT", scm_from_int (O_DIRECT));
+#endif
 
 #ifdef F_DUPFD  
   scm_c_define ("F_DUPFD", scm_from_int (F_DUPFD));
-- 
2.30.1


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

      parent reply	other threads:[~2021-03-02 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <eee99a01c43dec23cd119f71b9a9758c7986aceb.camel@telenet.be>
2021-01-31 21:30 ` bug#46220: Fwd: Some non-standard O_* flags are missing Maxime Devos
2021-01-31 21:31   ` bug#46220: Acknowledgement (Fwd: Some non-standard O_* flags are missing) GNU bug Tracking System
2021-03-09 19:03   ` bug#46220: Fwd: Some non-standard O_* flags are missing Maxime Devos
2021-05-02 14:05     ` Ludovic Courtès
2021-05-08 10:05     ` Ludovic Courtès
2021-05-08 10:06   ` bug#46220: closed (Re: bug#46220: Fwd: Some non-standard O_* flags are missing) GNU bug Tracking System
2021-03-02 18:30 ` Maxime Devos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c00deee4082fe28fa9fd442ecf7239d049c5333.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=46220@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).