Source-Changes-HG archive

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

[src/trunk]: src/sys/rump Add NetBSD 5 compat wrapping for *utimes()



details:   https://anonhg.NetBSD.org/src/rev/d641b421519a
branches:  trunk
changeset: 760424:d641b421519a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Jan 04 17:00:19 2011 +0000

description:
Add NetBSD 5 compat wrapping for *utimes()

diffstat:

 sys/rump/include/rump/rump_syscalls_compat.h |   8 +++-
 sys/rump/librump/rumpvfs/compat.c            |  64 +++++++++++++++++++++++++++-
 2 files changed, 69 insertions(+), 3 deletions(-)

diffs (114 lines):

diff -r 8ddafa79d207 -r d641b421519a sys/rump/include/rump/rump_syscalls_compat.h
--- a/sys/rump/include/rump/rump_syscalls_compat.h      Tue Jan 04 16:53:05 2011 +0000
+++ b/sys/rump/include/rump/rump_syscalls_compat.h      Tue Jan 04 17:00:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_syscalls_compat.h,v 1.4 2010/08/30 10:08:39 pooka Exp $   */
+/*     $NetBSD: rump_syscalls_compat.h,v 1.5 2011/01/04 17:00:19 pooka Exp $   */
 
 /*-
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -45,6 +45,9 @@
 #define rump_sys_fstat(a,b) rump_sys_nb5_fstat(a,b)
 #define rump_sys_pollts(a,b,c,d) rump_sys_nb5_pollts(a,b,c,d)
 #define rump_sys_select(a,b,c,d,e) rump_sys_nb5_select(a,b,c,d,e)
+#define rump_sys_utimes(a,b) rump_sys_nb5_utimes(a,b)
+#define rump_sys_lutimes(a,b) rump_sys_nb5_lutimes(a,b)
+#define rump_sys_futimes(a,b) rump_sys_nb5_futimes(a,b)
 #endif /* __NetBSD_Prereq */
 #endif /* __NetBSD__ */
 #endif /* _KERNEL */
@@ -62,6 +65,9 @@
 int rump_sys_nb5_pollts(struct pollfd *, size_t,
                        const struct timespec *, const void *);
 int rump_sys_nb5_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+int rump_sys_nb5_utimes(const char *, const struct timeval *);
+int rump_sys_nb5_lutimes(const char *, const struct timeval *);
+int rump_sys_nb5_futimes(int, const struct timeval *);
 
 #ifdef _END_DECLS
 _END_DECLS
diff -r 8ddafa79d207 -r d641b421519a sys/rump/librump/rumpvfs/compat.c
--- a/sys/rump/librump/rumpvfs/compat.c Tue Jan 04 16:53:05 2011 +0000
+++ b/sys/rump/librump/rumpvfs/compat.c Tue Jan 04 17:00:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.7 2010/08/30 10:08:39 pooka Exp $ */
+/*     $NetBSD: compat.c,v 1.8 2011/01/04 17:00:19 pooka Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat.c,v 1.7 2010/08/30 10:08:39 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat.c,v 1.8 2011/01/04 17:00:19 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -140,6 +140,66 @@
        return retval;
 }
 
+int
+rump_sys_nb5_utimes(const char *path, const struct timeval times[2])
+{
+       struct compat_50_sys_utimes_args args;
+       register_t retval = 0;
+       int error = 0;
+
+       SPARG(&args, path) = path;
+       SPARG(&args, tptr) = (const struct timeval50 *)times;
+
+       rump_schedule();
+       error = compat_50_sys_utimes(curlwp, &args, &retval);
+       if (error) {
+               retval = -1;
+               rumpuser_seterrno(error);
+       }
+       rump_unschedule();
+       return retval;
+}
+
+int
+rump_sys_nb5_lutimes(const char *path, const struct timeval times[2])
+{
+       struct compat_50_sys_lutimes_args args;
+       register_t retval = 0;
+       int error = 0;
+
+       SPARG(&args, path) = path;
+       SPARG(&args, tptr) = (const struct timeval50 *)times;
+
+       rump_schedule();
+       error = compat_50_sys_lutimes(curlwp, &args, &retval);
+       if (error) {
+               retval = -1;
+               rumpuser_seterrno(error);
+       }
+       rump_unschedule();
+       return retval;
+}
+
+int
+rump_sys_nb5_futimes(int fd, const struct timeval times[2])
+{
+       struct compat_50_sys_futimes_args args;
+       register_t retval = 0;
+       int error = 0;
+
+       SPARG(&args, fd) = fd;
+       SPARG(&args, tptr) = (const struct timeval50 *)times;
+
+       rump_schedule();
+       error = compat_50_sys_futimes(curlwp, &args, &retval);
+       if (error) {
+               retval = -1;
+               rumpuser_seterrno(error);
+       }
+       rump_unschedule();
+       return retval;
+}
+
 /*
  * XXX: types.  But I don't want to start playing compat games in
  * the userspace namespace too



Home | Main Index | Thread Index | Old Index