
#include "V.h"
/*
* This is a debug wrapper around the Unix mknod() system call.
*
* If your system has the syscall() routine and the SYS_* symbols are  defined,
* then  we  will  use  them  to do the system call, and define our own mknod()
* routine, allowing the debug package  to  intercept  calls  of  mknod(f)  and
* generate debug output.
*/
#if defined(USE_syscall) && defined(SYS_mknod)
mknod(n,f,m) char *n; {return d_mknod(n,f,m);}
#endif

d_mknod(name,flags,mode)
	char *name;
{	int   v;
	int   e;

	errno = 0;
#if defined(USE_syscall) && defined(SYS_mknod)
	v = syscall(SYS_mknod,name,flags,mode);
#else
	v = mknod(name,flags,mode);
#endif
	e = errno;
	V6 "mknod(\"%s\",%08lX,0%o)=%d [Err %d=%s=%s]",name,flags,mode,v,Errinfo D;
	errno = e;
	return v;
}
