mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 15:36:31 -05:00
abstract access to highres atime/mtime
This commit is contained in:
parent
292b850e07
commit
0b2bf17cd7
3 changed files with 72 additions and 8 deletions
|
|
@ -62,6 +62,56 @@ namespace fs
|
|||
{
|
||||
return ::fstat(fd,&st);
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
timespec *
|
||||
stat_atime(struct stat &st)
|
||||
{
|
||||
#if __APPLE__
|
||||
return &st.st_atimespec;
|
||||
#else
|
||||
return &st.st_atim;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
const
|
||||
timespec *
|
||||
stat_atime(const struct stat &st)
|
||||
{
|
||||
#if __APPLE__
|
||||
return &st.st_atimespec;
|
||||
#else
|
||||
return &st.st_atim;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
timespec *
|
||||
stat_mtime(struct stat &st)
|
||||
{
|
||||
#if __APPLE__
|
||||
return &st.st_mtimespec;
|
||||
#else
|
||||
return &st.st_mtim;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
inline
|
||||
const
|
||||
timespec *
|
||||
stat_mtime(const struct stat &st)
|
||||
{
|
||||
#if __APPLE__
|
||||
return &st.st_mtimespec;
|
||||
#else
|
||||
return &st.st_mtim;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue