:i	static char d_execve_sccs_id[] = "%W% %G%";
:1#include "V.h"
/*
* Wrapper for the execve() system call.  Note that we close extraneous files.
* However, note especially that we leave the Vout stream open.  This has
* caused problems when the child process doesn't know to reopen Vout in
* response to a CONT signal.
*/
d_execve(name,argv,envv)
	char *name;
	char**argv;
	char**envv;
{	int  i, r;
:5	if (Vlvl > 4) {
:2		P2 "%s execve(\"%s\",%08X,%08X)",Vtime(),name,argv,envv D;
:5		dumpv(argv,"argv");
:5		dumpv(envv,"envv");
:5	}
:1	for (i=3; i<=openfilemax; i++)
:1		if (i != Fileno(Vout))
:1			Close(i);
	errno = 0;
	r = execve(name,argv,envv);
:6	V6 "execve()=%d	[Err %d=%s=%s]",r,Errinfo D;
	return r;
}
