Eris Linux A.P.I. 0.1
API to access Eris Linux system from a custom container
Loading...
Searching...
No Matches
WATCHDOG

System watchdog related methods. More...

Functions

int eris_feed_watchdog (void)
 Refresh the watchdog timer.
int eris_disable_watchdog (void)
 Disable the watchdog timer.
int eris_get_watchdog_delay (void)
 Read the watchdog delay.
int eris_set_watchdog_delay (int delay)
 Set the watchdog delay.
int eris_start_watchdog_feeder (void)
 Start the automatic watchdog feeder.
int eris_stop_watchdog_feeder (void)
 Stop the automatic watchdog feeder.
int eris_watchdog_feeder_status (char *buffer, size_t size)
 Get the automatic watchdog feeder status.

Detailed Description

System watchdog related methods.

A watchdog is a physical (if possible) or logical (otherwise) device that once initialized must be refreshed regularly or it will automatically reboot the system.

This is very useful on embedded systems to avoid devices that stay in an unusable state after a crash.

The functions of this group allow you to read or set the delay (in seconds) before reboot, and to refresh the watchdog thus resetting the reboot timer.

Function Documentation

◆ eris_disable_watchdog()

int eris_disable_watchdog ( void )

Disable the watchdog timer.

This function disable the watchdog timer. This is useful during development stage, but probably dangerous on deployed systems.

Returns
0 on success, -1 on error and errno is set appropriately.

◆ eris_feed_watchdog()

int eris_feed_watchdog ( void )

Refresh the watchdog timer.

This function reset the watchdog timer allowing delay seconds before rebooting the system (delay beeing the number of seconds set by eris_set_watchdog_delay().

Some people use the expression "kick the watchdog", but we like dogs (and other animals) and refuse to use it.

Returns
0 on success, -1 on error and errno is set appropriately.

◆ eris_get_watchdog_delay()

int eris_get_watchdog_delay ( void )

Read the watchdog delay.

This function returns the number of seconds between a watchdog refresh and system reboot.

Returns
the delay on success, -1 on error and errno is set appropriately.

◆ eris_set_watchdog_delay()

int eris_set_watchdog_delay ( int delay)

Set the watchdog delay.

This function configures the watchdog, then starts it.

Parameters
delaydelay in seconds before reboot (must be in [1-48])
Returns
0 on success, -1 on error and errno is set appropriately.

◆ eris_start_watchdog_feeder()

int eris_start_watchdog_feeder ( void )

Start the automatic watchdog feeder.

Eris Linux contains an automatic watchdog feeder that feeds the watchdog every second.

It is started automatically when the system boots.

This function starts the automatic watchdog feeder if it is not already running.

Returns
0 on success, -1 on error and errno is set appropriately.

◆ eris_stop_watchdog_feeder()

int eris_stop_watchdog_feeder ( void )

Stop the automatic watchdog feeder.

This function stops the automatic watchdog feeder if it is running.

Returns
0 on success, -1 on error and errno is set appropriately.

◆ eris_watchdog_feeder_status()

int eris_watchdog_feeder_status ( char * buffer,
size_t size )

Get the automatic watchdog feeder status.

This function fills the provided buffer with the automatic watchdog feeder status ('running' or 'stopped').

Returns
0 on success, -1 on error and errno is set appropriately.