Module Name: src Committed By: pooka Date: Mon Apr 8 20:54:49 UTC 2013
Modified Files: src/sys/compat/linux/arch/amd64: syscalls.master src/sys/compat/linux/arch/arm: syscalls.master src/sys/compat/linux/arch/i386: syscalls.master src/sys/compat/linux/arch/m68k: syscalls.master src/sys/compat/linux/arch/mips: syscalls.master src/sys/compat/linux/arch/powerpc: syscalls.master src/sys/compat/linux/common: linux_misc.c src/sys/rump/kern/lib/libsys_linux: syscalls.master Log Message: support utimes on non-alpha linux platforms To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/compat/linux/arch/amd64/syscalls.master cvs rdiff -u -r1.49 -r1.50 src/sys/compat/linux/arch/arm/syscalls.master cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/i386/syscalls.master cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/m68k/syscalls.master cvs rdiff -u -r1.44 -r1.45 src/sys/compat/linux/arch/mips/syscalls.master cvs rdiff -u -r1.51 -r1.52 src/sys/compat/linux/arch/powerpc/syscalls.master cvs rdiff -u -r1.220 -r1.221 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.3 -r1.4 src/sys/rump/kern/lib/libsys_linux/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/linux/arch/amd64/syscalls.master diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.41 src/sys/compat/linux/arch/amd64/syscalls.master:1.42 --- src/sys/compat/linux/arch/amd64/syscalls.master:1.41 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/amd64/syscalls.master Mon Apr 8 20:54:47 2013 @@ -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 Index: src/sys/compat/linux/arch/arm/syscalls.master diff -u src/sys/compat/linux/arch/arm/syscalls.master:1.49 src/sys/compat/linux/arch/arm/syscalls.master:1.50 --- src/sys/compat/linux/arch/arm/syscalls.master:1.49 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/arm/syscalls.master Mon Apr 8 20:54:48 2013 @@ -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 Index: src/sys/compat/linux/arch/i386/syscalls.master diff -u src/sys/compat/linux/arch/i386/syscalls.master:1.108 src/sys/compat/linux/arch/i386/syscalls.master:1.109 --- src/sys/compat/linux/arch/i386/syscalls.master:1.108 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/i386/syscalls.master Mon Apr 8 20:54:48 2013 @@ -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 Index: src/sys/compat/linux/arch/m68k/syscalls.master diff -u src/sys/compat/linux/arch/m68k/syscalls.master:1.74 src/sys/compat/linux/arch/m68k/syscalls.master:1.75 --- src/sys/compat/linux/arch/m68k/syscalls.master:1.74 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/m68k/syscalls.master Mon Apr 8 20:54:48 2013 @@ -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 Index: src/sys/compat/linux/arch/mips/syscalls.master diff -u src/sys/compat/linux/arch/mips/syscalls.master:1.44 src/sys/compat/linux/arch/mips/syscalls.master:1.45 --- src/sys/compat/linux/arch/mips/syscalls.master:1.44 Wed Sep 19 21:19:15 2012 +++ src/sys/compat/linux/arch/mips/syscalls.master Mon Apr 8 20:54:48 2013 @@ -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 Index: src/sys/compat/linux/arch/powerpc/syscalls.master diff -u src/sys/compat/linux/arch/powerpc/syscalls.master:1.51 src/sys/compat/linux/arch/powerpc/syscalls.master:1.52 --- src/sys/compat/linux/arch/powerpc/syscalls.master:1.51 Wed Sep 19 21:19:15 2012 +++ src/sys/compat/linux/arch/powerpc/syscalls.master Mon Apr 8 20:54:49 2013 @@ -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, \ Index: src/sys/compat/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.220 src/sys/compat/linux/common/linux_misc.c:1.221 --- src/sys/compat/linux/common/linux_misc.c:1.220 Wed Sep 19 21:19:15 2012 +++ src/sys/compat/linux/common/linux_misc.c Mon Apr 8 20:54:49 2013 @@ -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 @@ linux_sys_getpriority(struct lwp *l, con 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), <v, 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), <v, 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); +} Index: src/sys/rump/kern/lib/libsys_linux/syscalls.master diff -u src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.3 src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.4 --- src/sys/rump/kern/lib/libsys_linux/syscalls.master:1.3 Mon Mar 4 19:12:56 2013 +++ src/sys/rump/kern/lib/libsys_linux/syscalls.master Mon Apr 8 20:54:47 2013 @@ -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