CHECK_TYPE_SIZE(__s8 __S8)
CHECK_TYPE_SIZE(__s16 __S16)
CHECK_TYPE_SIZE(__s32 __S32)
-CHECK_TYPE_SIZE(__s64 __S64)
+CHECK_TYPE_SIZE(__s64 __S64)
+set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h")
+CHECK_TYPE_SIZE("struct msghdr" MSGHDR)
unset(CMAKE_EXTRA_INCLUDE_FILES)
include(CheckSymbolExists)
Graylog.cc
HTMLFormatter.cc
HeartbeatMap.cc
- Journald.cc
LogClient.cc
LogEntry.cc
ostream_temp.cc
util.cc
version.cc)
+if(HAVE_MSGHDR)
+ list(APPEND common_srcs
+ Journald.cc)
+endif()
+
if(WITH_CEPH_DEBUG_MUTEX)
list(APPEND common_srcs
lockdep.cc
#ifndef CEPH_COMMON_JOURNALD_H
#define CEPH_COMMON_JOURNALD_H
+#include "acconfig.h"
#include <memory>
#include <sys/types.h>
#include <sys/socket.h>
struct LogEntry;
-namespace ceph {
+namespace ceph::logging {
-namespace logging {
+#ifdef HAVE_MSGHDR
namespace detail {
+
class EntryEncoder;
class LogEntryEncoder;
std::unique_ptr<detail::LogEntryEncoder> m_log_entry_encoder;
};
-}
-}
+#else // HAVE_MSGHDR
+
+class JournaldLogger {
+public:
+ JournaldLogger(const SubsystemMap *) {}
+ int log_entry(const Entry &) {
+ return 0;
+ }
+};
+
+class JournaldClusterLogger {
+public:
+ int log_log_entry(const LogEntry &le) {
+ return 0;
+ }
+};
+
+#endif // HAVE_MSGHDR
+
+} // ceph::logging
#endif
/* Define to 1 if the system has the type `__u8'. */
#cmakedefine HAVE___U8 1
+/* Define to 1 if the system has the type `msghdr` */
+#cmakedefine HAVE_MSGHDR 1
+
/* Define if you have res_nquery */
#cmakedefine HAVE_RES_NQUERY
target_link_libraries(ceph_bench_log rt)
endif()
-add_executable(ceph_bench_journald_logger
- bench_journald_logger.cc
- )
-target_link_libraries(ceph_bench_journald_logger ceph-common)
+if(HAVE_MSGHDR)
+ add_executable(ceph_bench_journald_logger
+ bench_journald_logger.cc)
+ target_link_libraries(ceph_bench_journald_logger ceph-common)
+endif()
# ceph_test_mutate
add_executable(ceph_test_mutate
add_executable(unittest_allocate_unique test_allocate_unique.cc)
add_ceph_unittest(unittest_allocate_unique)
-add_executable(unittest_journald_logger test_journald_logger.cc)
-target_link_libraries(unittest_journald_logger ceph-common)
-add_ceph_unittest(unittest_journald_logger)
+if(HAVE_MSGHDR)
+ add_executable(unittest_journald_logger test_journald_logger.cc)
+ target_link_libraries(unittest_journald_logger ceph-common)
+ add_ceph_unittest(unittest_journald_logger)
+endif()