From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] getcwd01: Only check buffer NULL on glibc
Date: Wed, 27 Sep 2023 21:08:08 -0400 [thread overview]
Message-ID: <20230928010808.15862-1-wegao@suse.com> (raw)
Signed-off-by: Wei Gao <wegao@suse.com>
---
testcases/kernel/syscalls/getcwd/getcwd01.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/getcwd/getcwd01.c b/testcases/kernel/syscalls/getcwd/getcwd01.c
index 65d827873..6769eb6f4 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd01.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd01.c
@@ -34,10 +34,13 @@ static struct t_case {
int exp_err;
} tcases[] = {
{(void *)-1, PATH_MAX, EFAULT},
- {NULL, (size_t)-1, ENOMEM},
{buffer, 0, EINVAL},
{buffer, 1, ERANGE},
+/* musl and uclibc-ng will allocate memory before syscall if buf == NULL */
+#ifdef __GLIBC__
+ {NULL, (size_t)-1, ENOMEM},
{NULL, 1, ERANGE}
+#endif
};
static void verify_getcwd(unsigned int n)
--
2.35.3
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2023-09-28 1:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 1:08 Wei Gao via ltp [this message]
2023-09-28 7:06 ` [LTP] [PATCH v1] getcwd01: Only check buffer NULL on glibc Richard Palethorpe
2023-09-28 8:44 ` [LTP] [PATCH v2] getcwd01: Use syscall directly check invalid argument Wei Gao via ltp
2023-09-28 17:55 ` Petr Vorel
2023-09-29 0:49 ` Wei Gao via ltp
2023-09-29 0:45 ` [LTP] [PATCH v3] " Wei Gao via ltp
2023-11-28 10:52 ` Petr Vorel
2023-12-01 3:52 ` Wei Gao via ltp
2023-11-28 10:53 ` Petr Vorel
2023-12-01 3:15 ` [LTP] [PATCH v4] " Wei Gao via ltp
2023-12-01 10:14 ` Petr Vorel
2023-12-04 0:06 ` Wei Gao via ltp
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=20230928010808.15862-1-wegao@suse.com \
--to=ltp@lists.linux.it \
--cc=wegao@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