Skip to content

Commit

Permalink
Rocksdb: Add initial OpenBSD support
Browse files Browse the repository at this point in the history
  • Loading branch information
brad0 authored and grooverdan committed Oct 26, 2022
1 parent 77951dd commit 055cb3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions storage/rocksdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ ADD_DEPENDENCIES(rocksdb_aux_lib GenError)

# MARIAROCKS-TODO: how to properly depend on -lrt ?
TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
TARGET_LINK_LIBRARIES(rocksdb_aux_lib ${ATOMIC_EXTRA_LIBS})
Expand Down Expand Up @@ -259,7 +259,7 @@ ENDIF()
# ADD_SUBDIRECTORY(unittest)
#ENDIF()

if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
endif()

Expand Down
10 changes: 5 additions & 5 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Rdb_cf_manager cf_manager;
Rdb_ddl_manager ddl_manager;
Rdb_binlog_manager binlog_manager;

#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
Rdb_io_watchdog *io_watchdog = nullptr;
#endif
/**
Expand Down Expand Up @@ -844,7 +844,7 @@ static void rocksdb_set_io_write_timeout(
void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
DBUG_ASSERT(save != nullptr);
DBUG_ASSERT(rdb != nullptr);
#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
DBUG_ASSERT(io_watchdog != nullptr);
#endif

Expand All @@ -853,7 +853,7 @@ static void rocksdb_set_io_write_timeout(
const uint32_t new_val = *static_cast<const uint32_t *>(save);

rocksdb_io_write_timeout_secs = new_val;
#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
Expand Down Expand Up @@ -5768,7 +5768,7 @@ static int rocksdb_init_func(void *const p) {
directories.push_back(myrocks::rocksdb_wal_dir);
}

#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
io_watchdog = new Rdb_io_watchdog(std::move(directories));
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif
Expand Down Expand Up @@ -5875,7 +5875,7 @@ static int rocksdb_done_func(void *const p) {
delete commit_latency_stats;
commit_latency_stats = nullptr;

#if !defined(_WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
delete io_watchdog;
io_watchdog = nullptr;
#endif
Expand Down

0 comments on commit 055cb3f

Please sign in to comment.