:i	static char daReada_sccs_id[] = "%W% %G%";
:1#include "V_D_UC.h"
:1#include "V_s_lc.h"
:n	global int dbn_read = 0;	/* Read counter */

#ifdef USE_agent

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* CALL:
*   daRead(f,buf,n)
*   	int   f;
*   	char *buf;
*   	int   n;
*
* DESCRIPTION:
*
* This routine implements the DA version of read().  It sends a message
* to the server listing the file, offset and byte count, and waits
* around for the data.
*
* Success returns a byte count, as with the Posix read().  Failure gives
* -1 with an errno code.  Failure can occur for various reasons:
*
*
* AUTHOR: John Chambers.
*
* CHANGES:
*/
FCT daRead(f,buf,n)
	int   f;
	char *buf;
	int   n;
{	int   v;
	int   e;
:f	Fenter("daRead");
:5	V5D "Called." D;
	errno = 0;
:8	V7D "read(%d,%08lX,%d)",f,buf,n D;
	v = read(f,buf,n);
	e = errno;
:n	++dbn_read;
:5	V5D "read(%d,%08lX,%d)=%d [Err %d=%s=%s]",f,buf,n,v,Errinfo D;
	if (v > 0) {
:7		H7D(buf,v,"read");
		openfile[f].addr += v;	/* Keep track of the offset */
	}
fail:
:f	Fexit;
	errno = e;
	return v;
}

/*
* Check a File pointer for validity.
*/
daChkFp(fp)
	File* fp;
{
}
#endif /* USE_agent */
