[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LTP] small patch



Here is a small patch that tries to figure out the max number
of syscalls on your system for crash02.c .

It hasn't been tested, other than compiling on linux.

-- 
jonathan@leto.net 
"With pain comes clarity."


--- crash02old.c	Sat Apr 21 01:19:36 2001
+++ crash02.c	Sat Apr 21 01:17:47 2001
@@ -64,6 +64,10 @@
 
 #include "test.h"
 #include "usctest.h"
+#if defined(linux) || defined(__linux) || defined (__linux__) 
+#include <linux/version.h>
+#endif
+
 
 char *TCID="crash02";
 int TST_TOTAL=1;
@@ -82,7 +86,23 @@
 int verbose_level = 2;
 
 /* depends on architecture.. */
-unsigned int sysno_max = 127;
+
+
+#if defined(linux) || defined(__linux) || defined(__linux__) 
+
+	unsigned int sysno_max = 190;
+	#if  LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) 
+		sysno_max = 221;
+	#endif	
+#elif defined(__NetBSD__)
+        unsigned int sysno_max = 306;
+#elif defined(__FreeBSD__)
+	unsigned int sysno_max = 337; /* freebsd 4.x is 363 */
+#elif defined(__OpenBSD__)
+	unsigned int sysno_max = 269;
+#else 
+	unsigned int sysno_max = 127;
+#endif
 
 int nseed;
 int ntries = 100;