Skip to content

Instantly share code, notes, and snippets.


Twocanoes Software, Inc twocanoes

View GitHub Profile
landonf / watchdog.c
Last active Oct 4, 2020
Enables OS X's hardware watchdog.
View watchdog.c
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <dispatch/dispatch.h>
// 5 minutes
#define TIMEOUT (5*60)
bool reset_watchdog (int timeout) {
io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOWatchDogTimer"));
if (service == IO_OBJECT_NULL) {
You can’t perform that action at this time.