Files
onepilot/common/watchdog.cc
Adeeb Shihadeh ba7f7fd7a6 0.9.8 hotfixes
2025-04-07 12:42:46 -07:00

13 lines
374 B
C++

#include <string>
#include "common/watchdog.h"
#include "common/util.h"
#include "system/hardware/hw.h"
const std::string watchdog_fn_prefix = Path::shm_path() + "/wd_"; // + <pid>
bool watchdog_kick(uint64_t ts) {
static std::string fn = watchdog_fn_prefix + std::to_string(getpid());
return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) > 0;
}