diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2018-11-26 00:03:39 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2018-11-26 00:03:39 +0000 |
| commit | 5167c1389b5b52ab68a40debebbace19d03554bf (patch) | |
| tree | 74f3764903b4c897033af90dff2bc4335722dc7c /llvm/cmake | |
| parent | de314b39cf4be0544efb5afbb3831187eb3da888 (diff) | |
| download | bcm5719-llvm-5167c1389b5b52ab68a40debebbace19d03554bf.tar.gz bcm5719-llvm-5167c1389b5b52ab68a40debebbace19d03554bf.zip | |
[Support/FileSystem] Add sub-second precision for atime/mtime of sys::fs::file_status on unix platforms
Summary:
getLastAccessedTime() and getLastModificationTime() provided times in nanoseconds but with only 1 second resolution, even when the underlying file system could provide more precise times than that.
These changes add sub-second precision for unix platforms that support improved precision.
Also add some comments to make sure people are aware that the resolution of times can vary across different file systems.
Reviewers: labath, zturner, aaron.ballman, kristina
Reviewed By: aaron.ballman, kristina
Subscribers: lebedev.ri, mgorny, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D54826
llvm-svn: 347530
Diffstat (limited to 'llvm/cmake')
| -rw-r--r-- | llvm/cmake/config-ix.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 4bf2a9e9112..900c35ee4f0 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -7,6 +7,7 @@ include(CheckIncludeFile) include(CheckLibraryExists) include(CheckSymbolExists) include(CheckFunctionExists) +include(CheckStructHasMember) include(CheckCCompilerFlag) include(CheckCompilerVersion) @@ -248,6 +249,11 @@ if( HAVE_DLFCN_H ) endif() endif() +CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC) +CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) + check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC) if( LLVM_USING_GLIBC ) add_definitions( -D_GNU_SOURCE ) |

