Why does xargs limit argument-sizes to 470 bytes?

G A Moffett gam at amdahl.UUCP
Sun Feb 2 21:29:41 AEST 1986


I recently wrote a simple public domain version of xargs(1),
using the arbitrary limit of BUFSIZ (from stdio.h) as the
size of the collected arguments passed to whatever command
xargs is to do.

In looking on the SVR2 source, I find it uses 470 bytes
(with a 100-byte buffer) for the args.

I'm amazed.  I felt that using BUFSIZ was rather conservative,
considering that the standard limit of the size of arguments passed
to exec(2) (which xargs uses) is 5120 bytes, and this limit
appears to be universal (from 512-byte blocks * 10 direct i-nodes,
where the 512 is the minimum -- original? -- Unix file block size).

Why then such a ridiculously small limit?  (And what is so magic about
the number 570, anyway?).

Can anyone explain this, or have I mis-seen something?
-- 
Gordon A. Moffett		...!{ihnp4,cbosgd,seismo,hplabs}!amdahl!gam

~ You tell me it's the institution...
~ Well, you better free your mind instead (shoo-be-do-wap ...) ~



More information about the Net.bugs.usg mailing list