[PATCH] D83945: [SystemZ/ZOS] Implement setLastAccessAndModificationTime()

Kai Nacke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 03:37:50 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7294ca3f6eca: [SystemZ/ZOS] Implement setLastAccessAndModificationTime() (authored by Kai).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83945/new/

https://reviews.llvm.org/D83945

Files:
  llvm/lib/Support/Unix/Path.inc


Index: llvm/lib/Support/Unix/Path.inc
===================================================================
--- llvm/lib/Support/Unix/Path.inc
+++ llvm/lib/Support/Unix/Path.inc
@@ -792,6 +792,16 @@
   if (::futimes(FD, Times))
     return std::error_code(errno, std::generic_category());
   return std::error_code();
+#elif defined(__MVS__)
+  attrib_t Attr;
+  memset(&Attr, 0, sizeof(Attr));
+  Attr.att_atimechg = 1;
+  Attr.att_atime = sys::toTimeT(AccessTime);
+  Attr.att_mtimechg = 1;
+  Attr.att_mtime = sys::toTimeT(ModificationTime);
+  if (::__fchattr(FD, &Attr, sizeof(Attr)) != 0)
+    return std::error_code(errno, std::generic_category());
+  return std::error_code();
 #else
 #warning Missing futimes() and futimens()
   return make_error_code(errc::function_not_supported);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83945.281176.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200728/149a9e2a/attachment.bin>


More information about the llvm-commits mailing list