public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] get_robust_list01: use pid_max instead of UINT16_MAX
@ 2013-12-13  9:29 Jan Stancek
  2013-12-23  1:22 ` Wanlong Gao
  2013-12-25  0:58 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Stancek @ 2013-12-13  9:29 UTC (permalink / raw)
  To: ltp-list

UINT16_MAX can be a valid pid number on some systems.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../syscalls/get_robust_list/get_robust_list01.c   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
index dd5e726..17da538 100644
--- a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
+++ b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
@@ -68,6 +68,7 @@ struct robust_list_head {
 };
 
 int exp_enos[] = { ESRCH, EPERM, EFAULT, 0 };
+static unsigned int pid_max;
 
 void setup(void);
 void cleanup(void);
@@ -134,7 +135,7 @@ int main(int argc, char **argv)
 		 * find the task specified by the pid argument.
 		 */
 
-		TEST(ltp_syscall(__NR_get_robust_list, UINT16_MAX,
+		TEST(ltp_syscall(__NR_get_robust_list, pid_max,
 				      (struct robust_list_head *)&head,
 				      &len_ptr));
 
@@ -190,6 +191,7 @@ void setup(void)
 	tst_require_root(NULL);
 
 	TEST_EXP_ENOS(exp_enos);
+	SAFE_FILE_SCANF(NULL, "/proc/sys/kernel/pid_max", "%u", &pid_max);
 
 	TEST_PAUSE;
 }
-- 
1.7.1


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-12-25  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-13  9:29 [LTP] [PATCH] get_robust_list01: use pid_max instead of UINT16_MAX Jan Stancek
2013-12-23  1:22 ` Wanlong Gao
2013-12-25  0:58 ` Wanlong Gao

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