Parameters

asetp

a pointer to a uint_t variable for receiving the acceptable state set (such as A-set) for the contract

buf

a buffer for receiving the devfs path of a minor in a contract

buflenp

a pointer to a variable of type size_t for passing the size of the buffer buf. If the buffer is too small (< PATH_MAX), the minimum size of the buffer needed (PATH_MAX) is passed back to the caller with this argument.

nonegp

a pointer to a uint_t variable for receiving the setting of the “noneg” term

a pointer to a uint_t variable for receiving the current state of the device which is the subject of the contract

Description

These functions read contract status information from a status object stathdl returned
by ct_status_read(). The detail level in the call to ct_status_read() needs to
be at least CTD_FIXED for the following calls to be successful. The one
exception is ct_dev_status_get_minor(), which requires a detail level of CTD_ALL.

The ct_dev_status_get_dev_state() function returns the current state of the device which is
the subject of the contract. This can be one of the following:

CT_DEV_EV_ONLINE

The device is online and functioning normally.

CT_DEV_EV_DEGRADED

The device is online but degraded.

CT_DEV_EV_OFFLINE

The device is offline and not configured.

The ct_dev_status_get_aset() function returns the A-set of the contract. This can be
the bitset of one or more of the following states: CT_DEV_EV_ONLINE, CT_DEV_EV_DEGRADED,
or CT_DEV_EV_OFFLINE.

The ct_dev_status_get_minor() function reads the devfs path of the minor participating in
the contract. The devfs path returned does not include the /devices prefix.
If the buffer passed in by the caller is too small (< PATH_MAX),
the minimum size of the buffer required ( PATH_MAX) is returned to
the caller via the buflenp argument.

The ct_dev_status_get_noneg() function returns the “noneg” setting for the contract. A value
of 1 is returned in the nonegp argument if NONEG is set,
else 0 is returned.