Hi,
On 1/25/23 14:48, Beata Michalska wrote:
Hi Amit,
All looks good - thanks for those changes. There is only one minor gramma issue in the commit message but I can amend that while applying the patch, if you are ok with it.
Please go ahead and apply them. I struggled with my mail client and messed up replying.
Amit
BR B. On Wed, Jan 18, 2023 at 04:58:34PM +0530, Amit Daniel Kachhap wrote:
Musl and glibc syscall wrappers handles the null mq name in different
s/handles/handle
ways and report different errors. Glibc reports EINVAL error if the mq_name is not preceded by "/" character but musl library does not treat this as an error and invokes the kernel mq_open syscall which finally fails with ENOENT error.
Introduce an alternative return error ENOENT so that this test passes with musl library.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@arm.com
changes in v3: *) Retain the mq_open library call and add new error code for musl failure as suggested by Beata.
testcases/kernel/syscalls/mq_open/mq_open01.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/testcases/kernel/syscalls/mq_open/mq_open01.c b/testcases/kernel/syscalls/mq_open/mq_open01.c index cd2a229d8..8a229d298 100644 --- a/testcases/kernel/syscalls/mq_open/mq_open01.c +++ b/testcases/kernel/syscalls/mq_open/mq_open01.c @@ -34,6 +34,7 @@ struct test_case { struct mq_attr *rq; int ret; int err;
- int alt_err; void (*setup)(void); void (*cleanup)(void); };
@@ -96,6 +97,7 @@ static struct test_case tcase[] = { .oflag = O_CREAT, .ret = -1, .err = EINVAL,
}, { .desc = "NORMAL",.alt_err = ENOENT, /* Musl library reports this error for empty mqueue name */
@@ -260,9 +262,11 @@ static void do_test(unsigned int i) } if (TST_ERR != tc->err) {
tst_res(TFAIL | TTERRNO, "%s expected errno: %d",
tc->desc, TST_ERR);
goto CLEANUP;
if (TST_ERR != tc->alt_err) {
tst_res(TFAIL | TTERRNO, "%s expected errno: %d",
tc->desc, TST_ERR);
goto CLEANUP;
}}
if (TST_RET != tc->ret) { -- 2.25.1