public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] support: Use __utimensat64 to set file access and modification times
@ 2021-03-17 15:38 Lukasz Majewski
  2021-03-17 18:05 ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2021-03-17 15:38 UTC (permalink / raw)
  To: Joseph Myers, Adhemerval Zanella
  Cc: Paul Eggert, Arnd Bergmann, GNU C Library, Florian Weimer,
	Carlos O'Donell, Lukasz Majewski

Before this patch the ARM port required the __libc_do_syscall
function to be able to call utimensat_time64 syscall required to
check if file system supports 64 bit time.

This patch fixes the following error on ARM 32 bit port:

y2038-glibc/support/support_path_support_time64.c:34: undefined reference to
`__libc_do_syscall'
collect2: error: ld returned 1 exit status

As it now calls the __utimensat64 glibc exported function, which
supports 64 bit time.
---
 support/support_path_support_time64.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/support/support_path_support_time64.c b/support/support_path_support_time64.c
index 74af7d4973..e42350fa43 100644
--- a/support/support_path_support_time64.c
+++ b/support/support_path_support_time64.c
@@ -24,17 +24,6 @@
 #include <sysdep.h>
 #endif
 
-#ifdef __linux__
-static int
-utimesat_call (const char *path, const struct __timespec64 tsp[2])
-{
-# ifndef __NR_utimensat_time64
-#  define __NR_utimensat_time64 __NR_utimensat
-# endif
-  return INLINE_SYSCALL_CALL (utimensat_time64, AT_FDCWD, path, &tsp[0], 0);
-}
-#endif
-
 bool
 support_path_support_time64 (const char *path)
 {
@@ -49,8 +38,9 @@ support_path_support_time64 (const char *path)
     { 0x80000001ULL, 0 },
     { 0x80000002ULL, 0 }
   };
-  /* Return is kernel does not support __NR_utimensat_time64.  */
-  if (utimesat_call (path, tsp) == -1)
+
+  /* Return if kernel does not support __NR_utimensat_time64.  */
+  if (__utimensat64 (AT_FDCWD, path, &tsp[0], 0) == -1)
     return false;
 
   /* Verify if the last access and last modification time match the ones
@@ -67,7 +57,7 @@ support_path_support_time64 (const char *path)
     { ostx.stx_atime.tv_sec, ostx.stx_atime.tv_nsec },
     { ostx.stx_mtime.tv_sec, ostx.stx_mtime.tv_nsec },
   };
-  TEST_VERIFY_EXIT (utimesat_call (path, otsp) == 0);
+  TEST_VERIFY_EXIT (__utimensat64 (AT_FDCWD, path, &otsp[0], 0) == 0);
 
   return support;
 #else
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-17 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 15:38 [PATCH] support: Use __utimensat64 to set file access and modification times Lukasz Majewski
2021-03-17 18:05 ` Florian Weimer
2021-03-17 18:38   ` Adhemerval Zanella
2021-03-17 18:53     ` Florian Weimer
2021-03-17 22:32     ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).