Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux Add struct linux_stat64 definition for alph...



details:   https://anonhg.NetBSD.org/src/rev/55e6f80bfaa1
branches:  trunk
changeset: 325498:55e6f80bfaa1
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri Dec 27 14:17:11 2013 +0000

description:
Add struct linux_stat64 definition for alpha, and enable syscalls that
use it.

diffstat:

 sys/compat/linux/arch/alpha/linux_types.h   |  28 +++++++++++++++++++++++++++-
 sys/compat/linux/arch/alpha/syscalls.master |  13 ++++++++-----
 sys/compat/linux/common/linux_file64.c      |   9 ++++-----
 3 files changed, 39 insertions(+), 11 deletions(-)

diffs (118 lines):

diff -r 2b9332788835 -r 55e6f80bfaa1 sys/compat/linux/arch/alpha/linux_types.h
--- a/sys/compat/linux/arch/alpha/linux_types.h Fri Dec 27 12:16:01 2013 +0000
+++ b/sys/compat/linux/arch/alpha/linux_types.h Fri Dec 27 14:17:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_types.h,v 1.6 2009/01/11 02:45:48 christos Exp $ */
+/*     $NetBSD: linux_types.h,v 1.7 2013/12/27 14:17:11 njoly Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,4 +67,30 @@
        unsigned int            lst_gen;        /* unused */
 };
 
+/* The stat64 structure increases the size of dev_t, blkcnt_t, adds
+   nanosecond resolution times, and padding for expansion.  */
+#define        LINUX_STAT64_HAS_NSEC   1
+struct linux_stat64 {
+       unsigned long           lst_dev;
+       unsigned long           lst_ino;
+       unsigned long           lst_rdev;
+       long                    lst_size;
+       unsigned long           lst_blocks;
+
+       unsigned int            lst_mode;
+       unsigned int            lst_uid;
+       unsigned int            lst_gid;
+       unsigned int            lst_blksize;
+       unsigned int            lst_nlink;
+       unsigned int            __pad0;
+
+       unsigned long           lst_atime;
+       unsigned long           lst_atime_nsec; 
+       unsigned long           lst_mtime;
+       unsigned long           lst_mtime_nsec;
+       unsigned long           lst_ctime;
+       unsigned long           lst_ctime_nsec;
+       long                    __pad1[3];
+};
+
 #endif /* !_ALPHA_LINUX_TYPES_H */
diff -r 2b9332788835 -r 55e6f80bfaa1 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master       Fri Dec 27 12:16:01 2013 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master       Fri Dec 27 14:17:11 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.81 2013/12/08 15:55:10 njoly Exp $
+       $NetBSD: syscalls.master,v 1.82 2013/12/27 14:17:11 njoly Exp $
 ;
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -675,9 +675,12 @@
                            struct linux_timespec *rmtp); }
 423    UNIMPL          semtimedop
 424    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-425    UNIMPL          stat64
-426    UNIMPL          lstat64
-427    UNIMPL          fstat64
+425    STD             { int|linux_sys||stat64(const char *path, \
+                           struct linux_stat64 *sp); }
+426    STD             { int|linux_sys||lstat64(const char *path, \
+                           struct linux_stat64 *sp); }
+427    STD             { int|linux_sys||fstat64(int fd, \
+                           struct linux_stat64 *sp); }
 428    UNIMPL          vserver
 429    UNIMPL          mbind
 430    UNIMPL          get_mempolicy
@@ -709,7 +712,7 @@
 453    STD             { int|linux_sys||fchownat(int fd, const char *path, \
                            uid_t owner, gid_t group, int flag); }
 454    UNIMPL          futimesat
-455    UNIMPL          { int|linux_sys||fstatat64(int fd, const char *path, \
+455    STD             { int|linux_sys||fstatat64(int fd, const char *path, \
                            struct linux_stat64 *sp, int flag); }
 456    STD             { int|linux_sys||unlinkat(int fd, const char *path, \
                            int flag); }
diff -r 2b9332788835 -r 55e6f80bfaa1 sys/compat/linux/common/linux_file64.c
--- a/sys/compat/linux/common/linux_file64.c    Fri Dec 27 12:16:01 2013 +0000
+++ b/sys/compat/linux/common/linux_file64.c    Fri Dec 27 14:17:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_file64.c,v 1.54 2013/11/18 01:32:52 chs Exp $    */
+/*     $NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $  */
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.54 2013/11/18 01:32:52 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.55 2013/12/27 14:17:11 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,8 +67,6 @@
 
 #include <compat/linux/linux_syscallargs.h>
 
-#ifndef alpha
-
 static void bsd_to_linux_stat(struct stat *, struct linux_stat64 *);
 
 /*
@@ -197,6 +195,7 @@
        return copyout(&tmplst, SCARG(uap, sp), sizeof tmplst);
 }
 
+#ifndef __alpha__
 int
 linux_sys_truncate64(struct lwp *l, const struct linux_sys_truncate64_args *uap, register_t *retval)
 {
@@ -230,7 +229,7 @@
 
        return sys_ftruncate(l, &ta, retval);
 }
-#endif /* !alpha */
+#endif /* __alpha__ */
 
 /*
  * Linux 'readdir' call. This code is mostly taken from the



Home | Main Index | Thread Index | Old Index