Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Implement posix_fallocate and fdiscard c...



details:   https://anonhg.NetBSD.org/src/rev/a2a2aa1db3e7
branches:  trunk
changeset: 338906:a2a2aa1db3e7
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jun 16 10:42:38 2015 +0000

description:
Implement posix_fallocate and fdiscard compat

diffstat:

 sys/compat/netbsd32/netbsd32_netbsd.c |  42 +++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 2 deletions(-)

diffs (63 lines):

diff -r ddf074f79f69 -r a2a2aa1db3e7 sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c     Tue Jun 16 10:42:13 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c     Tue Jun 16 10:42:38 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_netbsd.c,v 1.194 2015/06/16 07:29:46 matt Exp $       */
+/*     $NetBSD: netbsd32_netbsd.c,v 1.195 2015/06/16 10:42:38 martin Exp $     */
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.194 2015/06/16 07:29:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.195 2015/06/16 10:42:38 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -2762,6 +2762,44 @@
        return sys_paccept(l, &ua, retval);
 }
 
+int
+netbsd32_fdiscard(struct lwp *l, const struct netbsd32_fdiscard_args *uap,
+       register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_off_t) pos;
+               syscallarg(netbsd32_off_t) len;
+       } */
+       struct sys_fdiscard_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TO64_UAP(pos);
+       NETBSD32TO64_UAP(len);
+
+       return sys_fdiscard(l, &ua, retval);
+}
+
+int
+netbsd32_posix_fallocate(struct lwp *l, const struct netbsd32_posix_fallocate_args *uap,
+       register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_off_t) pos;
+               syscallarg(netbsd32_off_t) len;
+       } */
+       struct sys_posix_fallocate_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TO64_UAP(pos);
+       NETBSD32TO64_UAP(len);
+
+       return sys_posix_fallocate(l, &ua, retval);
+}
+
+
+
 /*
  * MI indirect system call support.
  * Only used if the MD netbsd32_syscall.c doesn't intercept the calls.



Home | Main Index | Thread Index | Old Index