summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/PathV2.inc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 20:56:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 20:56:14 +0000
commit4a3365c8698222da6bd060cd388ef9c8ac23452c (patch)
treee6693d60a6d1b3a3f73533c0ab92fbcc1975d6e5 /llvm/lib/Support/Windows/PathV2.inc
parent463e2d9b19f078122ece59dbf2f070f679f69680 (diff)
downloadbcm5719-llvm-4a3365c8698222da6bd060cd388ef9c8ac23452c.tar.gz
bcm5719-llvm-4a3365c8698222da6bd060cd388ef9c8ac23452c.zip
Add a setLastModificationAndAccessTime to PathV2.
With this we can remove the last use of PathV1 from llvm-ar.cpp. llvm-svn: 184464
Diffstat (limited to 'llvm/lib/Support/Windows/PathV2.inc')
-rw-r--r--llvm/lib/Support/Windows/PathV2.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc
index 006e31a5bd2..5e0375fcf9a 100644
--- a/llvm/lib/Support/Windows/PathV2.inc
+++ b/llvm/lib/Support/Windows/PathV2.inc
@@ -585,6 +585,17 @@ error_code permissions(const Twine &path, perms prms) {
return error_code::success();
}
+error_code setLastModificationAndAccessTime(int FD, TimeValue Time) {
+ ULARGE_INTEGER UI;
+ UI.QuadPart = Time.toWin32Time();
+ FILETIME FT;
+ FT.dwLowDateTime = UI.LowPart;
+ FT.dwHighDateTime = UI.HighPart;
+ HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
+ if (!SetFileTime(FileHandle, NULL, &FT, &FT))
+ return windows_error(::GetLastError());
+ return error_code::success();
+}
// FIXME: mode should be used here and default to user r/w only,
// it currently comes in as a UNIX mode.
OpenPOWER on IntegriCloud