Source-Changes-HG archive

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

[src/trunk]: src/sys support utimes on non-alpha linux platforms



details:   https://anonhg.NetBSD.org/src/rev/73cc1522456b
branches:  trunk
changeset: 785979:73cc1522456b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Apr 08 20:54:47 2013 +0000

description:
support utimes on non-alpha linux platforms

diffstat:

 sys/compat/linux/arch/amd64/syscalls.master    |   4 +-
 sys/compat/linux/arch/arm/syscalls.master      |   4 +-
 sys/compat/linux/arch/i386/syscalls.master     |   4 +-
 sys/compat/linux/arch/m68k/syscalls.master     |   4 +-
 sys/compat/linux/arch/mips/syscalls.master     |   4 +-
 sys/compat/linux/arch/powerpc/syscalls.master  |   4 +-
 sys/compat/linux/common/linux_misc.c           |  61 +++++++++++++++++++++++++-
 sys/rump/kern/lib/libsys_linux/syscalls.master |   8 ++-
 8 files changed, 76 insertions(+), 17 deletions(-)

diffs (212 lines):

diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/amd64/syscalls.master
--- a/sys/compat/linux/arch/amd64/syscalls.master       Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/amd64/syscalls.master       Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.41 2012/09/19 21:19:14 pooka Exp $
+       $NetBSD: syscalls.master,v 1.42 2013/04/08 20:54:47 pooka Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -440,7 +440,7 @@
 232    UNIMPL          epoll_wait
 233    UNIMPL          epoll_ctl
 234    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-235    UNIMPL          utimes
+235    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 236    UNIMPL          vserver
 237    UNIMPL          mbind
 238    UNIMPL          set_mempolicy
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/arm/syscalls.master
--- a/sys/compat/linux/arch/arm/syscalls.master Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/arm/syscalls.master Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.49 2012/09/19 21:19:14 pooka Exp $
+       $NetBSD: syscalls.master,v 1.50 2013/04/08 20:54:48 pooka Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -449,7 +449,7 @@
 267    STD             { int|linux_sys||fstatfs64(int fd, \
                            size_t sz, struct linux_statfs64 *sp); }
 268    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-269    UNIMPL          utimes
+269    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 270    STD             { int|linux_sys||fadvise64_64(int fd, \
                            linux_off_t offset, linux_off_t len, int advice); }
 271    UNIMPL          pciconfig_iobase
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/i386/syscalls.master
--- a/sys/compat/linux/arch/i386/syscalls.master        Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/i386/syscalls.master        Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.108 2012/09/19 21:19:14 pooka Exp $
+       $NetBSD: syscalls.master,v 1.109 2013/04/08 20:54:48 pooka Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -451,7 +451,7 @@
 269    STD             { int|linux_sys||fstatfs64(int fd, \
                            size_t sz, struct linux_statfs64 *sp); }
 270    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-271    UNIMPL          utimes
+271    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 272    STD             { int|linux_sys||fadvise64_64(int fd, \
                            linux_off_t offset, linux_off_t len, int advice); }
 273    UNIMPL          vserver
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/m68k/syscalls.master
--- a/sys/compat/linux/arch/m68k/syscalls.master        Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/m68k/syscalls.master        Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.74 2012/09/19 21:19:14 pooka Exp $
+       $NetBSD: syscalls.master,v 1.75 2013/04/08 20:54:48 pooka Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -461,7 +461,7 @@
 264    STD             { int|linux_sys||fstatfs64(int fd, \
                            size_t sz, struct linux_statfs64 *sp); }
 265    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-266    UNIMPL          utimes
+266    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 267    STD             { int|linux_sys||fadvise64_64(int fd, \
                            linux_off_t offset, linux_off_t len, int advice); }
 268    UNIMPL          mbind
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/mips/syscalls.master
--- a/sys/compat/linux/arch/mips/syscalls.master        Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/mips/syscalls.master        Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.44 2012/09/19 21:19:15 pooka Exp $  
+       $NetBSD: syscalls.master,v 1.45 2013/04/08 20:54:48 pooka Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -452,7 +452,7 @@
                            int flags, struct linux_timespec *rqtp, \
                            struct linux_timespec *rmtp); }
 266    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-267    UNIMPL          utimes
