mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
* No /dev/shm on MacOS so we go to tmp instead given that the /dev/shm makes tests not really work fine on mac * Cleanups Fix cereal messaging tests * keep msgq stock More shm updates for macos * typo * fix return * Semicolon...
13 lines
374 B
C++
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;
|
|
}
|