Skip to contentSkip to conversation

lutime() for changing times of a symbolic link

DISCUSSION Edmund GRIMLEY EVANS 1 participant 2 messages Jun 20, 2002 – Jun 25, 2002 VFS

lore
Share & tools
lore
#0 lore raw

With linux-2.4.18 it seems to be impossible to change the access and modification times of a symbolic link because utime() follows links. Is there any reason not to add an lutime() system call, analogously with chown and lchown?

Obviously it's not a burning issue, but it would enable tar xf to do its job properly and remove what looks like an anomaly.

Edmund

#1 lore raw

I asked:

Quoted 2 lines

Is there any reason not to add an lutime() system call, analogously with chown and lchown?

There were no replies, so here's a patch for it (i386 only). I also tried patching glibc and tar to make use of the new system call; see
http://rano.org/lutime/

A web search for lutime reveals that it is mentioned in passing in the IEEE/POSIX standard and apparently some systems out there actually have the function, but I don't know which.

Edmund

arch/i386/kernel/entry.S +1 -0
diff -ru linux-2.4.18/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
@@ -634,6 +634,7 @@
 	.long SYMBOL_NAME(sys_ni_syscall)	/* 235 reserved for removexattr */
 	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for lremovexattr */
 	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for fremovexattr */
+	.long SYMBOL_NAME(sys_lutime)
 
 	.rept NR_syscalls-(.-sys_call_table)/4
 		.long SYMBOL_NAME(sys_ni_syscall)
fs/open.c +66 -25

148 lines not on this page · raw message

include/asm-i386/unistd.h +1 -0
diff -ru linux-2.4.18/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h
@@ -242,6 +242,7 @@
 #define __NR_removexattr	235
 #define __NR_lremovexattr	236
 #define __NR_fremovexattr	237
+#define __NR_lutime		238
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */