6.3.1.1.4. NFS Protocol READ Interface Function
program NFS_PROGRAM {
  version NFS_VERSION {
    ...
    readres NFSPROC_READ (readargs) = 6;
    ...
  } = 2;
} = 100003;

struct readargs {
  nfs_fh file;            /* handle for file */
  unsigned offset;        /* byte offset in file */
  unsigned count;         /* immediate read count */
  unsigned totalcount;    /* total read count (from this offset)*/
};

union readres switch (nfsstat status) {
case NFS_OK:
  readokres reply;
default:
  void;
};

struct readokres {
  fattr attributes;       /* attributes */
  opaque data <NFS_MAXDATA>;
};

struct fattr {
  ftype type;             /* file type */
  unsigned mode;          /* protection mode bits */
  unsigned nlink;         /* number of hard links */
  unsigned uid;           /* owner user id */
  unsigned gid;           /* owner group id */
  unsigned size;          /* file size in bytes */
  unsigned blocksize;     /* preferred block size */
  unsigned rdev;          /* special device number */
  unsigned blocks;        /* used size in kilobytes */
  unsigned fsid;          /* device number */
  unsigned fileid;        /* inode number */
  nfstime atime;          /* time of last access */
  nfstime mtime;          /* time of last modification */
  nfstime ctime;          /* time of last change */
};

struct nfs_fh {
  opaque data [NFS_FHSIZE];
};

enum nfsstat {
  NFS_OK=0,               /* No error */
  NFSERR_PERM=1,          /* Not owner */
  NFSERR_NOENT=2,         /* No such file or directory */
  NFSERR_IO=5,            /* I/O error */
  NFSERR_NXIO=6,          /* No such device or address */
  NFSERR_ACCES=13,        /* Permission denied */
  NFSERR_EXIST=17,        /* File exists */
  NFSERR_NODEV=19,        /* No such device */
  NFSERR_NOTDIR=20,       /* Not a directory*/
  NFSERR_ISDIR=21,        /* Is a directory */
  NFSERR_FBIG=27,         /* File too large */
  NFSERR_NOSPC=28,        /* No space left on device */
  NFSERR_ROFS=30,         /* Read-only file system */
  NFSERR_NAMETOOLONG=63,  /* File name too long */
  NFSERR_NOTEMPTY=66,     /* Directory not empty */
  NFSERR_DQUOT=69,        /* Disc quota exceeded */
  NFSERR_STALE=70,        /* Stale NFS file handle */
  NFSERR_WFLUSH=99        /* Write cache flushed */
};