+267    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 268    UNIMPL          mbind
 269    UNIMPL          get_mempolicy
 270    UNIMPL          set_mempolicy
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/arch/powerpc/syscalls.master
--- a/sys/compat/linux/arch/powerpc/syscalls.master     Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/arch/powerpc/syscalls.master     Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.51 2012/09/19 21:19:15 pooka Exp $  
+       $NetBSD: syscalls.master,v 1.52 2013/04/08 20:54:49 pooka Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -443,7 +443,7 @@
                            struct linux_timespec *rmtp); }
 249    UNIMPL          swapcontext
 250    STD             { int|linux_sys||tgkill(int tgid, int tid, int sig); }
-251    UNIMPL          utimes
+251    STD             { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
 252    STD             { int|linux_sys||statfs64(const char *path, \
                            size_t sz, struct linux_statfs64 *sp); }
 253    STD             { int|linux_sys||fstatfs64(int fd, \
diff -r 680ce833ad19 -r 73cc1522456b sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.220 2012/09/19 21:19:15 pooka Exp $   */
+/*     $NetBSD: linux_misc.c,v 1.221 2013/04/08 20:54:49 pooka Exp $   */
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.220 2012/09/19 21:19:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.221 2013/04/08 20:54:49 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1379,3 +1379,60 @@
         return 0;
 }
 #endif /* !COMPAT_LINUX32 */
+
+int
+linux_sys_utimes(struct lwp *l, const struct linux_sys_utimes_args *uap, register_t *retval)
+{
+       /* {
+               syscallarg(const char *) path;
+               syscallarg(const struct linux_timeval) *times;
+       } */
+       struct linux_timeval ltv[2];
+       struct timeval tv[2];
+       struct timeval *tptr = NULL;
+       int error;
+
+       if (SCARG(uap, times)) {
+               if ((error = copyin(SCARG(uap, times), &ltv, sizeof(ltv))))
+                       return error;
+
+               tv[0].tv_sec = ltv[0].tv_sec;
+               tv[0].tv_usec = ltv[0].tv_usec;
+               tv[1].tv_sec = ltv[1].tv_sec;
+               tv[1].tv_usec = ltv[1].tv_usec;
+
+               tptr = tv;
+       }
+
+       return do_sys_utimes(l, NULL, SCARG(uap, path), FOLLOW,
+           tptr, UIO_SYSSPACE);
+}
+
+int linux_sys_lutimes(struct lwp *, const struct linux_sys_utimes_args *, register_t *);
+int
+linux_sys_lutimes(struct lwp *l, const struct linux_sys_utimes_args *uap, register_t *retval)
+{
+       /* {
+               syscallarg(const char *) path;
+               syscallarg(const struct linux_timeval) *times;
+       } */
+       struct linux_timeval ltv[2];
+       struct timeval tv[2];
+       struct timeval *tptr = NULL;
+       int error;
+
+       if (SCARG(uap, times)) {
+               if ((error = copyin(SCARG(uap, times), &ltv, sizeof(ltv))))
+                       return error;
+
+               tv[0].tv_sec = ltv[0].tv_sec;
+               tv[0].tv_usec = ltv[0].tv_usec;
+               tv[1].tv_sec = ltv[1].tv_sec;
+               tv[1].tv_usec = ltv[1].tv_usec;
+
+               tptr = tv;
+       }
+
+       return do_sys_utimes(l, NULL, SCARG(uap, path), NOFOLLOW,
+           tptr, UIO_SYSSPACE);
+}
diff -r 680ce833ad19 -r 73cc1522456b sys/rump/kern/lib/libsys_linux/syscalls.master
--- a/sys/rump/kern/lib/libsys_linux/syscalls.master    Mon Apr 08 20:08:05 2013 +0000
+++ b/sys/rump/kern/lib/libsys_linux/syscalls.master    Mon Apr 08 20:54:47 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.3 2013/03/04 19:12:56 stacktic Exp $
+       $NetBSD: syscalls.master,v 1.4 2013/04/08 20:54:47 pooka Exp $
 
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
 
@@ -538,11 +538,13 @@
                            struct timeval50 *tv); }
 418    UNIMPL          gettimeofday
 419    UNIMPL          settimeofday
-420    UNIMPL          utimes
+420    NODEF           { int|linux_sys||utimes(const char *path, \
+                           struct linux_timeval *tv); }
 421    UNIMPL          adjtime
 422    UNIMPL          lfs_segwait
 423    UNIMPL          futimes
-424    UNIMPL          lutimes
+424    NODEF           { int|linux_sys||lutimes(const char *path, \
+                           struct linux_timeval *tv); }
 425    UNIMPL          setitimer
 426    UNIMPL          getitimer
 427    UNIMPL          clock_gettime



Home | Main Index | Thread Index | Old Index