mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-29 10:32:10 +08:00
6d316f2bc7
date: 2024-06-11T01:36:39 master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
12 lines
331 B
C++
12 lines
331 B
C++
#include <string>
|
|
|
|
#include "common/watchdog.h"
|
|
#include "common/util.h"
|
|
|
|
const std::string watchdog_fn_prefix = "/dev/shm/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;
|
|
}
|