Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux32/common Fix fadvise64 syscalls. Unlike our...



details:   https://anonhg.NetBSD.org/src/rev/14876689b164
branches:  trunk
changeset: 329266:14876689b164
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sat May 17 09:30:07 2014 +0000

description:
Fix fadvise64 syscalls. Unlike our, linux fadvise syscall do not
return error code; call do_posix_fadvise().

diffstat:

 sys/compat/linux32/common/linux32_fcntl.c |  40 ++++++++++++------------------
 1 files changed, 16 insertions(+), 24 deletions(-)

diffs (72 lines):

diff -r d940dfbac9d1 -r 14876689b164 sys/compat/linux32/common/linux32_fcntl.c
--- a/sys/compat/linux32/common/linux32_fcntl.c Sat May 17 09:25:06 2014 +0000
+++ b/sys/compat/linux32/common/linux32_fcntl.c Sat May 17 09:30:07 2014 +0000
@@ -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 @@
 {
        /* {
                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 @@
 {
        /* {
                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;
+       off_t off = ((off_t)SCARG(uap, offhi) << 32) + SCARG(uap, offlo);
+       off_t len = ((off_t)SCARG(uap, lenhi) << 32) + SCARG(uap, lenlo);
 
-       /* 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));
-
-       return sys___posix_fadvise50(l, &ua, retval);
+       return do_posix_fadvise(SCARG(uap, fd), off,
+           len, linux_to_bsd_posix_fadv(SCARG(uap, advice)));
 }



Home | Main Index | Thread Index | Old Index