File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ find_package(GSasl)
5151find_package (Threads)
5252
5353include (CheckCXXSourceCompiles)
54+ include (CheckSymbolExists)
5455
5556# Download and build gtest
5657configure_file (CMakeLists-gtest.txt.in googletest-download/CMakeLists.txt)
@@ -168,6 +169,11 @@ else (NOT NO_SASL)
168169 message (STATUS "Compiling with NO SASL SUPPORT" )
169170endif (NOT NO_SASL)
170171
172+ check_symbol_exists(explicit_bzero "string.h" HAVE_EXPLICIT_BZERO)
173+ if (HAVE_EXPLICIT_BZERO)
174+ add_definitions (-DHAVE_EXPLICIT_BZERO)
175+ endif ()
176+
171177add_definitions (-DASIO_STANDALONE -DASIO_CPP11_DATE_TIME)
172178
173179# Disable optimizations if compiling debug
Original file line number Diff line number Diff line change @@ -47,7 +47,12 @@ bool XPlatform::Syscall::WriteToStdoutImpl(const char* message) {
4747void XPlatform::Syscall::ClearBufferSafely (void * buffer,
4848 const size_t sz_bytes) {
4949 if (buffer != nullptr ) {
50+ #ifdef HAVE_EXPLICIT_BZERO
5051 explicit_bzero (buffer, sz_bytes);
52+ #else
53+ // fallback to bzero
54+ bzero (buffer, sz_bytes);
55+ #endif
5156 }
5257}
5358
You can’t perform that action at this time.
0 commit comments