The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

watchdog (4)
  • >> watchdog (4) ( FreeBSD man: Специальные файлы /dev/* )
  • watchdog (8) ( FreeBSD man: Команды системного администрирования )
  • watchdog (9) ( FreeBSD man: Ядро )
  • Ключ watchdog обнаружен в базе ключевых слов.

  • BSD mandoc
     

    NAME

    
    
    watchdog
    
     - hardware and software watchdog
    
     
    

    SYNOPSIS

       #include <sys/watchdog.h>
     

    DESCRIPTION

    The facility is used for controlling hardware and software watchdogs.

    /dev/fido responds to a single ioctl(2) call, WDIOCPATPAT It takes a single argument which represents a timeout value specified as a power of two nanoseconds, or-ed with a flag selecting active or passive control of the watchdog.

    WD_ACTIVE indicates that the will be kept from timing out from userland, for instance by the watchdogd(8) daemon. WD_PASSIVE indicates that the will be kept from timing out from the kernel.

    The ioctl(2) call will return success if just one of the available watchdog(9) implementations supports setting the timeout to the specified timeout. This means that at least one watchdog is armed. If the call fails, for instance if none of watchdog(9) implementations support the timeout length, all watchdogs are disabled and must be explicitly re-enabled.

    To disable the watchdogs pass WD_TO_NEVER If disarming the watchdog(s) failed an error is returned. The watchdog might still be armed!  

    RETURN VALUES

    The ioctl returns zero on success and non-zero on failure.

    Bq Er EOPNOTSUPP
    No watchdog present in the kernel (timeout value other than 0).
    Bq Er EOPNOTSUPP
    Watchdog could not be disabled (timeout value of 0).
    Bq Er EINVALID
    Invalid flag combination passed.
    Bq Er EINVALID
    None of the watchdogs supports the requested timeout value.

     

    EXAMPLES

    #include <paths.h>
    #include <sys/watchdog.h>
    
    #define WDPATH  "/dev/" _PATH_WATCHDOG
    int wdfd = -1;
    
    static void
    wd_init(void) 
    {
            wdfd = open(WDPATH, O_RDWR);
            if (wdfd == -1)
                    err(1, WDPATH);
    }
    static void
    wd_reset(u_int timeout)
    {
            if (ioctl(wdfd, WDIOCPATPAT, &timeout) == -1)
                    err(1, "WDIOCPATPAT");
    }
    
    /* in main() */
    wd_init();
    wd_reset(WD_ACTIVE|WD_TO_8SEC);
    /* potential freeze point */
    wd_reset(WD_TO_NEVER);
    

    Enables a watchdog to recover from a potentially freezing piece of code.

    options SW_WATCHDOG
    

    in your kernel config adds a software watchdog in the kernel, dropping to KDB or panic-ing when firing.  

    SEE ALSO

    watchdogd(8), watchdog(9)  

    HISTORY

    The code first appeared in Fx 5.1 .  

    BUGS

    The WD_PASSIVE option has not yet been implemented.  

    AUTHORS

    An -nosplit The facility was written by An Poul-Henning Kamp Aq [email protected] . The software watchdog code and this manual page were written by An Sean Kelly Aq [email protected] . Some contributions were made by An Jeff Roberson Aq [email protected] .


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    RETURN VALUES
    EXAMPLES
    SEE ALSO
    HISTORY
    BUGS
    AUTHORS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру