mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-01 06:37:22 +00:00
update(ci,cmake): add support for emscripten build
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
list(APPEND FALCO_UNIT_TESTS_SOURCES
|
list(APPEND FALCO_UNIT_TESTS_SOURCES
|
||||||
falco/test_atomic_signal_handler.cpp
|
falco/test_atomic_signal_handler.cpp
|
||||||
falco/app/actions/test_configure_interesting_sets.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()
|
endif()
|
||||||
|
|
||||||
set(FALCO_UNIT_TESTS_INCLUDES
|
set(FALCO_UNIT_TESTS_INCLUDES
|
||||||
|
@@ -57,19 +57,22 @@ bool stats_writer::init_ticker(uint32_t interval_msec, std::string &err)
|
|||||||
sev.sigev_notify = SIGEV_SIGNAL;
|
sev.sigev_notify = SIGEV_SIGNAL;
|
||||||
sev.sigev_signo = SIGALRM;
|
sev.sigev_signo = SIGALRM;
|
||||||
sev.sigev_value.sival_ptr = &timerid;
|
sev.sigev_value.sival_ptr = &timerid;
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
if (timer_create(CLOCK_MONOTONIC, &sev, &timerid) == -1) {
|
if (timer_create(CLOCK_MONOTONIC, &sev, &timerid) == -1) {
|
||||||
err = std::string("Could not create periodic timer: ") + strerror(errno);
|
err = std::string("Could not create periodic timer: ") + strerror(errno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
timer.it_value.tv_sec = interval_msec / 1000;
|
timer.it_value.tv_sec = interval_msec / 1000;
|
||||||
timer.it_value.tv_nsec = (interval_msec % 1000) * 1000 * 1000;
|
timer.it_value.tv_nsec = (interval_msec % 1000) * 1000 * 1000;
|
||||||
timer.it_interval = timer.it_value;
|
timer.it_interval = timer.it_value;
|
||||||
|
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
if (timer_settime(timerid, 0, &timer, NULL) == -1) {
|
if (timer_settime(timerid, 0, &timer, NULL) == -1) {
|
||||||
err = std::string("Could not set up periodic timer: ") + strerror(errno);
|
err = std::string("Could not set up periodic timer: ") + strerror(errno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user