[PATCH] D83945: [SystemZ/ZOS] Implement setLastAccessAndModificationTime()
Kai Nacke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 05:48:51 PDT 2020
Kai created this revision.
Kai added reviewers: emaste, uweigand, abhina.sree, yusra.syeda, kbarton, mehdi_amini, joerg, hubert.reinterpretcast.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
The function setLastAccessAndModificationTime() uses function futimens() or futimes() by default.
Both functions are not available in z/OS, therefore functionality is implemented using __fchattr() on z/OS.
Repository:
rG LLVM Github Monorepo
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)))
+ 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.278446.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200716/1f35ed81/attachment.bin>
More information about the llvm-commits
mailing list