Module Name: src
Committed By: pooka
Date: Tue Jan 4 17:00:19 UTC 2011
Modified Files:
src/sys/rump/include/rump: rump_syscalls_compat.h
src/sys/rump/librump/rumpvfs: compat.c
Log Message:
Add NetBSD 5 compat wrapping for *utimes()
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/include/rump/rump_syscalls_compat.h
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpvfs/compat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/include/rump/rump_syscalls_compat.h
diff -u src/sys/rump/include/rump/rump_syscalls_compat.h:1.4 src/sys/rump/include/rump/rump_syscalls_compat.h:1.5
--- src/sys/rump/include/rump/rump_syscalls_compat.h:1.4 Mon Aug 30 10:08:39 2010
+++ src/sys/rump/include/rump/rump_syscalls_compat.h Tue Jan 4 17:00:19 2011
@@ -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
Index: src/sys/rump/librump/rumpvfs/compat.c
diff -u src/sys/rump/librump/rumpvfs/compat.c:1.7 src/sys/rump/librump/rumpvfs/compat.c:1.8
--- src/sys/rump/librump/rumpvfs/compat.c:1.7 Mon Aug 30 10:08:39 2010
+++ src/sys/rump/librump/rumpvfs/compat.c Tue Jan 4 17:00:19 2011
@@ -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