Use PAIR32TO64() for the offset and length parameters to

freebsd32_posix_fallocate() to properly handle big-endian platforms.

Reviewed by:	mdf
MFC after:	1 week
This commit is contained in:
John Baldwin 2011-10-14 11:46:46 +00:00
parent 50af444a74
commit f940342426
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226364
2 changed files with 4 additions and 4 deletions

View File

@ -2831,7 +2831,7 @@ freebsd32_posix_fallocate(struct thread *td,
struct posix_fallocate_args ap;
ap.fd = uap->fd;
ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
ap.len = (uap->lenlo | ((off_t)uap->lenhi << 32));
ap.offset = PAIR32TO64(off_t, uap->offset);
ap.len = PAIR32TO64(off_t, uap->len);
return (sys_posix_fallocate(td, &ap));
}

View File

@ -989,6 +989,6 @@
size_t inbuflen, void *outbufp, \
size_t outbuflen); }
530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\
uint32_t offsetlo, uint32_t offsethi,\
uint32_t lenlo, uint32_t lenhi); }
uint32_t offset1, uint32_t offset2,\
uint32_t len1, uint32_t len2); }
531 AUE_NULL UNIMPL posix_fadvise