File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ add_benchmark(adjacent_difference src/adjacent_difference.cpp)
110
110
add_benchmark (bitset_from_string src/bitset_from_string.cpp )
111
111
add_benchmark (bitset_to_string src/bitset_to_string.cpp )
112
112
add_benchmark (efficient_nonlocking_print src/efficient_nonlocking_print.cpp )
113
+ add_benchmark (filesystem src/filesystem.cpp )
113
114
add_benchmark (find_and_count src/find_and_count.cpp )
114
115
add_benchmark (find_first_of src/find_first_of.cpp )
115
116
add_benchmark (iota src/iota.cpp )
Original file line number Diff line number Diff line change
1
+ // Copyright (c) Microsoft Corporation.
2
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3
+
4
+ #include < benchmark/benchmark.h>
5
+ #include < filesystem>
6
+ #include < system_error>
7
+
8
+ void symlink_status (benchmark::State& state) {
9
+ const auto path = std::filesystem::temp_directory_path ();
10
+
11
+ for (auto _ : state) {
12
+ std::error_code ec;
13
+ benchmark::DoNotOptimize (path);
14
+ const auto status = std::filesystem::symlink_status (path, ec);
15
+ benchmark::DoNotOptimize (status);
16
+ benchmark::DoNotOptimize (ec);
17
+ }
18
+ }
19
+
20
+ BENCHMARK (symlink_status);
21
+
22
+ BENCHMARK_MAIN ();
Original file line number Diff line number Diff line change @@ -900,6 +900,13 @@ namespace {
900
900
901
901
_Flags &= ~_Get_file_attributes_data;
902
902
}
903
+
904
+ if (!_STD _Bitmask_includes_any (_Attributes, __std_fs_file_attr::_Reparse_point)
905
+ && _STD _Bitmask_includes_any (_Flags, __std_fs_stats_flags::_Reparse_tag)) {
906
+ // if reparse tag is requested by caller but the file is not a reparse point, set tag to _None
907
+ _Stats->_Reparse_point_tag = __std_fs_reparse_tag::_None;
908
+ _Flags &= ~__std_fs_stats_flags::_Reparse_tag;
909
+ }
903
910
}
904
911
}
905
912
You can’t perform that action at this time.
0 commit comments