User`s manual

TC-6110 Linux User's Manual Programming Guide
5-5
IOCTL WDIOC_GETTIMEOUT
Description Gets the current watchdog timeout.
Input None
Output arg: 1 ~ 255 seconds
Return On success, return 0. Otherwise, return < 0 value.
Examples
This sample watchdog script, watchdog-simple.c, checks the watchdog every in 10 seconds.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main(void)
{
int fd = open("/dev/watchdog", O_WRONLY);
int ret = 0;
if (fd == -1) {
perror("watchdog");
exit(EXIT_FAILURE);
}
while (1) {
ret = write(fd, "\0", 1);
if (ret != 1) {
ret = -1;
break;
}
sleep(10);
}
close(fd);
return ret;
}
Hot-Swapping Block Drives
A development library is provided to help you develop your applications. All of the code can be found at
/example/hotswap on the software CD
Documentation Format
#define mxhtsp_close(fd) close(fd)
Description Closes the hotswap devices.
Parameters fd: the open port
Returns None
Function Documentation
int mxhtsp_check_partition_usage (const char * partition_name)
Description Gets what percentage of a partition is in use.
Parameters partition_name: the name of the partition being checked. In linux, it should be