How big is the argv[] array?

Randal L. Schwartz @ Stonehenge merlyn at intelob.intel.com
Fri Oct 7 08:35:59 AEST 1988


In article <507 at quintus.UUCP>, ok at quintus (Richard A. O'Keefe) writes:
| Which are the implementations of C where argv[] is present but argv[argc]
| is not defined?

Not so much undefined, as is different.  Dig out an old V6 or PWB UNIX
manual, if you got'em.  In those beasties (back in the old days),

argv[argc] == -1

In fact, the sentence in the V7 execve(2) manpage that reads something
like "the array passed as argv can be used directly in another execve
call because argv[argc] is 0" was changed only slightly from the same
page in V6 which read "the array... *cannot* be used... argv[argc] is
-1".  It never made a lot of grammatical sense after the change.

BSD (or is it Ultrix?  Don't have access to a BSD manpage anymore) got
rid of that sentence.

Just a bit of history.  If you are writing a program to port between
4.3-tahoe and a V6 system, beware! :-)
-- 
Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095
on contract to BiiN Technical Information Services (for now :-),
in a former Intel building in Hillsboro, Oregon, USA
<merlyn at intelob.intel.com> or ...!tektronix!inteloa[!intelob]!merlyn
Standard disclaimer: I *am* my employer!



More information about the Comp.lang.c mailing list