Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] waitid10: raise SIGFPE directly
@ 2022-05-12 13:10 Cyril Hrubis
  2022-05-12 19:30 ` Jan Stancek
  2022-05-13  2:02 ` Li Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Cyril Hrubis @ 2022-05-12 13:10 UTC (permalink / raw)
  To: ltp

The SIGFPE for division by zero is actually not send for quite a few
architectures (ARM for instance) and even on x86 and x86_64 we need to
work around compiler to make it generate code that actually triggers the
condition.

So this patch fixes the test in the simplest way possible. the child
just directly raises SIGFPE instead.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/waitid/waitid10.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/syscalls/waitid/waitid10.c b/testcases/kernel/syscalls/waitid/waitid10.c
index e75edd07e..388b31cc9 100644
--- a/testcases/kernel/syscalls/waitid/waitid10.c
+++ b/testcases/kernel/syscalls/waitid/waitid10.c
@@ -24,12 +24,8 @@ static void run(void)
 	pid_t pidchild;
 
 	pidchild = SAFE_FORK();
-	if (!pidchild) {
-		volatile int a, zero = 0;
-
-		a = 1 / zero;
-		exit(a);
-	}
+	if (!pidchild)
+		raise(SIGFPE);
 
 	TST_EXP_PASS(waitid(P_ALL, 0, infop, WEXITED));
 	TST_EXP_EQ_LI(infop->si_pid, pidchild);
-- 
2.35.1


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

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

end of thread, other threads:[~2022-05-13 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-12 13:10 [LTP] [PATCH v2] waitid10: raise SIGFPE directly Cyril Hrubis
2022-05-12 19:30 ` Jan Stancek
2022-05-13  2:02 ` Li Wang
2022-05-13  9:07   ` Cyril Hrubis
2022-05-13  9:24     ` Li Wang
2022-05-13 12:38       ` Cyril Hrubis

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