From: Alexey Dobriyan <adobriyan@openvz.org>
To: akpm@osdl.org
Cc: devel@openvz.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] lutimesat: actual syscall and wire-up on i386
Date: Fri, 26 Jan 2007 14:23:45 +0300 [thread overview]
Message-ID: <20070126112345.GC11128@localhost.sw.ru> (raw)
lutimesat(2) does everything futimesat(2) does except it doesn't follow
symlinks.
It could be used by tar(1) and cp(1).
FreeBSD and NetBSD have lutimes(2) which can be emulated by C library:
lutimesat(AT_FDCWD, filename, utimes)
Closes http://bugme.osdl.org/show_bug.cgi?id=4433
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
---
arch/i386/kernel/syscall_table.S | 1 +
fs/utimes.c | 9 +++++++++
include/asm-i386/unistd.h | 3 ++-
3 files changed, 12 insertions(+), 1 deletion(-)
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -319,3 +319,4 @@ ENTRY(sys_call_table)
.long sys_move_pages
.long sys_getcpu
.long sys_epoll_pwait
+ .long sys_lutimesat /* 320 */
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -105,3 +105,12 @@ asmlinkage long sys_utimes(char __user *
{
return sys_futimesat(AT_FDCWD, filename, utimes);
}
+
+asmlinkage long sys_lutimesat(int dfd, char __user *filename, struct timeval __user *utimes)
+{
+ struct timeval times[2];
+
+ if (utimes && copy_from_user(×, utimes, sizeof(times)))
+ return -EFAULT;
+ return do_utimes(dfd, filename, utimes ? times : NULL, AT_SYMLINK_NOFOLLOW);
+}
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -325,10 +325,11 @@ #define __NR_vmsplice 316
#define __NR_move_pages 317
#define __NR_getcpu 318
#define __NR_epoll_pwait 319
+#define __NR_lutimesat 320
#ifdef __KERNEL__
-#define NR_syscalls 320
+#define NR_syscalls 321
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
next reply other threads:[~2007-01-26 11:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-26 11:23 Alexey Dobriyan [this message]
2007-01-26 20:39 ` [PATCH 3/3] lutimesat: actual syscall and wire-up on i386 Andrew Morton
2007-01-26 20:45 ` Ulrich Drepper
2007-01-29 11:05 ` Alexey Dobriyan
2007-01-29 15:07 ` Ulrich Drepper
2007-01-29 16:02 ` Alexey Dobriyan
2007-01-28 7:59 ` H. Peter Anvin
2007-01-29 9:58 ` Alexey Dobriyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070126112345.GC11128@localhost.sw.ru \
--to=adobriyan@openvz.org \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox