From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>
Cc: Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 2/3] tools/nolibc: implement fd-based FILE streams
Date: Sun, 2 Apr 2023 15:07:19 +0000 [thread overview]
Message-ID: <d017ce53-b4e2-4068-8971-60cb02c90739@t-8ch.de> (raw)
In-Reply-To: <ZCmLOruMPQDbfTyH@1wt.eu>
On 2023-04-02 16:03:38+0200, Willy Tarreau wrote:
> On Sun, Apr 02, 2023 at 01:02:46PM +0000, Thomas Weißschuh wrote:
> > Willy:
> >
> > This uses intptr_t instead of uintptr_t as proposed because uintptr_t
> > can not be negative.
>
> Ah yes good point.
>
> > +/* provides the fd from of stream. */
> > +static __attribute__((unused))
> > +int fileno(FILE *stream)
> > +{
> > + intptr_t i = (intptr_t)stream;
> > +
> > + if (i > 0) {
>
> If you don't mind I'll change this to "if (i >= 0)" since we also want
> to set errno on NULL.
Sounds good.
> > + SET_ERRNO(EBADF);
> > + return -1;
> > + }
> > + return ~i;
> > +}
>
> OK for the rest of the series.
Thanks,
Thomas
next prev parent reply other threads:[~2023-04-02 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-02 13:02 [PATCH v2 0/3] tools/nolibc: add testcases for vfprintf Thomas Weißschuh
2023-04-02 13:02 ` [PATCH v2 1/3] tools/nolibc: add wrapper for memfd_create Thomas Weißschuh
2023-04-02 13:02 ` [PATCH v2 2/3] tools/nolibc: implement fd-based FILE streams Thomas Weißschuh
2023-04-02 14:03 ` Willy Tarreau
2023-04-02 15:07 ` Thomas Weißschuh [this message]
2023-04-02 13:02 ` [PATCH v2 3/3] tools/nolibc: add testcases for vfprintf Thomas Weißschuh
2023-04-02 16:43 ` [PATCH v2 0/3] " Willy Tarreau
2023-04-02 17:17 ` Thomas Weißschuh
2023-04-02 18:29 ` Willy Tarreau
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=d017ce53-b4e2-4068-8971-60cb02c90739@t-8ch.de \
--to=linux@weissschuh.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=w@1wt.eu \
/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