Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amdahl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!nsc!amdahl!gam From: gam@amdahl.UUCP (G A Moffett) Newsgroups: net.unix-wizards,net.bugs.usg Subject: Why does xargs limit argument-sizes to 470 bytes? Message-ID: <2721@amdahl.UUCP> Date: Sun, 2-Feb-86 06:29:41 EST Article-I.D.: amdahl.2721 Posted: Sun Feb 2 06:29:41 1986 Date-Received: Mon, 3-Feb-86 05:18:27 EST Reply-To: gam@amdahl.UUCP (G A Moffett) Organization: Amdahl Corp, UTS Products Group Lines: 24 Xref: watmath net.unix-wizards:16632 net.bugs.usg:437 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 ...) ~