[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Commandline handling in the kernel



On Thu, 2009-01-15 at 20:57 +0100, Patrice Mandin wrote:
> Le Thu, 15 Jan 2009 18:31:32 +0000
> Alan Hourihane <alanh@fairlite.co.uk> a _crit:
> 
> > Right, I understand ARGV, but I was getting a little disturbed by the fact
> > ARG_MAX returns 128, implying that ARGV is somehow getting limited to 128 as well. 
> > That's obviously wrong.
> 
> As Vincent said, it is limited to 128 bytes, hence ARG_MAX limit. For
> programs linked with mintlib, it is crt0.o (or something else called
> later in the mintlib, before the application main() function) that
> parses the ARGV variable from environment.
> 
> If you make a program that does not link to mintlib, you are
> effectively limited to ARG_MAX; like asm programs for example, or TSR
> programs that must Ptermres() to get their memory reserved. In both
> cases, you don't use the mintlib crt0.o to parse ARGV.

Right, but what I'm saying is if you do a sysconf(_SC_ARG_MAX) you get
128 (or 127 can't remember off hand) which is wrong - isn't it ?

Alan.