<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On 25 July 2018 at 19:42, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looks like macOS 10.11 only supports a resolution of seconds, but I can't find documentation confirming that.<div><br></div><div>I'll adjust the test.<div><br></div><div>/Eric</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 25, 2018 at 8:33 PM Alex L <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looks like '<span style="font-size:12.800000190734863px">SupportsNanosecondRoundTrip' is set to 0.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 July 2018 at 19:30, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sure,<div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Standard Error:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">--</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">PRIOR:3</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">AFTER:0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Diff:</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(180,36,25)"><span style="font-variant-ligatures:no-common-ligatures">-    return last_write_time(p) == ft;</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures">+    std::cerr << "PRIOR:" << (long long)ft.time_since_epoch().<wbr>count() << std::endl;</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures">+    auto ft2 = last_write_time(p);</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures">+    std::cerr << "AFTER:" << (long long)ft2.time_since_epoch().<wbr>count() << std::endl;</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">



</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span style="font-variant-ligatures:no-common-ligatures">+    return ft2  == ft;</span></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 July 2018 at 19:20, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Could you tell me what the value of the initial time point, and the resulting one are on this line?<div><br></div><div><a href="https://github.com/llvm-mirror/libcxx/blob/master/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp#L224" target="_blank">https://github.com/llvm-<wbr>mirror/libcxx/blob/master/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp#L224</a></div></div><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div dir="ltr">On Wed, Jul 25, 2018 at 8:17 PM Alex L <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div dir="ltr">Please let me know if this information is helpful. If not, I'll mark the test as UNSUPPORTED for darwin for the time being and will create an internal issue to track the investigation into the OS-specific failure.<div>Cheers,</div><div>Alex</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5">On 25 July 2018 at 19:12, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div dir="ltr">I got the following output on an macOS10.11 machine:<div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Exit Code: 1</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Standard Error:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">--</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = file, epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = dir, epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = file, future_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532581924000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532581924695307000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = dir, future_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532581924000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532581924695307000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = file, past_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532570860000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532570860695273000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = dir, past_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532570860000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1532570860695273000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = file, before_epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-223000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-222000017000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = dir, before_epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-223000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-222000017000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = file, just_before_epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-1000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-17000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Test Case = dir, just_before_epoch_time</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In set_last_write_time_dynamic_<wbr>env_test():455 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-1000000000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">-17000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In last_write_time_symlink_test()<wbr>:487 Assertion TEST_CHECK(got_time == new_time) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">In last_write_time_symlink_test()<wbr>:489 Assertion TEST_CHECK(CompareTime(<wbr>LastWriteTime(file), new_time)) failed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    in file: /Users/local/llvm/projects/<wbr>libcxx/test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Summary for testsuite last_write_time_test_suite:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    7 of 9 test cases passed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    88 of 98 assertions passed.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    0 unsupported test cases.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">--</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Compiled test failed unexpectedly!</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">********************</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Testing Time: 4.43s</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">********************</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Failing Tests (1):</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    libc++ :: std/experimental/filesystem/<wbr>fs.op.funcs/fs.op.last_write_<wbr>time/last_write_time.pass.cpp</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  Unexpected Failures: 1</span></p></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5">On 25 July 2018 at 18:20, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div dir="ltr">OK. I also added debug print statements to the test to give more information. I'm just waiting for the bots to cycle now.</div><br></div></div><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr">On Wed, Jul 25, 2018 at 7:18 PM Alex L <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr">I couldn't reproduce it on my machine, and I don't have access to the bot ATM, but I will try it on an older OS to see if it's an issue with the particular OS that's used on our bot.<div><br></div><div>Cheers,</div><div>Alex</div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5">On 25 July 2018 at 17:43, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr">I'll take a look and will try to reproduce it right now.</div></div></div></div></div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383HOEnZb"><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383h5"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5">On 25 July 2018 at 17:37, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><span><div dir="ltr">On Wed, Jul 25, 2018 at 6:03 PM Alex L <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hmm, looks like the added test is failing on Darwin even after your fixes.<div><br></div><div>Do you have an idea of why that could be?</div></div></blockquote><div> </div></span><div>Not yet, working on it now.</div><div>I'm failing to reproduce it on my macbook though. If you can, any information about what's going on would be helpful.</div><div>Like what are those actual values?</div></div></div></div></div><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383m_-5557678886675019082h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr"><div><br></div><div><a href="http://lab.llvm.org:8080/green/job/libcxx_master_cmake/4784/testReport/junit/libc++/std_experimental_filesystem_fs_op_funcs_fs_op_last_write_time/last_write_time_pass_cpp/" target="_blank">http://lab.llvm.org:8080/<wbr>green/job/libcxx_master_cmake/<wbr>4784/testReport/junit/libc++/<wbr>std_experimental_filesystem_<wbr>fs_op_funcs_fs_op_last_write_<wbr>time/last_write_time_pass_cpp/</a><br></div><div><br></div><div><div>Compiled With: ['/Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/clang++', '-o', '/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/test/<wbr>std/experimental/filesystem/<wbr>fs.op.funcs/fs.op.last_write_<wbr>time/Output/last_write_time.<wbr>pass.cpp.o', '-x', 'c++', '/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp', '-c', '-v', '-arch', 'x86_64', '-mmacosx-version-min=10.13', '-D_LIBCPP_DISABLE_<wbr>AVAILABILITY', '-ftemplate-depth=270', '-Werror=thread-safety', '-std=c++11', '-include', '/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/support/nasty_macros.hpp'<wbr>, '-nostdinc++', '-I/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>include', '-I/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/<wbr>include/c++build', '-isysroot', '/Applications/Xcode.app/<wbr>Contents/Developer/Platforms/<wbr>MacOSX.platform/Developer/<wbr>SDKs/MacOSX10.13.sdk', '-I/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/support', '-DLIBCXX_FILESYSTEM_STATIC_<wbr>TEST_ROOT="/Users/buildslave/<wbr>jenkins/sharedspace/libcxx/<wbr>libcxx.src/test/std/<wbr>experimental/filesystem/<wbr>Inputs/static_test_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_<wbr>TEST_ROOT="/Users/buildslave/<wbr>jenkins/sharedspace/libcxx/<wbr>build/test/filesystem/Output/<wbr>dynamic_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_<wbr>TEST_HELPER="/usr/local/opt/<wbr>python@2/bin/python2.7 /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/support/filesystem_<wbr>dynamic_test_helper.py"', '-D_LIBCPP_HAS_NO_PRAGMA_<wbr>SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-<wbr>argument', '-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wno-aligned-allocation-<wbr>unavailable', '-Wsign-compare', '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-Wno-conversion', '-Wno-unused-local-typedef', '-c', '&&', '/Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/clang++', '-o', '/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/test/<wbr>std/experimental/filesystem/<wbr>fs.op.funcs/fs.op.last_write_<wbr>time/Output/last_write_time.<wbr>pass.cpp.exe', '/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/test/<wbr>std/experimental/filesystem/<wbr>fs.op.funcs/fs.op.last_write_<wbr>time/Output/last_write_time.<wbr>pass.cpp.o', '-v', '-arch', 'x86_64', '-mmacosx-version-min=10.13', '-D_LIBCPP_DISABLE_<wbr>AVAILABILITY', '-ftemplate-depth=270', '-L/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/lib', '-Wl,-rpath,/Users/buildslave/<wbr>jenkins/sharedspace/libcxx/<wbr>build/lib', '-nodefaultlibs', '-lc++experimental', '-lc++', '-lSystem']</div><div>Command: ['/Users/buildslave/jenkins/<wbr>sharedspace/libcxx/build/test/<wbr>std/experimental/filesystem/<wbr>fs.op.funcs/fs.op.last_write_<wbr>time/Output/last_write_time.<wbr>pass.cpp.exe']</div><div>Exit Code: 1</div><div>Standard Error:</div><div>--</div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In set_last_write_time_dynamic_<wbr>env_test():451 Assertion TEST_CHECK(CompareTime(got_<wbr>time, TC.new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In last_write_time_symlink_test()<wbr>:477 Assertion TEST_CHECK(got_time == new_time) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>In last_write_time_symlink_test()<wbr>:479 Assertion TEST_CHECK(CompareTime(<wbr>LastWriteTime(file), new_time)) failed.</div><div>    in file: /Users/buildslave/jenkins/<wbr>sharedspace/libcxx/libcxx.src/<wbr>test/std/experimental/<wbr>filesystem/fs.op.funcs/fs.op.<wbr>last_write_time/last_write_<wbr>time.pass.cpp</div><div>    </div><div>Summary for testsuite last_write_time_test_suite:</div><div>    7 of 9 test cases passed.</div><div>    78 of 88 assertions passed.</div><div>    0 unsupported test cases.</div><div>--</div><div><br></div><div>Compiled test failed unexpectedly!</div></div><div><br></div><div>Thanks,</div><div>Alex</div><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5">On 25 July 2018 at 17:00, Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>></span> wrote:<br></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr">Sure! Fixed it up in r337984.</div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><span>On 25 July 2018 at 15:03, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br></span></div></div></div></div><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383m_-5557678886675019082m_3629139256100849010m_-6285619442336665827m_624462420802478192h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><span><div dir="ltr">On Wed, Jul 25, 2018 at 3:39 PM Alex L <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looks like this works:<div><br></div><div><div>+++ b/src/experimental/filesystem/<wbr>filesystem_common.h</div><div>@@ -393,7 +393,7 @@ bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS,</div><div>                     error_code& ec) {</div><div> #if !defined(_LIBCPP_USE_<wbr>UTIMENSAT)</div><div>   using namespace chrono;</div><div>-  auto Convert = [](long nsec) {</div><div>+  auto Convert = [](long nsec) -> decltype(std::declval<::<wbr>timeval>().tv_usec) {</div><div>     return duration_cast<microseconds>(<wbr>nanoseconds(nsec)).count();</div><div>   };</div><div>   struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},</div></div><div><br></div><div>I will commit this fix in a couple of minutes.</div></div></blockquote><div><br></div></span><div>I think I would prefer an explicit cast to an implicit one since the narrowing is intended, and should be safe.</div><div><br></div><div>Maybe:</div><div><br></div><div>auto Convert [](long nsec) { </div><div>  using int_type = decltype(::timeval::tv_usec);</div><div>  auto dur = duration_cast<microseconds>(<wbr>nanoseconds(nsec)).count();</div><div>  return static_cast<int_type>(dur);</div><div>};</div><div><br></div><div>?</div></div></div></div></div><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383m_-5557678886675019082m_3629139256100849010m_-6285619442336665827m_624462420802478192m_-7273343445799591636h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5">On 25 July 2018 at 14:27, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="auto">Thanks. let me know if you want me to take over </div></div></div></div></div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383m_-5557678886675019082m_3629139256100849010m_-6285619442336665827m_624462420802478192m_-7273343445799591636m_8166487320056533479m_-6165504667961413298HOEnZb"><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606m_8659656676178802563m_6747764441411225383m_-5557678886675019082m_3629139256100849010m_-6285619442336665827m_624462420802478192m_-7273343445799591636m_8166487320056533479m_-6165504667961413298h5"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div dir="ltr">On Wed, Jul 25, 2018, 3:22 PM Alex L, <<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</a>> wrote:<br></div></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5">On 25 July 2018 at 13:51, Eric Fiselier via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" rel="noreferrer" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Author: ericwf<br>
Date: Wed Jul 25 13:51:49 2018<br>
New Revision: 337960<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=337960&view=rev" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=337960&view=rev</a><br>
Log:<br>
[libc++] Use __int128_t to represent file_time_type.<br>
<br>
Summary:<br>
The ``file_time_type`` time point is used to represent the write times for files.<br>
Its job is to act as part of a C++ wrapper for less ideal system interfaces. The<br>
underlying filesystem uses the ``timespec`` struct for the same purpose.<br>
<br>
However, the initial implementation of ``file_time_type`` could not represent<br>
either the range or resolution of ``timespec``, making it unsuitable. Fixing<br>
this requires an implementation which uses more than 64 bits to store the<br>
time point.<br>
<br>
I primarily considered two solutions: Using ``__int128_t`` and using a<br>
arithmetic emulation of ``timespec``. Each has its pros and cons, and both<br>
come with more than one complication.<br>
<br>
However, after a lot of consideration, I decided on using `__int128_t`. This patch implements that change.<br>
<br>
Please see the [FileTimeType Design Document](<a href="http://libcxx.llvm.org/docs/DesignDocs/FileTimeType.html" rel="noreferrer noreferrer" target="_blank">http://libcxx.llvm.<wbr>org/docs/DesignDocs/<wbr>FileTimeType.html</a>) for more information.<br>
<br>
Reviewers: mclow.lists, ldionne, joerg, arthur.j.odwyer, EricWF<br>
<br>
Reviewed By: EricWF<br>
<br>
Subscribers: christof, K-ballo, cfe-commits, BillyONeal<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D49774" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D49774</a><br>
<br>
Added:<br>
    libcxx/trunk/src/include/<wbr>apple_availability.h<br>
Modified:<br>
    libcxx/trunk/include/<wbr>experimental/filesystem<br>
    libcxx/trunk/src/chrono.cpp<br>
    libcxx/trunk/src/experimental/<wbr>filesystem/filesystem_common.h<br>
    libcxx/trunk/src/experimental/<wbr>filesystem/operations.cpp<br>
    libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/class.<wbr>directory_entry/directory_<wbr>entry.mods/last_write_time.sh.<wbr>cpp<br>
    libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/<wbr>convert_file_time.sh.cpp<br>
    libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.<wbr>filesystem.synopsis/file_time_<wbr>type.pass.cpp<br>
    libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.op.<wbr>funcs/fs.op.last_write_time/<wbr>last_write_time.pass.cpp<br>
<br>
Modified: libcxx/trunk/include/<wbr>experimental/filesystem<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/<wbr>experimental/filesystem?rev=<wbr>337960&r1=337959&r2=337960&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/include/<wbr>experimental/filesystem (original)<br>
+++ libcxx/trunk/include/<wbr>experimental/filesystem Wed Jul 25 13:51:49 2018<br>
@@ -260,7 +260,37 @@ _LIBCPP_PUSH_MACROS<br>
<br>
 _LIBCPP_BEGIN_NAMESPACE_<wbr>EXPERIMENTAL_FILESYSTEM<br>
<br>
-typedef chrono::time_point<std::<wbr>chrono::system_clock>  file_time_type;<br>
+struct _FilesystemClock {<br>
+#if !defined(_LIBCPP_HAS_NO_<wbr>INT128)<br>
+  typedef __int128_t rep;<br>
+  typedef nano period;<br>
+#else<br>
+  typedef long long rep;<br>
+  typedef nano period;<br>
+#endif<br>
+<br>
+  typedef chrono::duration<rep, period> duration;<br>
+  typedef chrono::time_point<_<wbr>FilesystemClock> time_point;<br>
+<br>
+  static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;<br>
+<br>
+  _LIBCPP_FUNC_VIS static time_point now() noexcept;<br>
+<br>
+  _LIBCPP_INLINE_VISIBILITY<br>
+  static time_t to_time_t(const time_point& __t) noexcept {<br>
+    typedef chrono::duration<rep> __secs;<br>
+    return time_t(<br>
+        chrono::duration_cast<__secs>(<wbr>__t.time_since_epoch()).count(<wbr>));<br>
+  }<br>
+<br>
+  _LIBCPP_INLINE_VISIBILITY<br>
+  static time_point from_time_t(time_t __t) noexcept {<br>
+    typedef chrono::duration<rep> __secs;<br>
+    return time_point(__secs(__t));<br>
+  }<br>
+};<br>
+<br>
+typedef chrono::time_point<_<wbr>FilesystemClock> file_time_type;<br>
<br>
 struct _LIBCPP_TYPE_VIS space_info<br>
 {<br>
<br>
Modified: libcxx/trunk/src/chrono.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/chrono.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/src/<wbr>chrono.cpp?rev=337960&r1=<wbr>337959&r2=337960&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/src/chrono.cpp (original)<br>
+++ libcxx/trunk/src/chrono.cpp Wed Jul 25 13:51:49 2018<br>
@@ -11,27 +11,10 @@<br>
 #include "cerrno"        // errno<br>
 #include "system_error"  // __throw_system_error<br>
 #include <time.h>        // clock_gettime, CLOCK_MONOTONIC and CLOCK_REALTIME<br>
+#include "include/apple_availability.h"<br>
<br>
-#if (__APPLE__)<br>
-#if defined(__ENVIRONMENT_MAC_OS_<wbr>X_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_MAC_OS_X_<wbr>VERSION_MIN_REQUIRED__ >= 101200<br>
-#define _LIBCXX_USE_CLOCK_GETTIME<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_IPHONE_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_IPHONE_OS_<wbr>VERSION_MIN_REQUIRED__ >= 100000<br>
-#define _LIBCXX_USE_CLOCK_GETTIME<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_TV_OS_<wbr>VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_TV_OS_VERSION_<wbr>MIN_REQUIRED__ >= 100000<br>
-#define _LIBCXX_USE_CLOCK_GETTIME<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_WATCH_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_WATCH_OS_<wbr>VERSION_MIN_REQUIRED__ >= 30000<br>
-#define _LIBCXX_USE_CLOCK_GETTIME<br>
-#endif<br>
-#endif // __ENVIRONMENT_.*_VERSION_MIN_<wbr>REQUIRED__<br>
-#else<br>
-#define _LIBCXX_USE_CLOCK_GETTIME<br>
+#if !defined(__APPLE__)<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
 #endif // __APPLE__<br>
<br>
 #if defined(_LIBCPP_WIN32API)<br>
@@ -42,7 +25,7 @@<br>
 #include <winapifamily.h><br>
 #endif<br>
 #else<br>
-#if !defined(CLOCK_REALTIME) || !defined(_LIBCXX_USE_CLOCK_<wbr>GETTIME)<br>
+#if !defined(CLOCK_REALTIME) || !defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME)<br>
 #include <sys/time.h>        // for gettimeofday and timeval<br>
 #endif // !defined(CLOCK_REALTIME)<br>
 #endif // defined(_LIBCPP_WIN32API)<br>
@@ -92,16 +75,16 @@ system_clock::now() _NOEXCEPT<br>
                        static_cast<__int64>(ft.<wbr>dwLowDateTime)};<br>
   return time_point(duration_cast<<wbr>duration>(d - nt_to_unix_epoch));<br>
 #else<br>
-#if defined(_LIBCXX_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_REALTIME)<br>
-    struct timespec tp;<br>
-    if (0 != clock_gettime(CLOCK_REALTIME, &tp))<br>
-        __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");<br>
-    return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));<br>
+#if defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_REALTIME)<br>
+  struct timespec tp;<br>
+  if (0 != clock_gettime(CLOCK_REALTIME, &tp))<br>
+    __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");<br>
+  return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));<br>
 #else<br>
     timeval tv;<br>
     gettimeofday(&tv, 0);<br>
     return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));<br>
