Skip to contentSkip to conversation

rt_sigqueueinfo02: Add negative tests for rt_sigqueueinfo

PATCH Superseded Ma Xinjian via ltp 2 participants 3 messages Sep 19, 2024 – Oct 10, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rt_sigqueueinfo02: Add negative tests for rt_sigqueueinfo

Add negative cases for rt_sigqueueinfo(), when errno is EINVAL, EPERM or ESRCH

---
 runtest/syscalls                              |   1 +
 .../syscalls/rt_sigqueueinfo/.gitignore       |   1 +
 .../rt_sigqueueinfo/rt_sigqueueinfo02.c       | 106 ++++++++++++++++++
 3 files changed, 108 insertions(+)
 create mode 100644 testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c
runtest/syscalls +1 -0
index 02e721df9..837fa5699 100644
@@ -1224,6 +1224,7 @@ rt_sigaction03 rt_sigaction03
 rt_sigprocmask01 rt_sigprocmask01
 rt_sigprocmask02 rt_sigprocmask02
 rt_sigqueueinfo01 rt_sigqueueinfo01
+rt_sigqueueinfo02 rt_sigqueueinfo02
 rt_sigsuspend01 rt_sigsuspend01
 rt_sigtimedwait01 rt_sigtimedwait01
 rt_tgsigqueueinfo01 rt_tgsigqueueinfo01
testcases/kernel/syscalls/rt_sigqueueinfo/.gitignore +1 -0
index 37cd20621..a26811b08 100644
@@ -1 +1,2 @@
 /rt_sigqueueinfo01
+/rt_sigqueueinfo02
testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c new file +106 -0

106 lines not on this page · raw message

Signature · 5 lines
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!

testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c line 73

Quoted 4 lines
testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c new file +4 -0
+static void child_do(void)
+{
+	TST_CHECKPOINT_WAKE(0);
+	TST_CHECKPOINT_WAIT(1);

This still has the wake/wait pair in here. Why?

As I said preivously I do not see why the child needs to signal the parent if all the parent needs is the child to exist.

So the child can just wait here for the parent to wake it up.

Or we do not have to use the checkpoints at all, the child can just do pause(); and parent can kill() it once it's done.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi

Quoted 10 lines

Hi!

testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c line 73

Quoted 4 lines
testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo02.c new file +4 -0
+static void child_do(void)
+{
+	TST_CHECKPOINT_WAKE(0);
+	TST_CHECKPOINT_WAIT(1);

This still has the wake/wait pair in here. Why?

As I said preivously I do not see why the child needs to signal the parent if all the parent needs is the child to exist.

Oh sorry, I think I totally get your point now.
I sent the v3 patch. PTAL.

Best regards
Ma

Quoted 9 lines

So the child can just wait here for the parent to wake it up.

Or we do not have to use the checkpoints at all, the child can just do pause(); and parent can kill() it once it's done.

--
Cyril Hrubis
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp