From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 3/5] Add fchmodat2 fallback definition
Date: Tue, 30 Jul 2024 11:14:58 +0200 [thread overview]
Message-ID: <20240730091458.GB1337464@pevik> (raw)
In-Reply-To: <20240724-fchmodat2-v3-3-1dc7cfc634b8@suse.com>
Hi Andrea,
...
> +static inline int fchmodat2(
> + int dfd, const char *filename, mode_t mode, int flags)
IMHO more consistent is:
static inline int fchmodat2(int dfd, const char *filename, mode_t mode, int flags)
But more important, you need to have as first two params: const char *file,
const int lineno, e.g.:
#define SAFE_FCHMODAT2(path, mode) \
safe_access(__FILE__, __LINE__, (filename), (mode), (flags))
static inline int fchmodat2(const char *file, const int lineno, int dfd, const
char *filename, mode_t mode, int flags)
{
...
#
This way instead of this:
../../../../include/lapi/stat.h:239: TBROK: fchmodat2(3,symlink,416,256) error: EOPNOTSUPP (95)
we get file and line of the test (common approach, see lib/tst_safe_macros.c
include/tst_safe_macros.h).
Kind regards,
Petr
> +{
> + int ret;
> +
> + ret = tst_syscall(__NR_fchmodat2, dfd, filename, mode, flags);
> + if (ret == -1)
> + tst_brk(TBROK | TERRNO, "%s(%d,%s,%d,%d) error",
> + __func__, dfd, filename, mode, flags);
> +
> + return ret;
> +}
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-07-30 9:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 9:45 [LTP] [PATCH v3 0/5] Add fchmodat2 testing suite Andrea Cervesato
2024-07-24 9:45 ` [LTP] [PATCH v3 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
2024-07-24 9:45 ` [LTP] [PATCH v3 2/5] Add fchmodat2 syscalls definitions Andrea Cervesato
2024-07-29 20:38 ` Petr Vorel
2024-07-24 9:45 ` [LTP] [PATCH v3 3/5] Add fchmodat2 fallback definition Andrea Cervesato
2024-07-30 9:14 ` Petr Vorel [this message]
2024-07-24 9:45 ` [LTP] [PATCH v3 4/5] Add fchmodat2_01 test Andrea Cervesato
2024-07-30 9:09 ` Petr Vorel
2024-08-01 14:28 ` Andrea Cervesato via ltp
2024-07-24 9:45 ` [LTP] [PATCH v3 5/5] Add fchmodat2_02 test Andrea Cervesato
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=20240730091458.GB1337464@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/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