Section: Linux Simple I/O Library (2)
Updated: 21 December 2018
Index Return to Main Contents


libwatchdog -- Linux Simple I/O Library: Watchdog Timer Module  


#include <libsimpleio/libwatchdog.h>

void WATCHDOG_open(const char *name, int32_t *fd, int32_t *error);

void WATCHDOG_close(int32_t fd, int32_t *error);

void WATCHDOG_get_timeout(int32_t fd, int32_t *timeout, int32_t *error);

void WATCHDOG_set_timeout(int32_t fd, int32_t newtimeout,
   int32_t *timeout, int32_t *error);

void WATCHDOG_kick(int32_t fd, int32_t *error);

Link with -lsimpleio.  


All functions return either 0 (upon success) or an errno value (upon failure) in *error.

WATCHDOG_open() opens a watchdog timer device. The device node name, usually /dev/watchdog, must be passed in the name parameter. Upon success, a file descriptor for the watchdog timer device is returned in *fd.

WATCHDOG_close() closes a previously opened watchdog timer device. Note that this may result in watchdog timer expiration and subsequent system reset.

WATCHDOG_get_timeout() may be used to discover the current watchdog timeout period. Upon success, the watchdog period in seconds will be returned in *timeout.

WATCHDOG_set_timeout() may be used to change the watchdog timeout period. The requested new timeout period in seconds must be passed in newtimeout. Upon success, the actual new watchdog period in seconds will be returned in *timeout. Note that the new watchdog period may be different from that requested. For example, if the watchdog timer device has a granularity of one minute, requesting a timeout of 45 seconds will result in an actual timeout of 60 seconds. Also note that the particular watchdog timer device may not allow increasing the timeout or may not allow changing it at all.

WATCHDOG_kick() may be used to reset the watchdog timer.  


libsimpleio(2), libadc(2), libdac(2), libevent(2), libgpio(2),
libhidraw(2), libi2c(2), libipv4(2), liblinux(2), liblinx(2),
libpwm(2), libserial(2), libspi(2), libstream(2)  


Philip Munts, President, Munts AM Corp dba Munts Technologies




This document was created by man2html, using the manual pages.
Time: 15:36:00 GMT, November 08, 2020