2023-11-17 23:53:40 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-09-27 15:45:31 -07:00
|
|
|
#include "common/watchdog.h"
|
|
|
|
#include "common/util.h"
|
2025-01-29 09:09:58 +00:00
|
|
|
#include "system/hardware/hw.h"
|
2023-09-27 15:45:31 -07:00
|
|
|
|
2025-01-29 09:09:58 +00:00
|
|
|
const std::string watchdog_fn_prefix = Path::shm_path() + "/wd_"; // + <pid>
|
2023-09-27 15:45:31 -07:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|