]> granicus.if.org Git - strace/blobdiff - fetch_struct_stat64.c
mmap_cache: add function to enable mmap_cache
[strace] / fetch_struct_stat64.c
index d9051ace6a03849def91970a65e26f45ac947e62..3480c1016cd527d3c7761c6520461327411c515e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2016-2017 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,12 +64,14 @@ typedef struct stat64 struct_stat64;
 
 #ifdef HAVE_STRUCT_STAT64_ST_MTIME_NSEC
 # define TIME_NSEC(arg) zero_extend_signed_to_ull(arg)
+# define HAVE_NSEC true
 #else
 # define TIME_NSEC(arg) 0
+# define HAVE_NSEC false
 #endif
 
 MPERS_PRINTER_DECL(bool, fetch_struct_stat64,
-                  struct tcb *const tcp, const kernel_ureg_t addr,
+                  struct tcb *const tcp, const kernel_ulong_t addr,
                   struct strace_stat *const dst)
 {
 #ifdef HAVE_STRUCT_STAT64
@@ -92,6 +95,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_stat64,
        dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec);
        dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec);
        dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec);
+       dst->has_nsec = HAVE_NSEC;
        return true;
 #else /* !HAVE_STRUCT_STAT64 */
        printaddr(addr);