From: Sergey Bugaev <bugaevc@gmail.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, Samuel Thibault <samuel.thibault@gnu.org>
Subject: Re: [PATCH] io: Refactor close_range and closefrom
Date: Mon, 8 Nov 2021 18:13:06 +0300 [thread overview]
Message-ID: <CAN9u=HeSCqZYS7E_H8aOmopR-ddUCTZFre7ZmCVztjoqeNJ=GQ@mail.gmail.com> (raw)
In-Reply-To: <2485e81c-157e-37c5-317b-6f16fae8f211@linaro.org>
On Mon, Nov 8, 2021 at 5:55 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
> > Is this (either closes everything or nothing) an appropriate thing to
> > promise in the common header? Similarly, if the default implementation
> > accepts no flags, should the common description mention "the
> > CLOSE_RANGE prefix"?
>
> Well, that's the semantic of the both the syscall and the Linux fallback.
> If Hurd does not provide such semantic I think you should work this out.
My Hurd patch does provide that semantic. I'm concerned about this
being promised in the generic header; some other port/kernel could
potentially decide to instead stop & propagate an error from closing a
descriptor. Perhaps the claim could be qualified (for instance, "In
all current ports, ...")? Not that this matters.
Another suggestion:
> + for (int i = 0; i < maxfd; i++)
> + if (i >= lowfd)
> + __close_nocancel_nostatus (i);
This should be
int i;
for (i = first; i <= last && i < maxfd; i++)
__close_nocancel_nostatus (i);
shouldn't it?
How does that even compile? 'lowfd' is the name of closefrom's
argument. close_range's arguments are 'first' and 'last' (and
'flags').
Sergey
next prev parent reply other threads:[~2021-11-08 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 13:58 Adhemerval Zanella
2021-11-08 14:13 ` Sergey Bugaev
2021-11-08 14:55 ` Adhemerval Zanella
2021-11-08 15:13 ` Sergey Bugaev [this message]
2021-11-08 17:04 ` Adhemerval Zanella
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='CAN9u=HeSCqZYS7E_H8aOmopR-ddUCTZFre7ZmCVztjoqeNJ=GQ@mail.gmail.com' \
--to=bugaevc@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
--cc=samuel.thibault@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).