Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: Martin Doucha <martin.doucha@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] open06.c: convert to new LTP API
Date: Thu, 14 Jul 2022 15:18:48 +0200	[thread overview]
Message-ID: <YtAXuBDka4VC90q/@pevik> (raw)
In-Reply-To: <20220714124611.9772-1-akumar@suse.de>

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().

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-07-14 13:19 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 [this message]
2022-07-27  7:28   ` Avinesh Kumar
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=YtAXuBDka4VC90q/@pevik \
    --to=pvorel@suse.cz \
    --cc=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=martin.doucha@suse.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