public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] getcwd01: Only check buffer NULL on glibc
@ 2023-09-28  1:08 Wei Gao via ltp
  2023-09-28  7:06 ` Richard Palethorpe
  2023-09-28  8:44 ` [LTP] [PATCH v2] getcwd01: Use syscall directly check invalid argument Wei Gao via ltp
  0 siblings, 2 replies; 12+ messages in thread
From: Wei Gao via ltp @ 2023-09-28  1:08 UTC (permalink / raw)
  To: ltp

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-04  0:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28  1:08 [LTP] [PATCH v1] getcwd01: Only check buffer NULL on glibc Wei Gao via ltp
2023-09-28  7:06 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox