@@ -20,6 +20,9 @@
# include <time/sys/time.h>
# ifndef _ISOMAC
+
+# include <include/time.h>
+
extern int __gettimeofday (struct timeval *__tv,
struct timezone *__tz);
libc_hidden_proto (__gettimeofday)
@@ -39,5 +42,8 @@ extern int __utimes (const char *__file, const struct timeval __tvp[2])
attribute_hidden;
extern int __futimes (int fd, const struct timeval tvp[2]) attribute_hidden;
+extern int __utimes_t64 (const char *file, const struct __timeval64 tvp[2])
+ attribute_hidden;
+
# endif
#endif
@@ -37,3 +37,18 @@ __utimes (const char *file, const struct timeval tvp[2])
weak_alias (__utimes, utimes)
stub_warning (utimes)
+
+int
+__utimes_t64 (const char *file, const struct __timeval64 tvp[2])
+{
+ if (file == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (__utimes_t64)
@@ -38,5 +38,6 @@ libc {
__sigtimedwait64;
__futimes64;
__lutimes64;
+ __utimes_t64;
}
}
@@ -34,3 +34,34 @@ __utimes (const char *file, const struct timeval tvp[2])
}
weak_alias (__utimes, utimes)
+
+/* 64-bit time version */
+
+extern int __y2038_linux_support;
+
+int
+__utimes_t64 (const char *file, const struct __timeval64 tvp[2])
+{
+ struct timeval tv32[2], *tvp32 = NULL;
+
+ if (__y2038_linux_support)
+ {
+ /* TODO: implement using 64-bit time syscall */
+ }
+
+ if (tvp != NULL)
+ {
+ if (tvp[0].tv_sec > INT_MAX || tvp[1].tv_sec > INT_MAX)
+ {
+ __set_errno(EOVERFLOW);
+ return -1;
+ }
+ tv32[0].tv_sec = tvp[0].tv_sec;
+ tv32[0].tv_usec = tvp[0].tv_usec;
+ tv32[1].tv_sec = tvp[1].tv_sec;
+ tv32[1].tv_usec = tvp[1].tv_usec;
+ tvp32 = tv32;
+ }
+
+ return INLINE_SYSCALL (utimes, 2, file, tvp32);
+}
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> --- include/sys/time.h | 6 ++++++ misc/utimes.c | 15 +++++++++++++++ sysdeps/unix/sysv/linux/arm/Versions | 1 + sysdeps/unix/sysv/linux/utimes.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+)