Re: [hackers] [sbase] Double NARGS || sin

From: Roberto E. Vargas Caballero <>
Date: Thu, 16 Jan 2014 12:11:55 +0100

> Double NARGS
> I just ran a simple one-liner[1] to find the average filepath
> length on my system (absolute paths) and that came up with a value
> ~90 characters. Assume this is out by a factor of two, we still
> have potentially 5000 more arguments that we can put into the buffer.

Uhhhh, it is a bit dangerous:

        $ xargs --show-limits
        Your environment variables take up 725 bytes
        POSIX upper limit on argument length (this system): 2094379
        POSIX smallest allowable upper limit on argument length (all systems): 4096
        Maximum length of command we could actually use: 2093654
        Size of command buffer we are actually using: 131072

The minimun maximun is 4096, so a bigger value is not safe, because
some systems can support only 4096. Maybe could be a good idea use sysconf(3)
in order to get this value.

Roberto E. Vargas Caballero
Received on Thu Jan 16 2014 - 12:11:55 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 16 2014 - 12:12:14 CET