{
int code = 0, lcode = 0, error = 0;
afs_int32 pad = 0, offset;
- int n, nbytes, howMany;
+ int n, nbytes, howMany, howBig;
byte *p;
struct stat status;
int size;
#endif
#ifdef AFS_NT40_ENV
- howMany = 4096; /* Page size */
+ howBig = _filelength(handleP->fd_fd);
+ howMany = 4096;
+
#else
fstat(handleP->fd_fd, &status);
+ howBig = status.st_size;
+
#ifdef AFS_AIX_ENV
/* Unfortunately in AIX valuable fields such as st_blksize are
* gone from the stat structure.
howMany = tstatfs.f_bsize;
#else
howMany = status.st_blksize;
-#endif
+#endif /* AFS_AIX_ENV */
#endif /* AFS_NT40_ENV */
+
size = FDH_SIZE(handleP);
code = DumpInt32(iodp, tag, size);
if (code) {
*/
memset(p+n, 0, howMany-n);
if (!pad)
- offset = (status.st_size - nbytes) + n;
+ offset = (howBig - nbytes) + n;
pad += (howMany-n);
/* Now seek over the data we could not get. An error here means we
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
StreamHandle_t *file;
- IHandle_t *handle;
FdHandle_t *fdP;
int size;
int flag;