summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2010-07-09 11:23:36 -0700
committerKhem Raj <raj.khem@gmail.com>2010-07-09 11:23:36 -0700
commit87c1f3f912593910b978b51d62f549e4dc32e8fb (patch)
tree766a2d288c330d36794124610b19f2080c7f13e0 /include
parent42fb51e0d4e7ab9fe8ff2be3a7405acb8d44e9b2 (diff)
include/param.h: Dont use ARG_MAX from kernel headers
* Use getrlimit for ARG_MAX in sysconf on nptl. * Define NCARGS directly instead of ARG_MAX Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/sys/param.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/sys/param.h b/include/sys/param.h
index 0b0424eb9..19c119a2c 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,2000,2001,2003,2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,20 @@
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H 1
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
+
#include <limits.h>
#include <linux/limits.h>
#include <linux/param.h>
+/* The kernel headers defines ARG_MAX. The value is wrong, though. */
+#ifndef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
+
/* BSD names for some <limits.h> values. */
#define NBBY CHAR_BIT
@@ -31,12 +41,12 @@
#endif
#define MAXSYMLINKS 20
#define CANBSIZ MAX_CANON
-#define NCARGS ARG_MAX
#define MAXPATHLEN PATH_MAX
-/* The following is not really correct but it is a value we used for a
+/* The following are not really correct but it is a value we used for a
long time and which seems to be usable. People should not use NOFILE
- anyway. */
+ and NCARGS anyway. */
#define NOFILE 256
+#define NCARGS 131072
#include <sys/types.h>