	static char D_open_sccs_id[] = "%W% %G%";
#include "V_s.h"
/*
* This is a distributed version of the Unix open() system call. Note that Dist.h
* defines  several  Open*()  macros for calling D_open(), mostly because the C
* preprocessor can't handle macros with variable numbers of parameters.
*/

int
D_open(name,flags,mode)
	char *name;
{	int   e, f, v;
	Fenter("D_open");
	V7s "open(\"%s\",%07lX,0%o)",name,flags,mode D;
	errno = 0;
	v = open(name,flags,mode);
	e = errno;
	V6s "open(\"%s\",%08lX,0%o)=%d [Err %d=%s=%s]",name,flags,mode,v,Errinfo D;
	if (v >= 0) {
		f = D_newfile(File_LOCAL,v,name,"open");
		Done;
	}
fail:
	errno = e;
	f = v;
done:
	Fexit;
	return f;
}
