How many bytes can be sent as command-line argument when spawning a process under Linux?
excellent article! Thanks!
jldupont
2009-09-26 00:59:32
+4
A:
This snippet will tell you.
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv)
{
const long value = sysconf(_SC_ARG_MAX);
printf("ARG_MAX: %ld\n", value);
}
nall
2009-09-26 00:58:06
+2
A:
gahooa suggests a good article at http://www.in-ulm.de/~mascheck/various/argmax/, but if that page disappears someday, here's the meat of the matter: to find the max length of your command line arguments try one of the following
* command: getconf ARG_MAX
* system call: sysconf(_SC_ARG_MAX)
* system header: ARG_MAX in e.g. <[sys/]limits.h>
Shannon Nelson
2009-09-26 08:17:57