Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Move *at syscall handlers to netbsd32_fs...



details:   https://anonhg.NetBSD.org/src/rev/ff4c2d2fb9ce
branches:  trunk
changeset: 788702:ff4c2d2fb9ce
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jul 18 13:43:32 2013 +0000

description:
Move *at syscall handlers to netbsd32_fs.c from netbsd32_netbsd.c
Fix netbsd32_fstatat to emit a 32bit stat structure.

diffstat:

 sys/compat/netbsd32/netbsd32_fs.c     |  304 +++++++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_netbsd.c |  296 +--------------------------------
 2 files changed, 304 insertions(+), 296 deletions(-)

diffs (truncated from 639 to 300 lines):

diff -r f8a573af1561 -r ff4c2d2fb9ce sys/compat/netbsd32/netbsd32_fs.c
--- a/sys/compat/netbsd32/netbsd32_fs.c Thu Jul 18 13:41:08 2013 +0000
+++ b/sys/compat/netbsd32/netbsd32_fs.c Thu Jul 18 13:43:32 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_fs.c,v 1.64 2012/12/13 15:16:57 matt Exp $    */
+/*     $NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $    */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.64 2012/12/13 15:16:57 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.65 2013/07/18 13:43:32 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -972,3 +972,303 @@
        }
        return error;
 }
+
+int
+netbsd32_linkat(struct lwp *l, const struct netbsd32_linkat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd1;
+               syscallarg(const netbsd32_charp) name1;
+               syscallarg(int) fd2;
+               syscallarg(const netbsd32_charp) name2;
+               syscallarg(int) flags;
+       } */
+       struct sys_linkat_args ua;
+
+       NETBSD32TO64_UAP(fd1);
+       NETBSD32TOP_UAP(name1, const char);
+       NETBSD32TO64_UAP(fd2);
+       NETBSD32TOP_UAP(name2, const char);
+       NETBSD32TO64_UAP(flags);
+
+       return sys_linkat(l, &ua, retval);
+}
+
+int
+netbsd32_renameat(struct lwp *l, const struct netbsd32_renameat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fromfd;
+               syscallarg(const netbsd32_charp) from;
+               syscallarg(int) tofd;
+               syscallarg(const netbsd32_charp) to;
+       } */
+       struct sys_renameat_args ua;
+
+       NETBSD32TO64_UAP(fromfd);
+       NETBSD32TOP_UAP(from, const char);
+       NETBSD32TO64_UAP(tofd);
+       NETBSD32TOP_UAP(to, const char);
+
+       return sys_renameat(l, &ua, retval);
+}
+
+int
+netbsd32_mkfifoat(struct lwp *l, const struct netbsd32_mkfifoat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(const netbsd32_charp) path;
+               syscallarg(mode_t) mode;
+       } */
+       struct sys_mkfifoat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(mode);
+
+       return sys_mkfifoat(l, &ua, retval);
+}
+
+int
+netbsd32_mknodat(struct lwp *l, const struct netbsd32_mknodat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(mode_t) mode;
+               syscallarg(uint32_t) dev;
+       } */
+       struct sys_mknodat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(mode);
+       NETBSD32TO64_UAP(dev);
+
+       return sys_mknodat(l, &ua, retval);
+}
+
+int
+netbsd32_mkdirat(struct lwp *l, const struct netbsd32_mkdirat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(mode_t) mode;
+       } */
+       struct sys_mkdirat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(mode);
+
+       return sys_mkdirat(l, &ua, retval);
+}
+
+int
+netbsd32_faccessat(struct lwp *l, const struct netbsd32_faccessat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(int) amode;
+               syscallarg(int) flag;
+       } */
+       struct sys_faccessat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(amode);
+       NETBSD32TO64_UAP(flag);
+
+       return sys_faccessat(l, &ua, retval);
+}
+
+int
+netbsd32_fchmodat(struct lwp *l, const struct netbsd32_fchmodat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(mode_t) mode;
+               syscallarg(int) flag;
+       } */
+       struct sys_fchmodat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(mode);
+       NETBSD32TO64_UAP(flag);
+
+       return sys_fchmodat(l, &ua, retval);
+}
+
+int
+netbsd32_fchownat(struct lwp *l, const struct netbsd32_fchownat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(uid_t) owner;
+               syscallarg(gid_t) group;
+               syscallarg(int) flag;
+       } */
+       struct sys_fchownat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(owner);
+       NETBSD32TO64_UAP(group);
+       NETBSD32TO64_UAP(flag);
+
+       return sys_fchownat(l, &ua, retval);
+}
+
+int
+netbsd32_fstatat(struct lwp *l, const struct netbsd32_fstatat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(netbsd32_statp_t) buf;
+               syscallarg(int) flag;
+       } */
+       struct netbsd32_stat sb32;
+       struct stat sb;
+       unsigned int nd_flag;
+       int error;
+
+       if (SCARG(uap, flag) & AT_SYMLINK_NOFOLLOW)
+               nd_flag = NOFOLLOW;
+       else
+               nd_flag = FOLLOW;
+
+       error = do_sys_statat(l, SCARG(uap, fd), SCARG_P32(uap, path),
+           nd_flag, &sb);
+       if (error)
+               return error;
+       netbsd32_from_stat(&sb, &sb32);
+       return copyout(&sb32, SCARG_P32(uap, buf), sizeof(sb32));
+}
+
+int
+netbsd32_utimensat(struct lwp *l, const struct netbsd32_utimensat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(netbsd32_timespecp_t) tptr;
+               syscallarg(int) flag;
+       } */
+       struct sys_utimensat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TOP_UAP(tptr, const struct timespec);
+       NETBSD32TO64_UAP(flag);
+
+       return sys_utimensat(l, &ua, retval);
+}
+
+int
+netbsd32_openat(struct lwp *l, const struct netbsd32_openat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(int) oflags;
+               syscallarg(mode_t) mode;
+       } */
+       struct sys_openat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(oflags);
+       NETBSD32TO64_UAP(mode);
+
+       return sys_openat(l, &ua, retval);
+}
+
+int
+netbsd32_readlinkat(struct lwp *l, const struct netbsd32_readlinkat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(netbsd32_charp) buf;
+               syscallarg(netbsd32_size_t) bufsize;
+       } */
+       struct sys_readlinkat_args ua;
+
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path, const char *);
+       NETBSD32TOP_UAP(buf, char *);
+       NETBSD32TOX_UAP(bufsize, size_t);
+
+       return sys_readlinkat(l, &ua, retval);
+}
+
+int
+netbsd32_symlinkat(struct lwp *l, const struct netbsd32_symlinkat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(netbsd32_charp) path1;
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path2;
+       } */
+       struct sys_symlinkat_args ua;
+
+       NETBSD32TOP_UAP(path1, const char *);
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(path2, const char *);
+
+       return sys_symlinkat(l, &ua, retval);
+}
+
+int
+netbsd32_unlinkat(struct lwp *l, const struct netbsd32_unlinkat_args *uap,
+                register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(netbsd32_charp) path;
+               syscallarg(int) flag;
+       } */
+       struct sys_unlinkat_args ua;
+



Home | Main Index | Thread Index | Old Index