From: Paul Eggert <eggert@cs.ucla.edu>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
libc-alpha@sourceware.org
Subject: Re: [PATCH v2] linux: Make fdopendir fail with O_PATH (BZ 30373)
Date: Fri, 1 Sep 2023 10:57:03 -0700 [thread overview]
Message-ID: <cddf2305-eb38-9574-5d1e-49af4dce77ee@cs.ucla.edu> (raw)
In-Reply-To: <20230901122651.59253-1-adhemerval.zanella@linaro.org>
On 2023-09-01 05:26, Adhemerval Zanella wrote:
> + /* Fail early for descriptors opened with O_PATH. */
> + if (__glibc_unlikely (flags & O_PATH))
> + {
> + __set_errno (EBADF);
> + return NULL;
> + }
> + /* Make sure the descriptor allows for reading. */
> if (__glibc_unlikely ((flags & O_ACCMODE) == O_WRONLY))
> {
> __set_errno (EINVAL);
Why use EBADF for one situation but EINVAL in the other?
POSIX says it should be EBADF for both situations. Arguably this is a
separate bug, but we should fix both bugs (and fix the documentation
too, to match POSIX).
next prev parent reply other threads:[~2023-09-01 17:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 12:26 Adhemerval Zanella
2023-09-01 17:57 ` Paul Eggert [this message]
2023-09-05 12:07 ` Adhemerval Zanella Netto
2023-10-02 11:09 ` Adhemerval Zanella Netto
2023-11-29 16:54 ` Adhemerval Zanella Netto
2023-11-30 9:54 ` Florian Weimer
2023-11-30 11:51 ` Adhemerval Zanella Netto
-- strict thread matches above, loose matches on Subject: below --
2023-09-01 12:23 Adhemerval Zanella
2023-08-10 13:54 Adhemerval Zanella
2023-08-31 17:43 ` Adhemerval Zanella Netto
2023-08-31 20:21 ` Paul Eggert
2023-09-01 12:22 ` Adhemerval Zanella Netto
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cddf2305-eb38-9574-5d1e-49af4dce77ee@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.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).