mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 00:32:11 +08:00
c5825aed76
date: 2022-07-14T00:06:12 master commit: 5a7c2f90361e72e9c35e88abd2e11acdc4aba354
10 lines
312 B
C++
10 lines
312 B
C++
#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;
|
|
}
|