From e8ee850deeea0d0b355966740990d7ddc49e9844 Mon Sep 17 00:00:00 2001 From: rohith-raju Date: Wed, 28 Jun 2023 09:22:29 +0000 Subject: [PATCH] update(ci,cmake): add support for emscripten build Signed-off-by: rohith-raju --- unit_tests/CMakeLists.txt | 2 +- userspace/falco/stats_writer.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index c0444a61..a00fc64a 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -36,7 +36,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") list(APPEND FALCO_UNIT_TESTS_SOURCES falco/test_atomic_signal_handler.cpp falco/app/actions/test_configure_interesting_sets.cpp - falco/app/actions/test_configure_syscall_buffer.cpp) + falco/app/actions/test_configure_syscall_buffer_num.cpp) endif() set(FALCO_UNIT_TESTS_INCLUDES diff --git a/userspace/falco/stats_writer.cpp b/userspace/falco/stats_writer.cpp index b6719a82..e1215dda 100644 --- a/userspace/falco/stats_writer.cpp +++ b/userspace/falco/stats_writer.cpp @@ -57,19 +57,22 @@ bool stats_writer::init_ticker(uint32_t interval_msec, std::string &err) sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = SIGALRM; sev.sigev_value.sival_ptr = &timerid; +#ifndef __EMSCRIPTEN__ if (timer_create(CLOCK_MONOTONIC, &sev, &timerid) == -1) { err = std::string("Could not create periodic timer: ") + strerror(errno); return false; } +#endif timer.it_value.tv_sec = interval_msec / 1000; timer.it_value.tv_nsec = (interval_msec % 1000) * 1000 * 1000; timer.it_interval = timer.it_value; +#ifndef __EMSCRIPTEN__ if (timer_settime(timerid, 0, &timer, NULL) == -1) { err = std::string("Could not set up periodic timer: ") + strerror(errno); return false; } - +#endif return true; }