Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH] test/triggers: ensure bogus-ioctl has a reasonable fd limit
@ 2024-07-31 15:03 Kris Van Hees
  2024-07-31 15:12 ` [DTrace-devel] " Nick Alcock
  0 siblings, 1 reply; 3+ messages in thread
From: Kris Van Hees @ 2024-07-31 15:03 UTC (permalink / raw)
  To: dtrace, dtrace-devel

The bogus-ioctl trigger has a loop to close all possible fds, and it
was limit by rlim_max.  On some systems, that was such a high limit
that the loop was taking too long, causing tests to time out.  Set
the limit to 1024, so that the loop will end in reasonable time.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 test/triggers/bogus-ioctl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/triggers/bogus-ioctl.c b/test/triggers/bogus-ioctl.c
index 25933229..f1546445 100644
--- a/test/triggers/bogus-ioctl.c
+++ b/test/triggers/bogus-ioctl.c
@@ -38,7 +38,10 @@ main(void)
 	sigaction(SIGUSR1, &act, NULL);
 
 	getrlimit(RLIMIT_NOFILE, &rl);
-	for (i = 0; i < rl.rlim_max; i++)
+	rl.rlim_cur = 1024;
+	setrlimit(RLIMIT_NOFILE, &rl);
+	getrlimit(RLIMIT_NOFILE, &rl);
+	for (i = 0; i < rl.rlim_cur; i++)
 		close(i);
 	n = 0;
 
-- 
2.45.2


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

end of thread, other threads:[~2024-07-31 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 15:03 [PATCH] test/triggers: ensure bogus-ioctl has a reasonable fd limit Kris Van Hees
2024-07-31 15:12 ` [DTrace-devel] " Nick Alcock
2024-07-31 15:19   ` Nick Alcock

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