Path: utzoo!attcan!uunet!usenix!std-unix From: guy@auspex.uucp (Guy Harris) Newsgroups: comp.std.unix Subject: Re: vexec function(s)? Message-ID: <401@usenix.ORG> Date: 25 Jul 90 18:24:00 GMT References: <10461@cs.utexas.edu> Sender: std-unix@usenix.ORG Reply-To: std-unix@uunet.uu.net Organization: Auspex Systems, Santa Clara Lines: 33 Approved: jsq@usenix (Moderator, John Quarterman) From: guy@auspex.uucp (Guy Harris) >What I appear to need here is either: > > a) a standard way to convert a va_list into a list of pointers > (to argument values), or I suspect "different_execvp" is misnamed; given the "va_list", it appears to have a calling sequence more like "execlp" - i.e., different_execlp("/bin/explode", "explode", "bright blue light", (char *)NULL); Given that, you could scan the argument list twice; the first time, you'd count the number of arguments, then you'd malloc up an array of N+1 "char *"s, and scan the argument list a second time filling in that array. Now "argv" is a pointer to the first element of that array.... >None of these things are a part of standard ANSI C (as far as I know). The second isn't; the first can be done in ANSI C, unless I've missed something subtle in the spec that forbids traversing the argument list twice (I just checked and didn't see anything obvious). >Are any of them a part of POSIX? Nope. >If not, why not? Because the first can be done in ANSI C (or pre-ANSI C with ). Volume-Number: Volume 20, Number 145