Change proc/<pid>/cmdline to 8k

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Jun 4 18:19:06 EDT 2015


On Thu, 04 Jun 2015 21:06:10 +0530, Navin P said:
> have this 3rd party application with deeply mounted dir that runs as a
> testcase more than 5k chars . We can change it , i thought if that was
> the problem ?

So why is a long commandline a problem that needs solving? Are you actually
caring what the command line says?  If so, why?

Hint: There's no guarantee that your commandline contain the actual full
command string.  Consider this on an x86_84 kernel (yes, my $HOME does
need a good cleaning))

% /bin/echo * | wc
      1    1884   25797

1,884 parameters in argv[], totalling some 24K of data.  Which means that
20k isn't displayable.  And extending it to 64k won't fix the problem, as
demonstrated by looking at a rather large mail folder I have:

% /bin/echo ietf/* | wc
      1   62257  673721

OK, how far can we take this?

%  echo | xargs --show-limits echo
Your environment variables take up 1918 bytes
POSIX upper limit on argument length (this system): 2093186
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2091268
Size of command buffer we are actually using: 131072

Apparently, up to 2M or so...

So what problem are you trying to solve, and why?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/2332681d/attachment.bin 


More information about the Kernelnewbies mailing list