Dominik Geyer | 17 May 2008 13:10
Picon
Picon

watchdog-api / documentation

Hi Wim,

I noticed, that the IOCTL WDIOC_SETOPTIONS behaves differently between watchdog drivers.
For w83697hf_wdt the argument to the IOCTL is "by-reference" but for pcwd (it seems to me) 
and according to the watchdog-documentation
- Documentation/watchdog/src/watchdog-test.c
- Documentation/watchdog/watchdog-api.txt
it is "by-value". Which one is correct? I adjusted the watchdog-test.c (see patch) to work for me.

Regards,
Dominik

--- linux-2.6.25.3.orig/Documentation/watchdog/src/watchdog-test.c	2008-05-14
23:58:37.000000000 +0100
+++ linux-2.6.25.3/Documentation/watchdog/src/watchdog-test.c	2008-05-17 00:19:14.000000000 +0200
 <at>  <at>  -31,6 +31,7  <at>  <at> 
  */
 int main(int argc, char *argv[])
 {
+    int options;
     fd = open("/dev/watchdog", O_WRONLY);

     if (fd == -1) {
 <at>  <at>  -41,12 +42,14  <at>  <at> 

     if (argc > 1) {
 	if (!strncasecmp(argv[1], "-d", 2)) {
-	    ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD);
+	    options = WDIOS_DISABLECARD;
+	    ioctl(fd, WDIOC_SETOPTIONS, &options);
(Continue reading)


Gmane