PERFORCE change 200163 for review

John Baldwin jhb at FreeBSD.org
Thu Oct 13 18:25:07 UTC 2011


http://p4web.freebsd.org/@@200163?ac=10

Change 200163 by jhb at jhb_jhbbsd on 2011/10/13 18:24:01

	Fix the off_t handling in fallocate() and fadvise() to be
	big-endian friendly.

Affected files ...

.. //depot/projects/fadvise/sys/compat/freebsd32/freebsd32_misc.c#3 edit
.. //depot/projects/fadvise/sys/compat/freebsd32/syscalls.master#3 edit

Differences ...

==== //depot/projects/fadvise/sys/compat/freebsd32/freebsd32_misc.c#3 (text+ko) ====

@@ -2811,8 +2811,8 @@
 	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));
 }
 
@@ -2822,8 +2822,8 @@
 	struct fadvise_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);
 	ap.advice = uap->advice;
 	return (sys_fadvise(td, &ap));
 }

==== //depot/projects/fadvise/sys/compat/freebsd32/syscalls.master#3 (text+ko) ====

@@ -989,9 +989,9 @@
 				    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	STD	{ int freebsd32_fadvise(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, \
 				    int advice); }


More information about the p4-projects mailing list