-#endif // _LIBCXX_USE_CLOCK_GETTIME && CLOCK_REALTIME<br>
+#endif // _LIBCPP_USE_CLOCK_GETTIME && CLOCK_REALTIME<br>
 #endif<br>
 }<br>
<br>
@@ -129,7 +112,7 @@ const bool steady_clock::is_steady;<br>
 #if defined(__APPLE__)<br>
<br>
 // Darwin libc versions >= 1133 provide ns precision via CLOCK_UPTIME_RAW<br>
-#if defined(_LIBCXX_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_UPTIME_RAW)<br>
+#if defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_UPTIME_RAW)<br>
 steady_clock::time_point<br>
 steady_clock::now() _NOEXCEPT<br>
 {<br>
@@ -191,7 +174,7 @@ steady_clock::now() _NOEXCEPT<br>
     static FP fp = init_steady_clock();<br>
     return time_point(duration(fp()));<br>
 }<br>
-#endif // defined(_LIBCXX_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_UPTIME_RAW)<br>
+#endif // defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_UPTIME_RAW)<br>
<br>
 #elif defined(_LIBCPP_WIN32API)<br>
<br>
<br>
Modified: libcxx/trunk/src/experimental/<wbr>filesystem/filesystem_common.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/filesystem_common.h?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/src/<wbr>experimental/filesystem/<wbr>filesystem_common.h?rev=<wbr>337960&r1=337959&r2=337960&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/src/experimental/<wbr>filesystem/filesystem_common.h (original)<br>
+++ libcxx/trunk/src/experimental/<wbr>filesystem/filesystem_common.h Wed Jul 25 13:51:49 2018<br>
@@ -23,33 +23,17 @@<br>
<br>
 #include <experimental/filesystem><br>
<br>
-#if (__APPLE__)<br>
-#if defined(__ENVIRONMENT_MAC_OS_<wbr>X_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_MAC_OS_X_<wbr>VERSION_MIN_REQUIRED__ >= 101300<br>
-#define _LIBCXX_USE_UTIMENSAT<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_IPHONE_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_IPHONE_OS_<wbr>VERSION_MIN_REQUIRED__ >= 110000<br>
-#define _LIBCXX_USE_UTIMENSAT<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_TV_OS_<wbr>VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_TV_OS_VERSION_<wbr>MIN_REQUIRED__ >= 110000<br>
-#define _LIBCXX_USE_UTIMENSAT<br>
-#endif<br>
-#elif defined(__ENVIRONMENT_WATCH_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
-#if __ENVIRONMENT_WATCH_OS_<wbr>VERSION_MIN_REQUIRED__ >= 40000<br>
-#define _LIBCXX_USE_UTIMENSAT<br>
-#endif<br>
-#endif // __ENVIRONMENT_.*_VERSION_MIN_<wbr>REQUIRED__<br>
-#else<br>
+#include "../../include/apple_<wbr>availability.h"<br>
+<br>
+#if !defined(__APPLE__)<br>
 // We can use the presence of UTIME_OMIT to detect platforms that provide<br>
 // utimensat.<br>
 #if defined(UTIME_OMIT)<br>
-#define _LIBCXX_USE_UTIMENSAT<br>
+#define _LIBCPP_USE_UTIMENSAT<br>
+#endif<br>
 #endif<br>
-#endif // __APPLE__<br>
<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
+#if !defined(_LIBCPP_USE_<wbr>UTIMENSAT)<br>
 #include <sys/time.h> // for ::utimes as used in __last_write_time<br>
 #endif<br>
<br>
@@ -212,76 +196,119 @@ private:<br>
   ErrorHandler& operator=(ErrorHandler const&) = delete;<br>
 };<br>
<br>
-namespace time_util {<br>
+using chrono::duration;<br>
+using chrono::duration_cast;<br>
<br>
-using namespace chrono;<br>
+using TimeSpec = struct ::timespec;<br>
+using StatT = struct ::stat;<br>
<br>
-template <class FileTimeT,<br>
+template <class FileTimeT, class TimeT,<br>
           bool IsFloat = is_floating_point<typename FileTimeT::rep>::value><br>
-struct fs_time_util_base {<br>
-  static constexpr seconds::rep max_seconds =<br>
-      duration_cast<seconds>(<wbr>FileTimeT::duration::max()).<wbr>count();<br>
-<br>
-  static constexpr nanoseconds::rep max_nsec =<br>
-      duration_cast<nanoseconds>(<wbr>FileTimeT::duration::max() -<br>
-                                 seconds(max_seconds))<br>
+struct time_util_base {<br>
+  using rep = typename FileTimeT::rep;<br>
+  using fs_duration = typename FileTimeT::duration;<br>
+  using fs_seconds = duration<rep>;<br>
+  using fs_nanoseconds = duration<rep, nano>;<br>
+  using fs_microseconds = duration<rep, micro>;<br>
+<br>
+  static constexpr rep max_seconds =<br>
+      duration_cast<fs_seconds>(<wbr>FileTimeT::duration::max()).<wbr>count();<br>
+<br>
+  static constexpr rep max_nsec =<br>
+      duration_cast<fs_nanoseconds>(<wbr>FileTimeT::duration::max() -<br>
+                                    fs_seconds(max_seconds))<br>
           .count();<br>
<br>
-  static constexpr seconds::rep min_seconds =<br>
-      duration_cast<seconds>(<wbr>FileTimeT::duration::min()).<wbr>count();<br>
+  static constexpr rep min_seconds =<br>
+      duration_cast<fs_seconds>(<wbr>FileTimeT::duration::min()).<wbr>count();<br>
<br>
-  static constexpr nanoseconds::rep min_nsec_timespec =<br>
-      duration_cast<nanoseconds>(<br>
-          (FileTimeT::duration::min() - seconds(min_seconds)) + seconds(1))<br>
+  static constexpr rep min_nsec_timespec =<br>
+      duration_cast<fs_nanoseconds>(<br>
+          (FileTimeT::duration::min() - fs_seconds(min_seconds)) +<br>
+          fs_seconds(1))<br>
           .count();<br>
<br>
+private:<br>
+#if _LIBCPP_STD_VER > 11<br>
+  static constexpr fs_duration get_min_nsecs() {<br>
+    return duration_cast<fs_duration>(<br>
+        fs_nanoseconds(min_nsec_<wbr>timespec) -<br>
+        duration_cast<fs_nanoseconds>(<wbr>fs_seconds(1)));<br>
+  }<br>
   // Static assert that these values properly round trip.<br>
-  static_assert((seconds(min_<wbr>seconds) +<br>
-                 duration_cast<microseconds>(<wbr>nanoseconds(min_nsec_timespec)<wbr>)) -<br>
-                        duration_cast<microseconds>(<wbr>seconds(1)) ==<br>
+  static_assert(fs_seconds(min_<wbr>seconds) + get_min_nsecs() ==<br>
                     FileTimeT::duration::min(),<br>
-                "");<br>
+                "value doesn't roundtrip");<br>
+<br>
+  static constexpr bool check_range() {<br>
+    // This kinda sucks, but it's what happens when we don't have __int128_t.<br>
+    if (sizeof(TimeT) == sizeof(rep)) {<br>
+      typedef duration<long long, ratio<3600 * 24 * 365> > Years;<br>
+      return duration_cast<Years>(fs_<wbr>seconds(max_seconds)) > Years(250) &&<br>
+             duration_cast<Years>(fs_<wbr>seconds(min_seconds)) < Years(-250);<br>
+    }<br>
+    return max_seconds >= numeric_limits<TimeT>::max() &&<br>
+           min_seconds <= numeric_limits<TimeT>::min();<br>
+  }<br>
+  static_assert(check_range(), "the representable range is unacceptable small");<br>
+#endif<br>
 };<br>
<br>
-template <class FileTimeT><br>
-struct fs_time_util_base<FileTimeT, true> {<br>
-  static const long long max_seconds;<br>
-  static const long long max_nsec;<br>
-  static const long long min_seconds;<br>
-  static const long long min_nsec_timespec;<br>
+template <class FileTimeT, class TimeT><br>
+struct time_util_base<FileTimeT, TimeT, true> {<br>
+  using rep = typename FileTimeT::rep;<br>
+  using fs_duration = typename FileTimeT::duration;<br>
+  using fs_seconds = duration<rep>;<br>
+  using fs_nanoseconds = duration<rep, nano>;<br>
+  using fs_microseconds = duration<rep, micro>;<br>
+<br>
+  static const rep max_seconds;<br>
+  static const rep max_nsec;<br>
+  static const rep min_seconds;<br>
+  static const rep min_nsec_timespec;<br>
 };<br>
<br>
-template <class FileTimeT><br>
-const long long fs_time_util_base<FileTimeT, true>::max_seconds =<br>
-    duration_cast<seconds>(<wbr>FileTimeT::duration::max()).<wbr>count();<br>
-<br>
-template <class FileTimeT><br>
-const long long fs_time_util_base<FileTimeT, true>::max_nsec =<br>
-    duration_cast<nanoseconds>(<wbr>FileTimeT::duration::max() -<br>
-                               seconds(max_seconds))<br>
+template <class FileTimeT, class TimeT><br>
+const typename FileTimeT::rep<br>
+    time_util_base<FileTimeT, TimeT, true>::max_seconds =<br>
+        duration_cast<fs_seconds>(<wbr>FileTimeT::duration::max()).<wbr>count();<br>
+<br>
+template <class FileTimeT, class TimeT><br>
+const typename FileTimeT::rep time_util_base<FileTimeT, TimeT, true>::max_nsec =<br>
+    duration_cast<fs_nanoseconds>(<wbr>FileTimeT::duration::max() -<br>
+                                  fs_seconds(max_seconds))<br>
         .count();<br>
<br>
-template <class FileTimeT><br>
-const long long fs_time_util_base<FileTimeT, true>::min_seconds =<br>
-    duration_cast<seconds>(<wbr>FileTimeT::duration::min()).<wbr>count();<br>
-<br>
-template <class FileTimeT><br>
-const long long fs_time_util_base<FileTimeT, true>::min_nsec_timespec =<br>
-    duration_cast<nanoseconds>(<br>
-        (FileTimeT::duration::min() - seconds(min_seconds)) + seconds(1))<br>
-        .count();<br>
+template <class FileTimeT, class TimeT><br>
+const typename FileTimeT::rep<br>
+    time_util_base<FileTimeT, TimeT, true>::min_seconds =<br>
+        duration_cast<fs_seconds>(<wbr>FileTimeT::duration::min()).<wbr>count();<br>
+<br>
+template <class FileTimeT, class TimeT><br>
+const typename FileTimeT::rep<br>
+    time_util_base<FileTimeT, TimeT, true>::min_nsec_timespec =<br>
+        duration_cast<fs_nanoseconds>(<wbr>(FileTimeT::duration::min() -<br>
+                                       fs_seconds(min_seconds)) +<br>
+                                      fs_seconds(1))<br>
+            .count();<br>
<br>
 template <class FileTimeT, class TimeT, class TimeSpecT><br>
-struct fs_time_util : fs_time_util_base<FileTimeT> {<br>
-  using Base = fs_time_util_base<FileTimeT>;<br>
+struct time_util : time_util_base<FileTimeT, TimeT> {<br>
+  using Base = time_util_base<FileTimeT, TimeT>;<br>
   using Base::max_nsec;<br>
   using Base::max_seconds;<br>
   using Base::min_nsec_timespec;<br>
   using Base::min_seconds;<br>
<br>
+  using typename Base::fs_duration;<br>
+  using typename Base::fs_microseconds;<br>
+  using typename Base::fs_nanoseconds;<br>
+  using typename Base::fs_seconds;<br>
+<br>
 public:<br>
   template <class CType, class ChronoType><br>
-  static bool checked_set(CType* out, ChronoType time) {<br>
+  static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool checked_set(CType* out,<br>
+                                                        ChronoType time) {<br>
     using Lim = numeric_limits<CType>;<br>
     if (time > Lim::max() || time < Lim::min())<br>
       return false;<br>
@@ -291,21 +318,21 @@ public:<br>
<br>
   static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(TimeSpecT tm) {<br>
     if (tm.tv_sec >= 0) {<br>
-      return (tm.tv_sec < max_seconds) ||<br>
+      return tm.tv_sec < max_seconds ||<br>
              (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec);<br>
     } else if (tm.tv_sec == (min_seconds - 1)) {<br>
       return tm.tv_nsec >= min_nsec_timespec;<br>
     } else {<br>
-      return (tm.tv_sec >= min_seconds);<br>
+      return tm.tv_sec >= min_seconds;<br>
     }<br>
   }<br>
<br>
   static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(FileTimeT tm) {<br>
-    auto secs = duration_cast<seconds>(tm.<wbr>time_since_epoch());<br>
-    auto nsecs = duration_cast<nanoseconds>(tm.<wbr>time_since_epoch() - secs);<br>
+    auto secs = duration_cast<fs_seconds>(tm.<wbr>time_since_epoch());<br>
+    auto nsecs = duration_cast<fs_nanoseconds>(<wbr>tm.time_since_epoch() - secs);<br>
     if (nsecs.count() < 0) {<br>
-      secs = secs + seconds(1);<br>
-      nsecs = nsecs + seconds(1);<br>
+      secs = secs + fs_seconds(1);<br>
+      nsecs = nsecs + fs_seconds(1);<br>
     }<br>
     using TLim = numeric_limits<TimeT>;<br>
     if (secs.count() >= 0)<br>
@@ -314,49 +341,45 @@ public:<br>
   }<br>
<br>
   static _LIBCPP_CONSTEXPR_AFTER_CXX11 FileTimeT<br>
-  convert_timespec(TimeSpecT tm) {<br>
-    auto adj_msec = duration_cast<microseconds>(<wbr>nanoseconds(tm.tv_nsec));<br>
-    if (tm.tv_sec >= 0) {<br>
-      auto Dur = seconds(tm.tv_sec) + microseconds(adj_msec);<br>
-      return FileTimeT(Dur);<br>
-    } else if (duration_cast<microseconds>(<wbr>nanoseconds(tm.tv_nsec)).<wbr>count() ==<br>
-               0) {<br>
-      return FileTimeT(seconds(tm.tv_sec));<br>
+  convert_from_timespec(<wbr>TimeSpecT tm) {<br>
+    if (tm.tv_sec >= 0 || tm.tv_nsec == 0) {<br>
+      return FileTimeT(fs_seconds(tm.tv_<wbr>sec) +<br>
+                       duration_cast<fs_duration>(<wbr>fs_nanoseconds(tm.tv_nsec)));<br>
     } else { // tm.tv_sec < 0<br>
-      auto adj_subsec =<br>
-          duration_cast<microseconds>(<wbr>seconds(1) - nanoseconds(tm.tv_nsec));<br>
-      auto Dur = seconds(tm.tv_sec + 1) - adj_subsec;<br>
+      auto adj_subsec = duration_cast<fs_duration>(fs_<wbr>seconds(1) -<br>
+                                                   fs_nanoseconds(tm.tv_nsec));<br>
+      auto Dur = fs_seconds(tm.tv_sec + 1) - adj_subsec;<br>
       return FileTimeT(Dur);<br>
     }<br>
   }<br>
<br>
-  template <class SubSecDurT, class SubSecT><br>
-  static bool set_times_checked(TimeT* sec_out, SubSecT* subsec_out,<br>
-                                FileTimeT tp) {<br>
+  template <class SubSecT><br>
+  static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool<br>
+  set_times_checked(TimeT* sec_out, SubSecT* subsec_out, FileTimeT tp) {<br>
     auto dur = tp.time_since_epoch();<br>
-    auto sec_dur = duration_cast<seconds>(dur);<br>
-    auto subsec_dur = duration_cast<SubSecDurT>(dur - sec_dur);<br>
+    auto sec_dur = duration_cast<fs_seconds>(dur)<wbr>;<br>
+    auto subsec_dur = duration_cast<fs_nanoseconds>(<wbr>dur - sec_dur);<br>
     // The tv_nsec and tv_usec fields must not be negative so adjust accordingly<br>
     if (subsec_dur.count() < 0) {<br>
       if (sec_dur.count() > min_seconds) {<br>
-        sec_dur -= seconds(1);<br>
-        subsec_dur += seconds(1);<br>
+        sec_dur -= fs_seconds(1);<br>
+        subsec_dur += fs_seconds(1);<br>
       } else {<br>
-        subsec_dur = SubSecDurT::zero();<br>
+        subsec_dur = fs_nanoseconds::zero();<br>
       }<br>
     }<br>
     return checked_set(sec_out, sec_dur.count()) &&<br>
            checked_set(subsec_out, subsec_dur.count());<br>
   }<br>
+  static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool convert_to_timespec(TimeSpecT& dest,<br>
+                                                                FileTimeT tp) {<br>
+    if (!is_representable(tp))<br>
+      return false;<br>
+    return set_times_checked(&dest.tv_<wbr>sec, &dest.tv_nsec, tp);<br>
+  }<br>
 };<br>
<br>
-} // namespace time_util<br>
-<br>
-<br>
-using TimeSpec = struct ::timespec;<br>
-using StatT = struct ::stat;<br>
-<br>
-using FSTime = time_util::fs_time_util<file_<wbr>time_type, time_t, struct timespec>;<br>
+using fs_time = time_util<file_time_type, time_t, TimeSpec>;<br>
<br>
 #if defined(__APPLE__)<br>
 TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }<br>
@@ -366,20 +389,18 @@ TimeSpec extract_mtime(StatT const& st)<br>
 TimeSpec extract_atime(StatT const& st) { return st.st_atim; }<br>
 #endif<br>
<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
-using TimeStruct = struct ::timeval;<br>
-using TimeStructArray = TimeStruct[2];<br>
-#else<br>
-using TimeStruct = TimeSpec;<br>
-using TimeStructArray = TimeStruct[2];<br>
-#endif<br>
-<br>
-bool SetFileTimes(const path& p, TimeStructArray const& TS,<br>
-                  error_code& ec) {<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
-  if (::utimes(p.c_str(), TS) == -1)<br>
+bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS,<br>
+                    error_code& ec) {<br>
+#if !defined(_LIBCPP_USE_<wbr>UTIMENSAT)<br>
+  using namespace chrono;<br>
+  auto Convert = [](long nsec) {<br>
+    return duration_cast<microseconds>(<wbr>nanoseconds(nsec)).count();<br>
+  };<br>
+  struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},<br>
+                                     {TS[1].tv_sec, Convert(TS[1].tv_nsec)}};<br></blockquote><div><br></div><div>This causes the '-Wc++11-narrowing' warning on Darwin:</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:15px;white-space:pre-wrap">filesystem_common.h:399:53: error: non-constant-expression cannot be narrowed from type 'long long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]
  struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},
                                                    ^~~~~~~~~~~~~~~~~~~~~~</span><br></div><div><font color="#333333" face="monospace"><span style="font-size:15px;white-space:pre-wrap">I'll work on a fix commit.</span></font></div><div> </div></div></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108m_6049084517487907175m_-944508710234176516m_-2737215435106245606h5"><div><div class="m_-4336734552882720456m_-1437840478281159422m_6121380529775480108h5">
+  if (::utimes(p.c_str(), ConvertedTS) == -1)<br>
 #else<br>
-  if (::utimensat(AT_FDCWD, p.c_str(), TS, 0) == -1)<br>
+  if (::utimensat(AT_FDCWD, p.c_str(), TS.data(), 0) == -1)<br>
 #endif<br>
   {<br>
     ec = capture_errno();<br>
@@ -388,25 +409,9 @@ bool SetFileTimes(const path& p, TimeStr<br>
   return false;<br>
 }<br>
<br>
-void SetTimeStructTo(TimeStruct& TS, TimeSpec ToTS) {<br>
-  using namespace chrono;<br>
-  TS.tv_sec = ToTS.tv_sec;<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
-  TS.tv_usec = duration_cast<microseconds>(<wbr>nanoseconds(ToTS.tv_nsec)).<wbr>count();<br>
-#else<br>
-  TS.tv_nsec = ToTS.tv_nsec;<br>
-#endif<br>
-}<br>
-<br>
-bool SetTimeStructTo(TimeStruct& TS, file_time_type NewTime) {<br>
-  using namespace chrono;<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
-  return !FSTime::set_times_checked<<wbr>microseconds>(&TS.tv_sec, &TS.tv_usec,<br>
-                                                  NewTime);<br>
-#else<br>
-  return !FSTime::set_times_checked<<wbr>nanoseconds>(&TS.tv_sec, &TS.tv_nsec,<br>
-                                                 NewTime);<br>
-#endif<br>
+bool set_time_spec_to(TimeSpec& TS, file_time_type NewTime) {<br>
+  return !fs_time::set_times_checked(<br>
+      &TS.tv_sec, &TS.tv_nsec, NewTime);<br>
 }<br>
<br>
 } // namespace<br>
<br>
Modified: libcxx/trunk/src/experimental/<wbr>filesystem/operations.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/operations.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/src/<wbr>experimental/filesystem/<wbr>operations.cpp?rev=337960&r1=<wbr>337959&r2=337960&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/src/experimental/<wbr>filesystem/operations.cpp (original)<br>
+++ libcxx/trunk/src/experimental/<wbr>filesystem/operations.cpp Wed Jul 25 13:51:49 2018<br>
@@ -23,6 +23,7 @@<br>
 #include <unistd.h><br>
 #include <sys/stat.h><br>
 #include <sys/statvfs.h><br>
+#include <time.h><br>
 #include <fcntl.h>  /* values for fchmodat */<br>
<br>
 #if defined(__linux__)<br>
@@ -36,6 +37,14 @@<br>
 # define _LIBCPP_USE_COPYFILE<br>
 #endif<br>
<br>
+#if !defined(__APPLE__)<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
+#endif<br>
+<br>
+#if !defined(CLOCK_REALTIME) || !defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME)<br>
+#include <sys/time.h> // for gettimeofday and timeval<br>
+#endif                // !defined(CLOCK_REALTIME)<br>
+<br>
 #if defined(_LIBCPP_COMPILER_GCC)<br>
 #if _GNUC_VER < 500<br>
 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"<br>
@@ -44,9 +53,6 @@<br>
<br>
 _LIBCPP_BEGIN_NAMESPACE_<wbr>EXPERIMENTAL_FILESYSTEM<br>
<br>
-filesystem_error::~<wbr>filesystem_error() {}<br>
-<br>
-<br>
 namespace { namespace parser<br>
 {<br>
<br>
@@ -355,7 +361,7 @@ private:<br>
   explicit FileDescriptor(const path* p, int fd = -1) : name(*p), fd(fd) {}<br>
 };<br>
<br>
-perms posix_get_perms(const struct ::stat& st) noexcept {<br>
+perms posix_get_perms(const StatT& st) noexcept {<br>
   return static_cast<perms>(st.st_mode) & perms::mask;<br>
 }<br>
<br>
@@ -364,8 +370,7 @@ perms posix_get_perms(const struct ::sta<br>
 }<br>
<br>
 file_status create_file_status(error_code& m_ec, path const& p,<br>
-                               const struct ::stat& path_stat,<br>
-                               error_code* ec) {<br>
+                               const StatT& path_stat, error_code* ec) {<br>
   if (ec)<br>
     *ec = m_ec;<br>
   if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) {<br>
@@ -400,8 +405,7 @@ file_status create_file_status(error_cod<br>
   return fs_tmp;<br>
 }<br>
<br>
-file_status posix_stat(path const& p, struct ::stat& path_stat,<br>
-                       error_code* ec) {<br>
+file_status posix_stat(path const& p, StatT& path_stat, error_code* ec) {<br>
   error_code m_ec;<br>
   if (::stat(p.c_str(), &path_stat) == -1)<br>
     m_ec = detail::capture_errno();<br>
@@ -409,12 +413,11 @@ file_status posix_stat(path const& p, st<br>
 }<br>
<br>
 file_status posix_stat(path const& p, error_code* ec) {<br>
-  struct ::stat path_stat;<br>
+  StatT path_stat;<br>
   return posix_stat(p, path_stat, ec);<br>
 }<br>
<br>
-file_status posix_lstat(path const& p, struct ::stat& path_stat,<br>
-                        error_code* ec) {<br>
+file_status posix_lstat(path const& p, StatT& path_stat, error_code* ec) {<br>
   error_code m_ec;<br>
   if (::lstat(p.c_str(), &path_stat) == -1)<br>
     m_ec = detail::capture_errno();<br>
@@ -422,7 +425,7 @@ file_status posix_lstat(path const& p, s<br>
 }<br>
<br>
 file_status posix_lstat(path const& p, error_code* ec) {<br>
-  struct ::stat path_stat;<br>
+  StatT path_stat;<br>
   return posix_lstat(p, path_stat, ec);<br>
 }<br>
<br>
@@ -464,10 +467,32 @@ file_status FileDescriptor::refresh_stat<br>
 using detail::capture_errno;<br>
 using detail::ErrorHandler;<br>
 using detail::StatT;<br>
+using detail::TimeSpec;<br>
 using parser::createView;<br>
 using parser::PathParser;<br>
 using parser::string_view_t;<br>
<br>
+const bool _FilesystemClock::is_steady;<br>
+<br>
+_FilesystemClock::time_point _FilesystemClock::now() noexcept {<br>
+  typedef chrono::duration<rep> __secs;<br>
+#if defined(_LIBCPP_USE_CLOCK_<wbr>GETTIME) && defined(CLOCK_REALTIME)<br>
+  typedef chrono::duration<rep, nano> __nsecs;<br>
+  struct timespec tp;<br>
+  if (0 != clock_gettime(CLOCK_REALTIME, &tp))<br>
+    __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");<br>
+  return time_point(__secs(tp.tv_sec) +<br>
+                    chrono::duration_cast<<wbr>duration>(__nsecs(tp.tv_nsec))<wbr>);<br>
+#else<br>
+  typedef chrono::duration<rep, micro> __microsecs;<br>
+  timeval tv;<br>
+  gettimeofday(&tv, 0);<br>
+  return time_point(__secs(tv.tv_sec) + __microsecs(tv.tv_usec));<br>
+#endif // _LIBCPP_USE_CLOCK_GETTIME && CLOCK_REALTIME<br>
+}<br>
+<br>
+filesystem_error::~<wbr>filesystem_error() {}<br>
+<br>
 void filesystem_error::__create_<wbr>what(int __num_paths) {<br>
   const char* derived_what = system_error::what();<br>
   __storage_->__what_ = [&]() -> string {<br>
@@ -525,14 +550,14 @@ void __copy(const path& from, const path<br>
   const bool sym_status2 = bool(options & copy_options::copy_symlinks);<br>
<br>
   error_code m_ec1;<br>
-  struct ::stat f_st = {};<br>
+  StatT f_st = {};<br>
   const file_status f = sym_status || sym_status2<br>
                             ? detail::posix_lstat(from, f_st, &m_ec1)<br>
                             : detail::posix_stat(from, f_st, &m_ec1);<br>
   if (m_ec1)<br>
     return err.report(m_ec1);<br>
<br>
-  struct ::stat t_st = {};<br>
+  StatT t_st = {};<br>
   const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec1)<br>
                                    : detail::posix_stat(to, t_st, &m_ec1);<br>
<br>
@@ -916,7 +941,7 @@ uintmax_t __file_size(const path& p, err<br>
   ErrorHandler<uintmax_t> err("file_size", ec, &p);<br>
<br>
   error_code m_ec;<br>
-  struct ::stat st;<br>
+  StatT st;<br>
   file_status fst = detail::posix_stat(p, st, &m_ec);<br>
   if (!exists(fst) || !is_regular_file(fst)) {<br>
     errc error_kind =<br>
@@ -966,14 +991,14 @@ bool __fs_is_empty(const path& p, error_<br>
<br>
 static file_time_type __extract_last_write_time(<wbr>const path& p, const StatT& st,<br>
                                                 error_code* ec) {<br>
-  using detail::FSTime;<br>
+  using detail::fs_time;<br>
   ErrorHandler<file_time_type> err("last_write_time", ec, &p);<br>
<br>
   auto ts = detail::extract_mtime(st);<br>
-  if (!FSTime::is_representable(ts)<wbr>)<br>
+  if (!fs_time::is_representable(<wbr>ts))<br>
     return err.report(errc::value_too_<wbr>large);<br>
<br>
-  return FSTime::convert_timespec(ts);<br>
+  return fs_time::convert_from_<wbr>timespec(ts);<br>
 }<br>
<br>
 file_time_type __last_write_time(const path& p, error_code *ec)<br>
@@ -992,30 +1017,27 @@ file_time_type __last_write_time(const p<br>
 void __last_write_time(const path& p, file_time_type new_time,<br>
                        error_code *ec)<br>
 {<br>
-    using namespace chrono;<br>
-    using namespace detail;<br>
-<br>
     ErrorHandler<void> err("last_write_time", ec, &p);<br>
<br>
     error_code m_ec;<br>
-    TimeStructArray tbuf;<br>
-#if !defined(_LIBCXX_USE_<wbr>UTIMENSAT)<br>
+    array<TimeSpec, 2> tbuf;<br>
+#if !defined(_LIBCPP_USE_<wbr>UTIMENSAT)<br>
     // This implementation has a race condition between determining the<br>
     // last access time and attempting to set it to the same value using<br>
     // ::utimes<br>
-    struct ::stat st;<br>
+    StatT st;<br>
     file_status fst = detail::posix_stat(p, st, &m_ec);<br>
-    if (m_ec && !status_known(fst))<br>
+    if (m_ec)<br>
       return err.report(m_ec);<br>
-    SetTimeStructTo(tbuf[0], detail::extract_atime(st));<br>
+    tbuf[0] = detail::extract_atime(st);<br>
 #else<br>
     tbuf[0].tv_sec = 0;<br>
     tbuf[0].tv_nsec = UTIME_OMIT;<br>
 #endif<br>
-    if (SetTimeStructTo(tbuf[1], new_time))<br>
-      return err.report(errc::invalid_<wbr>argument);<br>
+    if (detail::set_time_spec_to(<wbr>tbuf[1], new_time))<br>
+      return err.report(errc::value_too_<wbr>large);<br>
<br>
-    SetFileTimes(p, tbuf, m_ec);<br>
+    detail::set_file_times(p, tbuf, m_ec);<br>
     if (m_ec)<br>
       return err.report(m_ec);<br>
 }<br>
@@ -1591,7 +1613,7 @@ error_code directory_entry::__do_refresh<br>
   __data_.__reset();<br>
   error_code failure_ec;<br>
<br>
-  struct ::stat full_st;<br>
+  StatT full_st;<br>
   file_status st = detail::posix_lstat(__p_, full_st, &failure_ec);<br>
   if (!status_known(st)) {<br>
     __data_.__reset();<br>
<br>
Added: libcxx/trunk/src/include/<wbr>apple_availability.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/include/apple_availability.h?rev=337960&view=auto" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/src/<wbr>include/apple_availability.h?<wbr>rev=337960&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/src/include/<wbr>apple_availability.h (added)<br>
+++ libcxx/trunk/src/include/<wbr>apple_availability.h Wed Jul 25 13:51:49 2018<br>
@@ -0,0 +1,52 @@<br>
+//===------------------------ apple_availability.h ------------------------===//<br>
+//<br>
+//                     The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is dual licensed under the MIT and the University of Illinois Open<br>
+// Source Licenses. See LICENSE.TXT for details.<br>
+//<br>
+//===------------------------<wbr>------------------------------<wbr>----------------===//<br>
+#ifndef _LIBCPP_SRC_INCLUDE_APPLE_<wbr>AVAILABILITY_H<br>
+#define _LIBCPP_SRC_INCLUDE_APPLE_<wbr>AVAILABILITY_H<br>
+<br>
+#if defined(__APPLE__)<br>
+<br>
+#if defined(__ENVIRONMENT_MAC_OS_<wbr>X_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_MAC_OS_X_<wbr>VERSION_MIN_REQUIRED__ >= 101300<br>
+#define _LIBCPP_USE_UTIMENSAT<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_IPHONE_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_IPHONE_OS_<wbr>VERSION_MIN_REQUIRED__ >= 110000<br>
+#define _LIBCPP_USE_UTIMENSAT<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_TV_OS_<wbr>VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_TV_OS_VERSION_<wbr>MIN_REQUIRED__ >= 110000<br>
+#define _LIBCPP_USE_UTIMENSAT<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_WATCH_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_WATCH_OS_<wbr>VERSION_MIN_REQUIRED__ >= 40000<br>
+#define _LIBCPP_USE_UTIMENSAT<br>
+#endif<br>
+#endif // __ENVIRONMENT_.*_VERSION_MIN_<wbr>REQUIRED__<br>
+<br>
+#if defined(__ENVIRONMENT_MAC_OS_<wbr>X_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_MAC_OS_X_<wbr>VERSION_MIN_REQUIRED__ >= 101200<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_IPHONE_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_IPHONE_OS_<wbr>VERSION_MIN_REQUIRED__ >= 100000<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_TV_OS_<wbr>VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_TV_OS_VERSION_<wbr>MIN_REQUIRED__ >= 100000<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
+#endif<br>
+#elif defined(__ENVIRONMENT_WATCH_<wbr>OS_VERSION_MIN_REQUIRED__)<br>
+#if __ENVIRONMENT_WATCH_OS_<wbr>VERSION_MIN_REQUIRED__ >= 30000<br>
+#define _LIBCPP_USE_CLOCK_GETTIME<br>
+#endif<br>
+#endif // __ENVIRONMENT_.*_VERSION_MIN_<wbr>REQUIRED__<br>
+<br>
+#endif // __APPLE__<br>
+<br>
+#endif // _LIBCPP_SRC_INCLUDE_APPLE_<wbr>AVAILABILITY_H<br>
<br>
Modified: libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/class.<wbr>directory_entry/directory_<wbr>entry.mods/last_write_time.sh.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/filesystem/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/<wbr>libcxx/experimental/<wbr>filesystem/class.directory_<wbr>entry/directory_entry.mods/<wbr>last_write_time.sh.cpp?rev=<wbr>337960&r1=337959&r2=337960&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/class.<wbr>directory_entry/directory_<wbr>entry.mods/last_write_time.sh.<wbr>cpp (original)<br>
+++ libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/class.<wbr>directory_entry/directory_<wbr>entry.mods/last_write_time.sh.<wbr>cpp Wed Jul 25 13:51:49 2018<br>
@@ -41,9 +41,7 @@ TEST_CASE(last_write_time_not_<wbr>representa<br>
   ToTime.tv_sec = std::numeric_limits<decltype(<wbr>ToTime.tv_sec)>::max();<br>
   ToTime.tv_nsec = duration_cast<nanoseconds>(<wbr>seconds(1)).count() - 1;<br>
<br>
-  TimeStructArray TS;<br>
-  SetTimeStructTo(TS[0], ToTime);<br>
-  SetTimeStructTo(TS[1], ToTime);<br>
+  std::array<TimeSpec, 2> TS = {ToTime, ToTime};<br>
<br>
   file_time_type old_time = last_write_time(file);<br>
   directory_entry ent(file);<br>
@@ -57,9 +55,7 @@ TEST_CASE(last_write_time_not_<wbr>representa<br>
   file_time_type rep_value;<br>
   {<br>
     std::error_code ec;<br>
-    if (SetFileTimes(file, TS, ec)) {<br>
-      TEST_REQUIRE(false && "unsupported");<br>
-    }<br>
+    TEST_REQUIRE(!set_file_times(<wbr>file, TS, ec));<br>
     ec.clear();<br>
     rep_value = last_write_time(file, ec);<br>
     IsRepresentable = !bool(ec);<br>
@@ -82,7 +78,7 @@ TEST_CASE(last_write_time_not_<wbr>representa<br>
<br>
     ExceptionChecker CheckExcept(file, expected_err,<br>
                                  "directory_entry::last_write_<wbr>time");<br>
-    TEST_CHECK_THROW_RESULT(fs::<wbr>filesystem_error, CheckExcept,<br>
+    TEST_CHECK_THROW_RESULT(<wbr>filesystem_error, CheckExcept,<br>
                             ent.last_write_time());<br>
<br>
   } else {<br>
<br>
Modified: libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/<wbr>convert_file_time.sh.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/<wbr>libcxx/experimental/<wbr>filesystem/convert_file_time.<wbr>sh.cpp?rev=337960&r1=337959&<wbr>r2=337960&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/<wbr>convert_file_time.sh.cpp (original)<br>
+++ libcxx/trunk/test/libcxx/<wbr>experimental/filesystem/<wbr>convert_file_time.sh.cpp Wed Jul 25 13:51:49 2018<br>
@@ -25,15 +25,23 @@<br>
<br>
 #include "filesystem_common.h"<br>
<br>
+#ifndef __SIZEOF_INT128__<br>
+#define TEST_HAS_NO_INT128_T<br>
+#endif<br>
+<br>
 using namespace std::chrono;<br>
 namespace fs = std::experimental::filesystem;<br>
 using fs::file_time_type;<br>
-using fs::detail::time_util::fs_<wbr>time_util;<br>
+using fs::detail::time_util;<br>
+<br>
+#ifdef TEST_HAS_NO_INT128_T<br>
+static_assert(sizeof(fs::<wbr>file_time_type::rep) <= 8, "");<br>
+#endif<br>
<br>
-enum TestKind { TK_64Bit, TK_32Bit, TK_FloatingPoint };<br>
+enum TestKind { TK_128Bit, TK_64Bit, TK_32Bit, TK_FloatingPoint };<br>
<br>
-template <class FileTimeT, class TimeT, class TimeSpec><br>
-constexpr TestKind getTestKind() {<br>
+template <class TimeT><br>
+constexpr TestKind getTimeTTestKind() {<br>
   if (sizeof(TimeT) == 8 && !std::is_floating_point<TimeT><wbr>::value)<br>
     return TK_64Bit;<br>
   else if (sizeof(TimeT) == 4 && !std::is_floating_point<TimeT><wbr>::value)<br>
@@ -43,17 +51,99 @@ constexpr TestKind getTestKind() {<br>
   else<br>
     assert(false && "test kind not supported");<br>
 }<br>
+template <class FileTimeT><br>
+constexpr TestKind getFileTimeTestKind() {<br>
+  using Rep = typename FileTimeT::rep;<br>
+  if (std::is_floating_point<Rep>::<wbr>value)<br>
+    return TK_FloatingPoint;<br>
+  if (sizeof(Rep) == 16)<br>
+    return TK_128Bit;<br>
+  if (sizeof(Rep) == 8)<br>
+    return TK_64Bit;<br>
+  assert(false && "test kind not supported");<br>
+}<br>
<br>
 template <class FileTimeT, class TimeT, class TimeSpecT,<br>
-          class Base = fs_time_util<FileTimeT, TimeT, TimeSpecT>,<br>
-          TestKind = getTestKind<FileTimeT, TimeT, TimeSpecT>()><br>
-struct check_is_representable;<br>
+          class Base = time_util<FileTimeT, TimeT, TimeSpecT>,<br>
+          TestKind = getTimeTTestKind<TimeT>(),<br>
+          TestKind = getFileTimeTestKind<FileTimeT><wbr>()><br>
+struct test_case;<br>
<br>
 template <class FileTimeT, class TimeT, class TimeSpecT, class Base><br>
-struct check_is_representable<<wbr>FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit><br>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit><br>
     : public Base {<br>
<br>
-  using Base::convert_timespec;<br>
+  using Base::convert_from_timespec;<br>
+  using Base::convert_to_timespec;<br>
+  using Base::is_representable;<br>
+  using Base::max_nsec;<br>
+  using Base::max_seconds;<br>
+  using Base::min_nsec_timespec;<br>
+  using Base::min_seconds;<br>
+<br>
+  static constexpr auto max_time_t = std::numeric_limits<TimeT>::<wbr>max();<br>
+  static constexpr auto min_time_t = std::numeric_limits<TimeT>::<wbr>min();<br>
+<br>
+  static constexpr bool test_timespec() {<br>
+    static_assert(is_<wbr>representable(TimeSpecT{max_<wbr>time_t, 0}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{max_<wbr>time_t, 999999999}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{max_<wbr>time_t, 1000000000}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{max_<wbr>time_t, max_nsec}), "");<br>
+<br>
+    static_assert(is_<wbr>representable(TimeSpecT{min_<wbr>time_t, 0}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{min_<wbr>time_t, 999999999}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{min_<wbr>time_t, 1000000000}), "");<br>
+    static_assert(is_<wbr>representable(TimeSpecT{min_<wbr>time_t, min_nsec_timespec}),<br>
+                  "");<br>
+<br>
+    return true;<br>
+  }<br>
+<br>
+  static constexpr bool test_file_time_type() {<br>
+    // This kinda sucks. Oh well.<br>
+    static_assert(!Base::is_<wbr>representable(FileTimeT::max()<wbr>), "");<br>
+    static_assert(!Base::is_<wbr>representable(FileTimeT::min()<wbr>), "");<br>
+    return true;<br>
+  }<br>
+<br>
+  static constexpr bool check_round_trip(TimeSpecT orig) {<br>
+    TimeSpecT new_ts = {};<br>
+    FileTimeT out = convert_from_timespec(orig);<br>
+    assert(convert_to_timespec(<wbr>new_ts, out));<br>
+    return new_ts.tv_sec == orig.tv_sec && new_ts.tv_nsec == orig.tv_nsec;<br>
+  }<br>
+<br>
+  static constexpr bool test_convert_timespec() {<br>
+    static_assert(check_round_<wbr>trip({0, 0}), "");<br>
+    static_assert(check_round_<wbr>trip({0, 1}), "");<br>
+    static_assert(check_round_<wbr>trip({1, 1}), "");<br>
+    static_assert(check_round_<wbr>trip({-1, 1}), "");<br>
+    static_assert(check_round_<wbr>trip({max_time_t, max_nsec}), "");<br>
+    static_assert(check_round_<wbr>trip({max_time_t, 123}), "");<br>
+    static_assert(check_round_<wbr>trip({min_time_t, min_nsec_timespec}), "");<br>
+    static_assert(check_round_<wbr>trip({min_time_t, 123}), "");<br>
+    return true;<br>
+  }<br>
+<br>
+  static bool test() {<br>
+    static_assert(test_timespec(), "");<br>
+    static_assert(test_file_time_<wbr>type(), "");<br>
+    static_assert(test_convert_<wbr>timespec(), "");<br>
+    return true;<br>
+  }<br>
+};<br>
+<br>
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base><br>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_128Bit><br>
+    : public test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit> {<br>
+<br>
+};<br>
+<br>
+template <class FileTimeT, class TimeT, class TimeSpecT, class Base><br>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_64Bit><br>
+    : public Base {<br>
+<br>
+  using Base::convert_from_timespec;<br>
   using Base::is_representable;<br>
   using Base::max_nsec;<br>
   using Base::max_seconds;<br>
@@ -88,24 +178,25 @@ struct check_is_representable<<wbr>FileTimeT,<br>
   }<br>
<br>
   static constexpr bool test_convert_timespec() {<br>
-    static_assert(convert_<wbr>timespec(TimeSpecT{max_<wbr>seconds, max_nsec}) ==<br>
+    static_assert(convert_from_<wbr>timespec(TimeSpecT{max_<wbr>seconds, max_nsec}) ==<br>
                       FileTimeT::max(),<br>
                   "");<br>
-    static_assert(convert_<wbr>timespec(TimeSpecT{max_<wbr>seconds, max_nsec - 1}) <<br>
+    static_assert(convert_from_<wbr>timespec(TimeSpecT{max_<wbr>seconds, max_nsec - 1}) <<br>
                       FileTimeT::max(),<br>
                   "");<br>
-    static_assert(convert_<wbr>timespec(TimeSpecT{max_seconds - 1, 999999999}) <<br>
+    static_assert(convert_from_<wbr>timespec(TimeSpecT{max_seconds - 1, 999999999}) <<br>
                       FileTimeT::max(),<br>
                   "");<br>
-    static_assert(convert_<wbr>timespec(TimeSpecT{<br>
+    static_assert(convert_from_<wbr>timespec(TimeSpecT{<br>
                       min_seconds - 1, min_nsec_timespec}) == FileTimeT::min(),<br>
                   "");<br>
-    static_assert(<br>
-        convert_timespec(TimeSpecT{<wbr>min_seconds - 1, min_nsec_timespec + 1}) ><br>
-            FileTimeT::min(),<br>
-        "");<br>
-    static_assert(<br>
-        convert_timespec(TimeSpecT{<wbr>min_seconds, 0}) > FileTimeT::min(), "");<br>
+    static_assert(convert_from_<wbr>timespec(<br>
+                      TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}) ><br>
+                      FileTimeT::min(),<br>
+                  "");<br>
+    static_assert(convert_from_<wbr>timespec(TimeSpecT{min_<wbr>seconds, 0}) ><br>
+                      FileTimeT::min(),<br>
+                  "");<br>
     return true;<br>
   }<br>
<br>
@@ -118,12 +209,12 @@ struct check_is_representable<<wbr>FileTimeT,<br>
 };<br>
<br>
 template <class FileTimeT, class TimeT, class TimeSpecT, class Base><br>
-struct check_is_representable<<wbr>FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit><br>
+struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_64Bit><br>
     : public Base {<br>
   static constexpr auto max_time_t = std::numeric_limits<TimeT>::<wbr>max();<br>
   static constexpr auto min_time_t = std::numeric_limits<TimeT>::<wbr>min();<br>
<br>
-  using Base::convert_timespec;<br>
+  using Base::convert_from_timespec;<br>
   using Base::is_representable;<br>
   using Base::max_nsec;<br>
   using Base::max_seconds;<br>
@@ -158,9 +249,10 @@ struct check_is_representable<<wbr>FileTimeT,<br>
   }<br>
 };<br>
<br>
-template <class FileTimeT, class TimeT, class TimeSpec, class Base><br>
-struct check_is_representable<<wbr>FileTimeT, TimeT, TimeSpec, Base,<br>
-                              TK_FloatingPoint> : public Base {<br>
+template <class FileTimeT, class TimeT, class TimeSpec, class Base,<br>
+          TestKind FileTimeTKind><br>
+struct test_case<FileTimeT, TimeT, TimeSpec, Base, TK_FloatingPoint,<br>
+                 FileTimeTKind> : public Base {<br>
<br>
   static bool test() { return true; }<br>
 };<br>
@@ -182,19 +274,33 @@ struct TestClock {<br>
   static time_point now() noexcept { return {}; }<br>
 };<br>
<br>
-template <class IntType, class Dur = duration<IntType, std::micro> ><br>
-using TestFileTimeT = time_point<TestClock<Dur> >;<br>
+template <class IntType, class Period = std::micro><br>
+using TestFileTimeT = time_point<TestClock<duration<<wbr>IntType, Period> > >;<br>
<br>
 int main() {<br>
-  assert((<br>
-      check_is_representable<file_<wbr>time_type, time_t, struct timespec>::test()));<br>
-  assert((check_is_<wbr>representable<TestFileTimeT<<wbr>int64_t>, int64_t,<br>
-                                 TestTimeSpec<int64_t, long> >::test()));<br>
-  assert((check_is_<wbr>representable<TestFileTimeT<<wbr>long long>, int32_t,<br>
-                                 TestTimeSpec<int32_t, int32_t> >::test()));<br>
-<br>
-  // Test that insane platforms like ppc64 linux, which use long double as time_t,<br>
-  // at least compile.<br>
-  assert((check_is_<wbr>representable<TestFileTimeT<<wbr>long double>, double,<br>
-                                 TestTimeSpec<long double, long> >::test()));<br>
+  { assert((test_case<file_time_<wbr>type, time_t, struct timespec>::test())); }<br>
+  {<br>
+    assert((test_case<<wbr>TestFileTimeT<int64_t>, int64_t,<br>
+                      TestTimeSpec<int64_t, long> >::test()));<br>
+  }<br>
+  {<br>
+    assert((test_case<<wbr>TestFileTimeT<long long>, int32_t,<br>
+                      TestTimeSpec<int32_t, int32_t> >::test()));<br>
+  }<br>
+  {<br>
+    // Test that insane platforms like ppc64 linux, which use long double as time_t,<br>
+    // at least compile.<br>
+    assert((test_case<<wbr>TestFileTimeT<long double>, double,<br>
+                      TestTimeSpec<long double, long> >::test()));<br>
+  }<br>
+#ifndef TEST_HAS_NO_INT128_T<br>
+  {<br>
+    assert((test_case<<wbr>TestFileTimeT<__int128_t, std::nano>, int64_t,<br>
+                      TestTimeSpec<int64_t, long> >::test()));<br>
+  }<br>
+  {<br>
+    assert((test_case<<wbr>TestFileTimeT<__int128_t, std::nano>, int32_t,<br>
+                      TestTimeSpec<int32_t, int32_t> >::test()));<br>
+  }<br>
+#endif<br>
 }<br>
<br>
Modified: libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.<wbr>filesystem.synopsis/file_time_<wbr>type.pass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.<wbr>filesystem.synopsis/file_time_<wbr>type.pass.cpp?rev=337960&r1=<wbr>337959&r2=337960&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.<wbr>filesystem.synopsis/file_time_<wbr>type.pass.cpp (original)<br>
+++ libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.<wbr>filesystem.synopsis/file_time_<wbr>type.pass.cpp Wed Jul 25 13:51:49 2018<br>
@@ -17,15 +17,30 @@<br>
 #include <chrono><br>
 #include <type_traits><br>
<br>
+#include "test_macros.h"<br>
+<br>
 // system_clock is used because it meets the requirements of TrivialClock,<br>
 // and the resolution and range of system_clock should match the operating<br>
 // system's file time type.<br>
-typedef std::chrono::system_clock              ExpectedClock;<br>
-typedef std::chrono::time_point<<wbr>ExpectedClock> ExpectedTimePoint;<br>
+<br>
+void test_trivial_clock() {<br>
+  using namespace fs;<br>
+  using Clock = file_time_type::clock;<br>
+  ASSERT_NOEXCEPT(Clock::now());<br>
+  ASSERT_SAME_TYPE(decltype(<wbr>Clock::now()), file_time_type);<br>
+  ASSERT_SAME_TYPE(Clock::time_<wbr>point, file_time_type);<br>
+  volatile auto* odr_use = &Clock::is_steady;<br>
+  ((void)odr_use);<br>
+}<br>
+<br>
+void test_time_point_resolution_<wbr>and_range() {<br>
+  using namespace fs;<br>
+  using Dur = file_time_type::duration;<br>
+  using Period = Dur::period;<br>
+  ASSERT_SAME_TYPE(Period, std::nano);<br>
+}<br>
<br>
 int main() {<br>
-  static_assert(std::is_same<<br>
-          fs::file_time_type,<br>
-          ExpectedTimePoint<br>
-      >::value, "");<br>
+  test_trivial_clock();<br>
+  test_time_point_resolution_<wbr>and_range();<br>
 }<br>
<br>
Modified: libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.op.<wbr>funcs/fs.op.last_write_time/<wbr>last_write_time.pass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp?rev=337960&r1=337959&r2=337960&view=diff" rel="noreferrer noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.op.<wbr>funcs/fs.op.last_write_time/<wbr>last_write_time.pass.cpp?rev=<wbr>337960&r1=337959&r2=337960&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.op.<wbr>funcs/fs.op.last_write_time/<wbr>last_write_time.pass.cpp (original)<br>
+++ libcxx/trunk/test/std/<wbr>experimental/filesystem/fs.op.<wbr>funcs/fs.op.last_write_time/<wbr>last_write_time.pass.cpp Wed Jul 25 13:51:49 2018<br>
@@ -30,13 +30,86 @@<br>
 #include <sys/stat.h><br>
 #include <iostream><br>
<br>
+#include <fcntl.h><br>
+#include <sys/time.h><br>
+<br>
 using namespace fs;<br>
<br>
-struct Times { std::time_t access, write; };<br>
+using TimeSpec = struct ::timespec;<br>
+using StatT = struct ::stat;<br>
+<br>
+using Sec = std::chrono::duration<file_<wbr>time_type::rep>;<br>
+using Hours = std::chrono::hours;<br>
+using Minutes = std::chrono::minutes;<br>
+using MicroSec = std::chrono::duration<file_<wbr>time_type::rep, std::micro>;<br>
+using NanoSec = std::chrono::duration<file_<wbr>time_type::rep, std::nano>;<br>
+using std::chrono::duration_cast;<br>
+<br>
+#if defined(__APPLE__)<br>
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }<br>
+TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }<br>
+#else<br>
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }<br>
+TimeSpec extract_atime(StatT const& st) { return st.st_atim; }<br>
+#endif<br>
+<br>
+bool ConvertToTimeSpec(TimeSpec& ts, file_time_type ft) {<br>
+  using SecFieldT = decltype(TimeSpec::tv_sec);<br>
+  using NSecFieldT = decltype(TimeSpec::tv_nsec);<br>
+  using SecLim = std::numeric_limits<SecFieldT><wbr>;<br>
+  using NSecLim = std::numeric_limits<<wbr>NSecFieldT>;<br>
+<br>
+  auto secs = duration_cast<Sec>(ft.time_<wbr>since_epoch());<br>
+  auto nsecs = duration_cast<NanoSec>(ft.<wbr>time_since_epoch() - secs);<br>
+  if (nsecs.count() < 0) {<br>
+    if (Sec::min().count() > SecLim::min()) {<br>
+      secs += Sec(1);<br>
+      nsecs -= Sec(1);<br>
+    } else {<br>
+      nsecs = NanoSec(0);<br>
+    }<br>
+  }<br>
+  if (SecLim::max() < secs.count() || SecLim::min() > secs.count())<br>
+    return false;<br>
+  if (NSecLim::max() < nsecs.count() || NSecLim::min() > nsecs.count())<br>
+    return false;<br>
+  ts.tv_sec = secs.count();<br>
+  ts.tv_nsec = nsecs.count();<br>
+  return true;<br>
+}<br>
+<br>
+bool ConvertFromTimeSpec(file_time_<wbr>type& ft, TimeSpec ts) {<br>
+  auto secs_part = duration_cast<file_time_type::<wbr>duration>(Sec(ts.tv_sec));<br>
+  if (duration_cast<Sec>(secs_part)<wbr>.count() != ts.tv_sec)<br>
+    return false;<br>
+  auto subsecs = duration_cast<file_time_type::<wbr>duration>(NanoSec(ts.tv_nsec))<wbr>;<br>
+  auto dur = secs_part + subsecs;<br>
+  if (dur < secs_part && subsecs.count() >= 0)<br>
+    return false;<br>
+  ft = file_time_type(dur);<br>
+  return true;<br>
+}<br>
+<br>
+bool CompareTimeExact(TimeSpec ts, TimeSpec ts2) {<br>
+  return ts2.tv_sec == ts.tv_sec && ts2.tv_nsec == ts.tv_nsec;<br>
+}<br>
+bool CompareTimeExact(file_time_<wbr>type ft, TimeSpec ts) {<br>
+  TimeSpec ts2 </div></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></blockquote></div>
</blockquote></div><br></div>