mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 01:42:05 +08:00
b2f2dabe71
date: 2023-11-17T23:53:40
master commit: d3aad9ca46
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;
|
|
}
|