Skip to content

Instantly share code, notes, and snippets.

Twocanoes Software, Inc twocanoes

Block or report user

Report or block twocanoes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@landonf
landonf / watchdog.c
Last active Dec 25, 2015
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.