1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[SystemZ/ZOS] Implement setLastAccessAndModificationTime()

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.

Reviews by: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D83945
This commit is contained in:
Kai Nacke 2020-07-02 14:43:42 +02:00 committed by Kai Nacke
parent 14d3f0ab15
commit 1f82a98efd

View File

@ -792,6 +792,16 @@ std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
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);