Date: Mon, 24 Nov 1997 13:40:25 +0200 (IST) From: Eli Zaretskii To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Re: c1args.c patches In-Reply-To: <199709162339.TAA28162@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 16 Sep 1997, DJ Delorie wrote: > According the POSIX, the correct thing to do is to NOT define ARG_MAX > at all in limits.h, if its value is indeterminate. In those cases, > applications may use #ifdef to detect if they should use ARG_MAX > (which, if defined, must be constant) or call sysconf(). > > It is not correct for limits.h to define ARG_MAX in terms of > sysconf(). Here's what I propose: *** include/limits.h~0 Fri Nov 21 18:59:48 1997 --- include/limits.h Fri Nov 21 19:04:48 1997 *************** *** 27,41 **** #ifndef __STRICT_ANSI__ ! #define _POSIX_ARG_MAX 4096 /* but only for exec's to other djgpp programs */ ! #define _POSIX_CHILD_MAX 6 /* really limited by memory */ #define _POSIX_LINK_MAX 1 /* POSIX says 8, but DOS says 1 */ #define _POSIX_MAX_CANON 126 /* POSIX says 255, but DOS says 126 */ #define _POSIX_MAX_INPUT 126 /* POSIX says 255, but DOS says 126 */ #define _POSIX_NAME_MAX 12 /* 8.3 */ #define _POSIX_NGROUPS_MAX 0 #define _POSIX_OPEN_MAX 20 /* can be bigger in DOS, but defaults to 20 */ ! #define _POSIX_PATH_MAX 255 /* 80 for canonical paths */ #define _POSIX_PIPE_BUF 512 /* but there aren't any pipes */ #define _POSIX_SSIZE_MAX 2147483647 #define _POSIX_STREAM_MAX 20 /* can be bigger in DOS */ --- 27,41 ---- #ifndef __STRICT_ANSI__ ! #define _POSIX_ARG_MAX 16384 /* but only for exec's to other djgpp programs */ ! #define _POSIX_CHILD_MAX 7 /* limited by memory; 7 for 386MAX */ #define _POSIX_LINK_MAX 1 /* POSIX says 8, but DOS says 1 */ #define _POSIX_MAX_CANON 126 /* POSIX says 255, but DOS says 126 */ #define _POSIX_MAX_INPUT 126 /* POSIX says 255, but DOS says 126 */ #define _POSIX_NAME_MAX 12 /* 8.3 */ #define _POSIX_NGROUPS_MAX 0 #define _POSIX_OPEN_MAX 20 /* can be bigger in DOS, but defaults to 20 */ ! #define _POSIX_PATH_MAX 256 /* 80 for canonical paths */ #define _POSIX_PIPE_BUF 512 /* but there aren't any pipes */ #define _POSIX_SSIZE_MAX 2147483647 #define _POSIX_STREAM_MAX 20 /* can be bigger in DOS */ *************** *** 43,49 **** #define NGROUPS_MAX 0 ! #define ARG_MAX 4096 #define CHILD_MAX 6 /* #define OPEN_MAX 20 - DOS can change this */ /* #define STREAM_MAX 20 - DOS can change this */ --- 43,49 ---- #define NGROUPS_MAX 0 ! /* #define ARG_MAX 4096 /* depends on LFN; use sysconf */ #define CHILD_MAX 6 /* #define OPEN_MAX 20 - DOS can change this */ /* #define STREAM_MAX 20 - DOS can change this */