[PATCH] D83945: [SystemZ/ZOS] Implement setLastAccessAndModificationTime()
Kai Nacke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 07:12:24 PDT 2020
Kai updated this revision to Diff 279812.
Kai added a comment.
Changed check for error condition according to review comment.
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
@@ -791,6 +791,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.279812.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/bc002a49/attachment.bin>
More information about the llvm-commits
mailing list