/*++ /* NAME /* watchdog 3 /* SUMMARY /* watchdog timer /* SYNOPSIS /* #include <watchdog.h> /* /* WATCHDOG *watchdog_create(timeout, action, context) /* unsigned timeout; /* void (*action)(WATCHDOG *watchdog, char *context); /* char *context; /* /* void watchdog_start(watchdog) /* WATCHDOG *watchdog; /* /* void watchdog_stop(watchdog) /* WATCHDOG *watchdog; /* /* void watchdog_destroy(watchdog) /* WATCHDOG *watchdog; /* /* void watchdog_pat() /* DESCRIPTION /* This module implements watchdog timers that are based on ugly /* UNIX alarm timers. The module is designed to survive systems /* with clocks that jump occasionally. /* /* Watchdog timers can be stacked. Only one watchdog timer can be /* active at a time. Only the last created watchdog timer can be /* manipulated. Watchdog timers must be destroyed in reverse order /* of creation. /* /* watchdog_create() suspends the current watchdog timer, if any, /* and instantiates a new watchdog timer. /* /* watchdog_start() starts or restarts the watchdog timer. /* /* watchdog_stop() stops the watchdog timer. /* /* watchdog_destroy() stops the watchdog timer, and resumes the /* watchdog timer instance that was suspended by watchdog_create(). /* /* watchdog_pat() pats the watchdog, so it stays quiet. /* /* Arguments: /* .IP timeout /* The watchdog time limit. When the watchdog timer runs, the /* process must invoke watchdog_start(), watchdog_stop() or /* watchdog_destroy() before the time limit is reached. /* .IP action /* A null pointer, or pointer to function that is called when the /* watchdog alarm goes off. The default action is to terminate /* the process with a fatal error. /* .IP context /* Application context that is passed to the action routine. /* .IP watchdog /* Must be a pointer to the most recently created watchdog instance. /* This argument is checked upon each call. /* BUGS /* UNIX alarm timers are not stackable, so there can be at most one /* watchdog instance active at any given time. /* SEE ALSO /* msg(3) diagnostics interface /* DIAGNOSTICS /* Fatal errors: memory allocation problem, system call failure. /* Panics: interface violations. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.