From 44e48973a5550699da2a01a42ef25cf03d708e80 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 4 Jan 2012 16:29:45 +0000 Subject: [PATCH 109/175] MFC 226364: Use PAIR32TO64() for the offset and length parameters to freebsd32_posix_fallocate() to properly handle big-endian platforms. git-svn-id: http://svn.freebsd.org/base/stable/9@229500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f (cherry picked from commit 0c4106bda0ea357feebe2946c3a76f67bc1e1952) Signed-off-by: Xin Li --- sys/compat/freebsd32/freebsd32_misc.c | 4 ++-- sys/compat/freebsd32/syscalls.master | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 6d28715..45c3578 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2811,7 +2811,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)); } diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index d4b67ae..25b7897 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -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 -- 1.7.9.4