[2.5.2p1] openbsd-compat/glob.c: ARG_MAX not defined, alternative

Charles Levert charles at comm.polymtl.ca
Tue Mar 20 17:40:29 EST 2001


Hi.

On sparc-sun-sunos4.1.4 (i.e., -DSUNOS4), ARG_MAX is not defined
anywhere, although <sys/limits.h> has the following line:

	#define _POSIX_ARG_MAX          4096

This is more a minimum imposed by POSIX than anything else.  The
proper solution revolves around this:

========================================================================
bash$ cat > x.c
#include <unistd.h>
#include <stdio.h>

int
main(int argc, char **argv)
{
        printf("%ld\n", sysconf(_SC_ARG_MAX));

        return 0;
}
^D
bash$ gcc -o x x.c
bash$ ./x
1048576
========================================================================


Charles





More information about the openssh-unix-dev mailing list