From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: "Michael Kerrisk \(man-pages\)" <mtk.manpages@gmail.com>
Cc: libc-alpha@sourceware.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] manual: Clarify File Access Modes section and add O_PATH
Date: Tue, 19 May 2020 13:03:44 +0200 [thread overview]
Message-ID: <87mu64i3u7.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <fc0ec13d-987e-260a-8fad-b259ec1ef2b5@gmail.com> (Michael Kerrisk's message of "Mon, 18 May 2020 21:57:58 +0200")
* Michael Kerrisk:
>> +mode. Usually, The mode will be @code{O_RDONLY}, @code{O_WRONLY}, or
>> +@code{O_RDWR}.
>> +@end deftypevr
>> +
>> +If the mode is zero, it means that a non-standard access mode has been
>> +used.
>
> Either I misunderstand the previous sentence, or I think it is
> wrong. O_RDONLY has the value 0; that's a standard access mode.
Meh, I had forgotten about that. That makes the interaction of
O_ACCMODE and non-POSIX access modes certainly more complicated.
I'll have to think about it.
>> @code{O_WRONLY} are independent bits that can be bitwise-ORed together,
>> and it is valid for either bit to be set or clear. This means that
>> @@ -3591,40 +3626,21 @@ mode of zero is permissible; it allows no operations that do input or
>> output to the file, but does allow other operations such as
>> @code{fchmod}. On @gnuhurdsystems{}, since ``read-only'' or ``write-only''
>> is a misnomer, @file{fcntl.h} defines additional names for the file
>> -access modes. These names are preferred when writing GNU-specific code.
>> -But most programs will want to be portable to other POSIX.1 systems and
>> -should use the POSIX.1 names above instead.
>> +access modes.
>
> I do think removing this advice about POSIX is a bad move.
> Why do you want to advise people to use GNU-specific names?
> (I suspect I must be missing something...)
“GNU-specific code” is ambiguous. We sometimes talk about the
platform-independent GNU API, meaning the API that glibc provides on all
ports. But here, “GNU-specific” really means “Hurd-specific”.
Thanks,
Florian
next prev parent reply other threads:[~2020-05-19 11:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 7:49 [PATCH] manual: Clarify File Access Modes section and add O_PATH Florian Weimer via Libc-alpha
2020-05-18 19:57 ` Michael Kerrisk (man-pages) via Libc-alpha
2020-05-19 11:03 ` Florian Weimer via Libc-alpha [this message]
2020-05-19 20:25 ` Michael Kerrisk via Libc-alpha
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/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mu64i3u7.fsf@oldenburg2.str.redhat.com \
--to=libc-alpha@sourceware.org \
--cc=fweimer@redhat.com \
--cc=keescook@chromium.org \
--cc=mtk.manpages@gmail.com \
/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).