w_init Kernel Service

Purpose

Registers a watchdog timer with the kernel.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/watchdog.h>

int w_init ( w)
struct watchdog *w;

Parameter

Item Description
w Specifies the watchdog timer structure.

Description

The watchdog structure must be initialized prior to calling the w_init kernel service as follows:
  • Set the next and prev fields to NULL.
  • Set the func and restart fields to the appropriate values.
  • Set the count field to 0.
Attention: The watchdog structure must be pinned when the w_init service is called. It must remain pinned until after the call to the w_clear service. During this time, the watchdog structure must not be altered except by the watchdog services.

The watchdog timer services, including the w_init kernel service, are typically used to verify that an I/O operation completes in a reasonable time. The watchdog timer is initialized to the stopped state and must be started using the w_start service.

In both uniprocessor and multiprocessor environments, the w_init kernel service always succeeds.

The calling parameters for the watchdog timer function are:

void func (w)
struct watchdog *w;

Execution Environment

The w_init kernel service can be called from the process environment only.

Return Values

The w_init kernel service returns 0 for compatibility with previous releases of AIX®.