Module Name: src
Committed By: njoly
Date: Sat May 17 09:30:07 UTC 2014
Modified Files:
src/sys/compat/linux32/common: linux32_fcntl.c
Log Message:
Fix fadvise64 syscalls. Unlike our, linux fadvise syscall do not
return error code; call do_posix_fadvise().
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_fcntl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux32/common/linux32_fcntl.c
diff -u src/sys/compat/linux32/common/linux32_fcntl.c:1.9 src/sys/compat/linux32/common/linux32_fcntl.c:1.10
--- src/sys/compat/linux32/common/linux32_fcntl.c:1.9 Mon May 30 17:50:32 2011
+++ src/sys/compat/linux32/common/linux32_fcntl.c Sat May 17 09:30:07 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_fcntl.c,v 1.9 2011/05/30 17:50:32 alnsn Exp $ */
+/* $NetBSD: linux32_fcntl.c,v 1.10 2014/05/17 09:30:07 njoly Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_fcntl.c,v 1.9 2011/05/30 17:50:32 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_fcntl.c,v 1.10 2014/05/17 09:30:07 njoly Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -151,20 +151,15 @@ linux32_sys_fadvise64(struct lwp *l,
{
/* {
syscallarg(int) fd;
- syscallarg(off_t) offset;
- syscallarg(size_t) len;
+ syscallarg(uint32_t) offlo;
+ syscallarg(uint32_t) offhi;
+ syscallarg(netbsd32_size_t) len;
syscallarg(int) advice;
} */
- struct sys___posix_fadvise50_args ua;
+ off_t off = ((off_t)SCARG(uap, offhi) << 32) + SCARG(uap, offlo);
- /* Linux doesn't have the 'pad' pseudo-parameter */
- NETBSD32TO64_UAP(fd);
- SCARG(&ua, PAD) = 0;
- SCARG(&ua, offset) = ((off_t)SCARG(uap, offhi) << 32) + SCARG(uap, offlo);
- SCARG(&ua, len) = SCARG(uap, len);
- SCARG(&ua, advice) = linux_to_bsd_posix_fadv(SCARG(uap, advice));
-
- return sys___posix_fadvise50(l, &ua, retval);
+ return do_posix_fadvise(SCARG(uap, fd), off,
+ SCARG(uap, len), linux_to_bsd_posix_fadv(SCARG(uap, advice)));
}
int
@@ -173,18 +168,15 @@ linux32_sys_fadvise64_64(struct lwp *l,
{
/* {
syscallarg(int) fd;
- syscallarg(off_t) offset;
- syscallarg(off_t) len;
+ syscallarg(uint32_t) offlo;
+ syscallarg(uint32_t) offhi;
+ syscallarg(uint32_t) lenlo;
+ syscallarg(uint32_t) lenhi;
syscallarg(int) advice;
} */
- struct sys___posix_fadvise50_args ua;
-
- /* Linux doesn't have the 'pad' pseudo-parameter */
- NETBSD32TO64_UAP(fd);
- SCARG(&ua, PAD) = 0;
- SCARG(&ua, offset) = ((off_t)SCARG(uap, offhi) << 32) + SCARG(uap, offlo);
- SCARG(&ua, len) = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo);
- SCARG(&ua, advice) = linux_to_bsd_posix_fadv(SCARG(uap, advice));
+ off_t off = ((off_t)SCARG(uap, offhi) << 32) + SCARG(uap, offlo);
+ off_t len = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo);
- return sys___posix_fadvise50(l, &ua, retval);
+ return do_posix_fadvise(SCARG(uap, fd), off,
+ len, linux_to_bsd_posix_fadv(SCARG(uap, advice)));
}