64-bit VFS_LSEEK_OFF

Change-Id: Ic0b6d65cbde1033462b909436efa92464094f1ec
This commit is contained in:
Ben Gras 2014-02-24 17:16:17 +01:00 committed by Lionel Sambuc
parent ed9076ccb4
commit e6daf20a69
3 changed files with 6 additions and 9 deletions

View file

@ -293,8 +293,7 @@
/* Field names for the lseek(2) call. */
#define VFS_LSEEK_FD m2_i1 /* int */
#define VFS_LSEEK_OFF_LO m2_l1 /* off_t (low 32 bits) */
#define VFS_LSEEK_OFF_HI m2_l2 /* off_t (high 32 bits) */
#define VFS_LSEEK_OFF m2_ll1 /* off_t */
#define VFS_LSEEK_WHENCE m2_i2 /* int */
/* Field names for the truncate(2) and ftruncate(2) calls. */

View file

@ -17,9 +17,8 @@ lseek(int fd, off_t offset, int whence)
memset(&m, 0, sizeof(m));
m.VFS_LSEEK_FD = fd;
m.VFS_LSEEK_OFF_LO = ex64lo(offset);
m.VFS_LSEEK_OFF_HI = ex64hi(offset);
m.VFS_LSEEK_OFF = offset;
m.VFS_LSEEK_WHENCE = whence;
if (_syscall(VFS_PROC_NR, VFS_LSEEK, &m) < 0) return( (off_t) -1);
return( (off_t) make64(m.VFS_LSEEK_OFF_LO, m.VFS_LSEEK_OFF_HI));
return( (off_t) m.VFS_LSEEK_OFF);
}

View file

@ -647,13 +647,12 @@ int do_lseek(void)
int r;
if ((r = actual_lseek(fp, job_m_in.VFS_LSEEK_FD,
job_m_in.VFS_LSEEK_WHENCE, make64(job_m_in.VFS_LSEEK_OFF_LO,
job_m_in.VFS_LSEEK_OFF_HI), &newpos)) != OK)
job_m_in.VFS_LSEEK_WHENCE, job_m_in.VFS_LSEEK_OFF,
&newpos)) != OK)
return r;
/* insert the new position into the output message */
job_m_out.VFS_LSEEK_OFF_LO = ex64lo(newpos);
job_m_out.VFS_LSEEK_OFF_HI = ex64hi(newpos);
job_m_out.VFS_LSEEK_OFF = newpos;
return OK;
}