|
Eris Linux A.P.I. 0.1
API to access Eris Linux system from a custom container
|
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. | |
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.
| 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.
| 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.
| int eris_get_watchdog_delay | ( | void | ) |
Read the watchdog delay.
This function returns the number of seconds between a watchdog refresh and system reboot.
| int eris_set_watchdog_delay | ( | int | delay | ) |
Set the watchdog delay.
This function configures the watchdog, then starts it.
| delay | delay in seconds before reboot (must be in [1-48]) |
| 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.
| int eris_stop_watchdog_feeder | ( | void | ) |
Stop the automatic watchdog feeder.
This function stops the automatic watchdog feeder if it is running.
| 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').