From 11ca2e508c2152732c364d02e5b381e61c851084 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 20 Jun 2013 20:56:14 +0000 Subject: Add a setLastModificationAndAccessTime to PathV2. With this we can remove the last use of PathV1 from llvm-ar.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184464 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/PathV2.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/Support/Unix/PathV2.inc') diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index 4b922da..e9cb6e7 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/lib/Support/Unix/PathV2.inc @@ -441,6 +441,16 @@ error_code permissions(const Twine &path, perms prms) { return error_code::success(); } +error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { + timeval Times[2]; + Times[0].tv_sec = Time.toPosixTime(); + Times[0].tv_usec = 0; + Times[1] = Times[0]; + if (::futimes(FD, Times)) + return error_code(errno, system_category()); + return error_code::success(); +} + // Since this is most often used for temporary files, mode defaults to 0600. error_code unique_file(const Twine &model, int &result_fd, SmallVectorImpl &result_path, -- cgit v1.1