utimes() does not work?

Denys Vlasenko vda.linux at googlemail.com
Sun Nov 29 18:32:34 UTC 2009


Hi Bernhard,

I was working on a tar bug, and I see that on tar xf ...,
utimes() syscall does not work:

chown32("test3/file3", 0, 0)            = 0
chmod("test3/file3", 0100644)           = 0
utimes("test3/file3", {1259519208, 0})  = -1 EINVAL (Invalid argument)

when I reinstate old code which was using utime(), it works:

chown32("test3/file3", 0, 0)            = 0
chmod("test3/file3", 0100644)           = 0
utime("test3/file3", [2009/11/29-19:25:44, 2009/11/29-19:25:44]) = 0

I run 2.6.31-rc2 kernel.

Hmm, maybe it's because utimes should take two struct timeval's,
and your change gives only one? Manpage says:

int utimes(const char *filename, const struct timeval times[2]);


--
vda


More information about the busybox mailing list