* [LTP] [PATCH 0/2] syscalls: clean up getpid/getppid tests
@ 2026-05-03 8:55 Jinseok Kim
2026-05-03 8:55 ` [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues Jinseok Kim
2026-05-03 8:55 ` [LTP] [PATCH 2/2] getppid: " Jinseok Kim
0 siblings, 2 replies; 6+ messages in thread
From: Jinseok Kim @ 2026-05-03 8:55 UTC (permalink / raw)
To: ltp
This series updates the tests to:
- Link to the manpage in docparse comments
- Remove unused header includes
- Fix minor style issues in getpid02.c
- Tighten input validation in getppid02.c
Also, getpid02.c and getppid02.c appear to have overlapping coverage.
Since getpid02.c seems to exercise a broader set of checks, would merging
getppid02.c into it make sense?
Jinseok Kim (2):
getpid: Link manpage and fix minor issues
getppid: Link manpage and fix minor issues
testcases/kernel/syscalls/getpid/getpid01.c | 3 ++-
testcases/kernel/syscalls/getpid/getpid02.c | 10 +++++-----
testcases/kernel/syscalls/getppid/getppid01.c | 6 +++---
testcases/kernel/syscalls/getppid/getppid02.c | 5 ++---
4 files changed, 12 insertions(+), 12 deletions(-)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues
2026-05-03 8:55 [LTP] [PATCH 0/2] syscalls: clean up getpid/getppid tests Jinseok Kim
@ 2026-05-03 8:55 ` Jinseok Kim
2026-05-06 14:47 ` Andrea Cervesato via ltp
2026-05-03 8:55 ` [LTP] [PATCH 2/2] getppid: " Jinseok Kim
1 sibling, 1 reply; 6+ messages in thread
From: Jinseok Kim @ 2026-05-03 8:55 UTC (permalink / raw)
To: ltp
Link to the manpage in docparse comments.
Also remove the unused <error.h> header and use tabs for indentation.
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
testcases/kernel/syscalls/getpid/getpid01.c | 3 ++-
testcases/kernel/syscalls/getpid/getpid02.c | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/testcases/kernel/syscalls/getpid/getpid01.c b/testcases/kernel/syscalls/getpid/getpid01.c
index d9ba0953c..8fcd351d6 100644
--- a/testcases/kernel/syscalls/getpid/getpid01.c
+++ b/testcases/kernel/syscalls/getpid/getpid01.c
@@ -4,7 +4,8 @@
*/
/*\
- * Verify that getpid() system call returns process ID in range <2, PID_MAX>.
+ * Verify that :manpage:`getpid(2)` system call returns process ID in range
+ * <2, PID_MAX>.
*/
#include <stdlib.h>
diff --git a/testcases/kernel/syscalls/getpid/getpid02.c b/testcases/kernel/syscalls/getpid/getpid02.c
index 3da853d48..08fcd5337 100644
--- a/testcases/kernel/syscalls/getpid/getpid02.c
+++ b/testcases/kernel/syscalls/getpid/getpid02.c
@@ -6,12 +6,12 @@
/*\
* Check that:
*
- * - fork() in parent returns the same pid as getpid() in child
- * - getppid() in child returns the same pid as getpid() in parent
+ * - :manpage:`fork(2)` in parent returns the same pid as
+ * :manpage:`getpid(2)` in child
+ * - :manpage:`getppid(2)` in child returns the same pid as
+ * :manpage:`getpid(2)` in parent
*/
-#include <errno.h>
-
#include "tst_test.h"
static pid_t *child_pid;
@@ -51,7 +51,7 @@ static void verify_getpid(void)
static void setup(void)
{
child_pid = SAFE_MMAP(NULL, sizeof(pid_t), PROT_READ | PROT_WRITE,
- MAP_ANONYMOUS | MAP_SHARED, -1, 0);
+ MAP_ANONYMOUS | MAP_SHARED, -1, 0);
}
static void cleanup(void)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] getppid: Link manpage and fix minor issues
2026-05-03 8:55 [LTP] [PATCH 0/2] syscalls: clean up getpid/getppid tests Jinseok Kim
2026-05-03 8:55 ` [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues Jinseok Kim
@ 2026-05-03 8:55 ` Jinseok Kim
2026-05-06 14:46 ` Andrea Cervesato via ltp
1 sibling, 1 reply; 6+ messages in thread
From: Jinseok Kim @ 2026-05-03 8:55 UTC (permalink / raw)
To: ltp
Link to the manpage in docparse comments.
Also remove the unused <error.h> header and tighten the ppid bounds check.
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
testcases/kernel/syscalls/getppid/getppid01.c | 6 +++---
testcases/kernel/syscalls/getppid/getppid02.c | 5 ++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/testcases/kernel/syscalls/getppid/getppid01.c b/testcases/kernel/syscalls/getppid/getppid01.c
index 3f05aed37..5b5e6cceb 100644
--- a/testcases/kernel/syscalls/getppid/getppid01.c
+++ b/testcases/kernel/syscalls/getppid/getppid01.c
@@ -5,10 +5,10 @@
*/
/*\
- * Test whether parent process id that getppid() returns is out of range.
+ * Test whether parent process id that :manpage:`getppid(2)` returns is
+ * out of range.
*/
-#include <errno.h>
#include "tst_test.h"
static pid_t pid_max;
@@ -23,7 +23,7 @@ static void verify_getppid(void)
pid_t ppid;
ppid = getppid();
- if (ppid > pid_max)
+ if (ppid < 1 || ppid > pid_max)
tst_res(TFAIL, "getppid() returned %d, out of range!", ppid);
else
tst_res(TPASS, "getppid() returned %d", ppid);
diff --git a/testcases/kernel/syscalls/getppid/getppid02.c b/testcases/kernel/syscalls/getppid/getppid02.c
index 7497eba12..a2796406f 100644
--- a/testcases/kernel/syscalls/getppid/getppid02.c
+++ b/testcases/kernel/syscalls/getppid/getppid02.c
@@ -4,11 +4,10 @@
*/
/*\
- * Check that getppid() in child returns the same pid as getpid() in parent.
+ * Check that :manpage:`getppid(2)` in child returns the same pid as
+ * :manpage:`getpid(2)` in parent.
*/
-#include <errno.h>
-
#include "tst_test.h"
static void verify_getppid(void)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/2] getppid: Link manpage and fix minor issues
2026-05-03 8:55 ` [LTP] [PATCH 2/2] getppid: " Jinseok Kim
@ 2026-05-06 14:46 ` Andrea Cervesato via ltp
0 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-05-06 14:46 UTC (permalink / raw)
To: Jinseok Kim; +Cc: ltp
Hi!
> - if (ppid > pid_max)
> + if (ppid < 1 || ppid > pid_max)
Please remove this, because it's not related to the manpages.
If you want this in, you should add it to an another commit.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues
2026-05-03 8:55 ` [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues Jinseok Kim
@ 2026-05-06 14:47 ` Andrea Cervesato via ltp
2026-05-12 14:35 ` Jinseok Kim
0 siblings, 1 reply; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-05-06 14:47 UTC (permalink / raw)
To: Jinseok Kim; +Cc: ltp
Hi!
> child_pid = SAFE_MMAP(NULL, sizeof(pid_t), PROT_READ | PROT_WRITE,
> - MAP_ANONYMOUS | MAP_SHARED, -1, 0);
> + MAP_ANONYMOUS | MAP_SHARED, -1, 0);
Also here, please don't change other lines but the ones related to the
commit message.
Regars,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues
2026-05-06 14:47 ` Andrea Cervesato via ltp
@ 2026-05-12 14:35 ` Jinseok Kim
0 siblings, 0 replies; 6+ messages in thread
From: Jinseok Kim @ 2026-05-12 14:35 UTC (permalink / raw)
To: ltp
Hi,
Thanks for the review. I'll update the patch accordingly.
Also, do you have any preference on how to handle the overlapping coverage
between getpid02.c and getppid02.c? Since getpid02.c seems to exercise
broader coverage, I was considering whether it makes sense to merge them.
Thanks,
Jinseok.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-12 14:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 8:55 [LTP] [PATCH 0/2] syscalls: clean up getpid/getppid tests Jinseok Kim
2026-05-03 8:55 ` [LTP] [PATCH 1/2] getpid: Link manpage and fix minor issues Jinseok Kim
2026-05-06 14:47 ` Andrea Cervesato via ltp
2026-05-12 14:35 ` Jinseok Kim
2026-05-03 8:55 ` [LTP] [PATCH 2/2] getppid: " Jinseok Kim
2026-05-06 14:46 ` Andrea Cervesato via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox