abstract access to highres atime/mtime

This commit is contained in:
Antonio SJ Musumeci 2017-04-06 22:16:17 -04:00
parent 292b850e07
commit 0b2bf17cd7
3 changed files with 72 additions and 8 deletions

View file

@ -25,6 +25,8 @@
# include "fs_base_utime_generic.hpp"
#endif
#include "fs_base_stat.hpp"
namespace fs
{
static
@ -35,8 +37,8 @@ namespace fs
{
struct timespec times[2];
times[0] = st.st_atim;
times[1] = st.st_mtim;
times[0] = *fs::stat_atime(st);
times[1] = *fs::stat_mtime(st);
return fs::utime(AT_FDCWD,path,times,0);
}
@ -49,8 +51,8 @@ namespace fs
{
struct timespec times[2];
times[0] = st.st_atim;
times[1] = st.st_mtim;
times[0] = *fs::stat_atime(st);
times[1] = *fs::stat_mtime(st);
return fs::utime(fd,times);
}