From: Avinesh Kumar <akumar@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: Martin Doucha <martin.doucha@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] open06.c: convert to new LTP API
Date: Wed, 27 Jul 2022 12:58:20 +0530 [thread overview]
Message-ID: <4729784.GXAFRqVoOG@localhost> (raw)
In-Reply-To: <YtAXuBDka4VC90q/@pevik>
Hi Petr,
On Thursday, July 14, 2022 6:48:48 PM IST Petr Vorel wrote:
> Hi Avinesh,
>
> > - if (mknod(fname, S_IFIFO | 0644, 0) == -1)
> > - tst_brkm(TBROK, cleanup, "mknod FAILED");
> > + SAFE_MKFIFO(TEMP_FIFO, 0644);
> You changed test from mknod() to mkfifo(). May I know why?
> It would be worth to mention the reason in the commit message.
>
> Should not we keep mknod() ?
> SAFE_MKNOD(TEMP_FIFO, S_IFIFO | 0644, 0);
>
> According to man mknod(2) your change is correct:
>
> POSIX.1-2001 says: "The only portable use of mknod() is to create
> a FIFO-special file. If mode is not S_IFIFO or dev is not 0, the
> behavior of mknod() is unspecified." However, nowadays one
> should never use mknod() for this purpose; one should use
> mkfifo(3), a function especially defined for this purpose.
>
> Also note LTP tests should test even deprecated kernel API, we *might* want to
> test both mkfifo() and mknod() via .test_variants. But I'd like to hear the
> input of the others, because both glibc and musl use SYS_mknod or SYS_mknodat
> for mkfifo() implementation with very thin wrapper, thus not sure if it's worth
> to test also mknod().
I changed to SAFE_MKFIFO as it seemed more intuitive in this open() test,
but yes, I should have mentioned it in the commit message.
I have not checked the mkfifo() implementation in libraries, so please
lmk which one to proceed with here, I will send updated version if needed.
>
> Kind regards,
> Petr
>
Thanks,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-07-27 7:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 12:46 [LTP] [PATCH v2] open06.c: convert to new LTP API Avinesh Kumar
2022-07-14 13:18 ` Petr Vorel
2022-07-27 7:28 ` Avinesh Kumar [this message]
2022-08-11 8:49 ` Petr Vorel
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=4729784.GXAFRqVoOG@localhost \
--to=akumar@suse.de \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@suse.com \
--cc=pvorel@suse.cz \
/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