Go to main content

man pages section 4: Device and Network Interfaces

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

ntwdt(4D)

Name

ntwdt - Netra–based application watchdog timer driver

Synopsis

/dev/ntwdt

Description

The ntwdt driver is a multithreaded, loadable, non-STREAMS pseudo driver that provides an application with an interface for controlling a system watchdog timer.

The ntwdt driver implements a virtual watchdog timer that an application with the PRIV_SYS_DEVICES privilege controls via ioctl(2) calls.

Ioctls

/usr/platform/sun4v/include/sys/ntwdt.h provides definitions for use of the following ioctls with the ntwdt driver:

LOMIOCDOGCTL

Enable or disable the alarm module watchdog and reset functions. The argument is a pointer to the ts_dogctl_t structure. The reset_enable member is used to enable or disable the reset function of the alarm. The dog_enable member is used to enable or disable the alarm watchdog function of the alarm module. An error (EINVAL) is returned if the watchdog is disabled but the reset is enabled.

LOMIOCDOGPAT

The LOMIOCDOGPAT ioctl rearms, or pats, the watchdog so that the watchdog starts ticking from the beginning; that is, to the value specified by LOMIOCDOGTIME. If the watchdog is enabled, this ioctl must be used at regular intervals that are less than the watchdog timeout, or the watchdog expires.

LOMIOCDOGSTATE

Get the state of the watchdog and reset functions and retrieve the current timeout period for the watchdog. The argument is a pointer to the ts_dogstate_t structure. The structure members are used to hold the current states of the reset circuitry, watchdog circuitry and the current watchdog timeout period in seconds. Note that this is not the time remaining before the watchdog is triggered.

LOMIOCDOGTIME

Set the timeout period for the alarm module watchdog. The argument is a pointer to an unsigned integer. This integer holds the new timeout period for the watchdog in seconds. If the watchdog function is enabled, it is immediately reset so that the new timeout can take effect. An error (EINVAL) is returned if the timeout period is zero or is longer than 127 seconds.


Note - This ioctl is not intended for general purpose use. Setting the watchdog timeout to too low a value may cause the system to receive a hardware reset if the watchdog and reset functions are enabled. The default timeout has been determined to give a good compromise between early fault detection and avoidance of false positives.

CONFIGURATION

You configure the ntwdt driver by modifying the contents of the ntwdt.conf file.

Errors

An open() fails if:

EPERM

Process does not have PRIV_SYS_DEVICES privilege asserted in its effective set.

ENOENT

/dev/ntwdt is not present or driver is not installed.

EAGAIN

/dev/ntwdt has already been successfully open()'d.

Files

/dev/ntwdt

Special character device.

/kernel/drv/sparcv9/ntwdt

SPARC ntwdt kernel module.

/kernel/drv/ntwdt.conf

Driver configuration file.

/usr/platform/sun4v/include/sys/ntwdt.h

Header file with ioctl definitions.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/kernel/platform
Architecture
SPARC

See Also

ioctl(2), driver.conf(5), attributes(7)

Writing Device Drivers in Oracle Solaris 11.4