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

Re: Limits of grep?



On Tue, Sep 26, 2000, guy keren wrote about "Re: Limits of grep?":
> lets read the source more ;)  and btw, this does not mean there is no
> limit also imposed in the shell (i.e. it might check for its own limit
> before invoking the libc function that will then invoke the xecve system
> call - anyone wants to look at bash's source to verify that? and at libc's
> source to verify it doesn't impose another limit too?

As I showed in an example (using 'echo'), both bash and zsh's limits, if any
such limits exist, are higher than the kernel. And if any such limits exist,
they should be promptly removed - almost all the GNU utilities, for example,
don't have any line-length limits except the obvious limit on total memory
size.

> 
> looking further into the header files reveals another limit i was unaware
> of, in /usr/include/bits/posix1_lim.h:
> 
> /* Maximum length of arguments to `execve', including environment.  */
> #define _POSIX_ARG_MAX          4096
> 
> i wonder which version of posix this limit relates to, and if it is at all
> used anywhere in the system. tihs file, on a second glance, looks
> completely outdated (e.g. maximum number of open files for a process is
> 16, maximum number of simultaneos proces per user ID is 6, etc...).

I'm just guessing here, but perhaps this is a posix-mandated *minimum*
ARG_MAX, meaning that any posix system must allow at least this size.

If I remember correctly, AT&T Seventh Edition Unix on VAX had this 4096 byte
limit (which today seems miniscule, but it wasn't too bad, and you'd get
around it with find and xargs), and so did early versions of System V.
Remember that the VAX's contemporary, the Commodore VIC 20, only had 4K in
total memory :)


-- 
Nadav Har'El                        |       Tuesday, Sep 26 2000, 26 Elul 5760
nyh@math.technion.ac.il             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |I love deadlines. I love the whooshing
http://nadav.harel.org.il           |sound they make as they go by.

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il