Hi Al,
starting from kernel 2.6.23, linux/limits.h doesn't longer export
OPEN_MAX macro.
There are two testcases using it (pipe_test02.c and fork09).
Wherever it is possible, I defined OPEN_MAX as an alias for a sysconf call,
otherwise I fixed its value.
This patch applies to 20070731 release, but should works fine for latest
release
Kind regards,
Carmelo
Define OPEN_MAX not being exported by kernel headers.
Wherever it's possible, use the sysconf function, otherwise
hard code its value
Signed-off-by: Carmelo Amoroso <[EMAIL PROTECTED]>
--- ltp-full-20070731/testcases/kernel/syscalls/fork/fork09.c.orig
2007-10-02 01:17:04.000000000 +0200
+++ ltp-full-20070731/testcases/kernel/syscalls/fork/fork09.c 2007-10-02
01:22:49.000000000 +0200
@@ -44,7 +44,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
-#include <linux/limits.h> /* for OPEN_MAX */
+#include <unistd.h> /* for _SC_OPEN_MAX */
#include "test.h"
#include "usctest.h"
@@ -60,6 +60,8 @@ int first;
FILE **fildeses; /* file streams */
int mypid, nfiles;
+#define OPEN_MAX (sysconf(_SC_OPEN_MAX))
+
int main(int ac, char **av)
{
int pid, status, nf;
--- ltp-full-20070731/testcases/kernel/ipc/ipc_stress/pipe_test_02.c.orig
2007-10-02 01:11:56.000000000 +0200
+++ ltp-full-20070731/testcases/kernel/ipc/ipc_stress/pipe_test_02.c
2007-10-02 01:24:52.000000000 +0200
@@ -73,11 +73,6 @@
#include <sys/wait.h>
#include <unistd.h>
-#ifdef _LINUX_
-#include <linux/limits.h>
-#endif
-
-
/* Defines:
*
* MB: one megabyte (MB)
@@ -98,6 +93,7 @@
#define MB (1024*1024)
#define DEFAULT_PACKETS_TO_SEND 1024
#define DEFAULT_NUM_CHILDREN 1
+#define OPEN_MAX 256
#define MAXCHILD (OPEN_MAX/2 - 2)
#define VALID_PACKET 0xabcdef01
#define USAGE "\nUsage: %s [-n] [-p nprocs] [{-m totmegs | -b totbytes}]\n\n"
\
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list