public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/sched_getattr02: use a fixed size for EINVAL test
@ 2024-11-01 13:02 Jan Stancek
  2024-11-02  3:18 ` Li Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2024-11-01 13:02 UTC (permalink / raw)
  To: ltp

Test is using a 'size' based on sizeof(struct sched_attr), but
since c48700d8cdbe ("sched_attr: Do not define for glibc >= 2.41")
that structure can now be defined by glibc which also defines additional
fields.

The kernel only checks if size is smaller than SCHED_ATTR_SIZE_VER0 (48 bytes).
Man page mentions this size directly, so just use a fixed size for the test.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/sched_getattr/sched_getattr02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/sched_getattr/sched_getattr02.c b/testcases/kernel/syscalls/sched_getattr/sched_getattr02.c
index 5efec2ff5a95..d2099d09f532 100644
--- a/testcases/kernel/syscalls/sched_getattr/sched_getattr02.c
+++ b/testcases/kernel/syscalls/sched_getattr/sched_getattr02.c
@@ -51,7 +51,7 @@ static struct test_case {
 } test_cases[] = {
 	{&unused_pid, &attr_copy, sizeof(struct sched_attr), 0, ESRCH},
 	{&pid, NULL, sizeof(struct sched_attr), 0, EINVAL},
-	{&pid, &attr_copy, sizeof(struct sched_attr) - 1, 0, EINVAL},
+	{&pid, &attr_copy, 47, 0, EINVAL},
 	{&pid, &attr_copy, sizeof(struct sched_attr), 1000, EINVAL}
 };
 
-- 
2.43.0


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

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

end of thread, other threads:[~2024-11-04 10:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-01 13:02 [LTP] [PATCH] syscalls/sched_getattr02: use a fixed size for EINVAL test Jan Stancek
2024-11-02  3:18 ` Li Wang
2024-11-04  9:13   ` Petr Vorel
2024-11-04  9:53     ` Jan Stancek
2024-11-04 10:31       ` Petr Vorel

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