ARG_MAX and glob.c [PATCH]

Jeff Johnston jjohnstn@redhat.com
Sat Apr 1 07:57:00 GMT 2006


Sorry the delay Shaun.

I do not see why this change is necessary for you.

First of all, libc/sys/linux/stdlib/glob.c includes "collate.h" which 
includes <limits.h>.

Now, when I run on my FC4 system, the <limits.h> we use when running 
i686-pc-linux-gnu linux is libc/sys/linux/include/limits.h which does a 
number of things and eventually gets to:

#ifdef  __USE_POSIX
/* POSIX adds things to <limits.h>.  */
# include <bits/posix1_lim.h>
#endif

This in turn includes a number of header files which eventually includes
<linux/limits.h> which defines ARG_MAX.

Why don't you see this chain?  You should be seeing the same thing for 
your i386-linux-newlib configuration.

-- Jeff J.

Shaun Jackman wrote:
> Ping?
> 
> On 11/28/05, Shaun Jackman <sjackman@gmail.com> wrote:
> 
>>In attempting to compile glob.c, I found that it uses ARG_MAX, which
>>is defined in sys/syslimits.h, although it doesn't include this file.
>>SUSv3 specifies that ARG_MAX is defined in limits.h, but limits.h does
>>not include sys/syslimits.h. I suggest that limits.h should include
>>sys/syslimits.h, and glob.c should include limits.h. Please apply.
>>
>>Cheers,
>>Shaun
>>
>>diff -u -u -r1.1 limits.h
>>--- ./libc/include/limits.h     11 Sep 2002 18:36:39 -0000      1.1
>>+++ ./libc/include/limits.h     28 Nov 2005 17:38:23 -0000
>>@@ -2,6 +2,7 @@
>> # define _LIBC_LIMITS_H_       1
>>
>> #include <newlib.h>
>>+#include <sys/syslimits.h>
>>
>> # ifdef _MB_LEN_MAX
>> #  define MB_LEN_MAX   _MB_LEN_MAX
>>diff -u -u -r1.2 glob.c
>>--- ./libc/sys/linux/stdlib/glob.c      2 Dec 2004 19:30:56 -0000       1.2
>>+++ ./libc/sys/linux/stdlib/glob.c      28 Nov 2005 17:38:23 -0000
>>@@ -73,6 +73,7 @@
>> #include <dirent.h>
>> #include <errno.h>
>> #include <glob.h>
>>+#include <limits.h>
>> #include <pwd.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>>



More information about the Newlib mailing list