lutime() for changing times of a symbolic link
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
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
@@ -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
@@ -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> */