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

Re: Limits of grep?




On Tue, 26 Sep 2000, Nadav Har'El wrote:

> By the way, 128K (if this is indeed the limit on Linux) is actually a big
> limit.

this is indeed the limit. more exactly, it is 131068 bytes (128K - 4
bytes). the limit is for both command line arguments and the
environment. this is for linux on x86. on some other hardware platforms
the limit would be about twice as that (due to using a larger page size).

btw, i don't know this limit - i just peeked at the kernel source
(v2.2.14, /usr/src/linux/fs/exec.c , function do_exec. look at function
do_execve. thus this limitation may be different for different kernel
versions.

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?

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...).

limits have their limitations, after all ;0

guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy


=================================================================
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