Fri 23 Mar 2007 03:01:12 PM UTC, original submission:
When running xargs on aix, this assertion in xargs.x#447 fails:
446 #if defined(ARG_MAX)
447 assert(bc_ctl.arg_max <= (ARG_MAX-2048));
448 #endif
As ARG_MAX can be modified (it is an aix kernel parameter), there is no meaning to have ARG_MAX defined as preprocessor constant.
In aix5.3 headers, there's a comment:
/* The following values will be undefined if the system supports a value that
is equal or greater than the stated minimum AND the supported value is
indeterminate (e.g. dependent on memory space).
On AIX, this includes ARG_MAX and CHILD_MAX. (But if _ALL_SOURCE is
used, these are defined with their default values).
*/
Note the last sentence in parents.
So there come a few ways around that to my mind:
1) in xargs.c: ignore ARG_MAX on aix
2) in config.h.in: put "#if 0 ... #endif" around _ALL_SOURCE
3) in configure.in: do not use 'AC_AIX', which defines _ALL_SOURCE
But for 2) and 3), one out of _XOPEN_SOURCE, _POSIX_SOURCE or _ANSI_C_SOURCE needs to be defined to prevent /usr/include/standars.h from defining _ALL_SOURCE.
So as the easiest (best?) way I'd suggest 1):
xargs/xargs.c:
-#if defined(ARG_MAX)
+#if defined(ARG_MAX) && !defined(_AIX)
|