ct_dev_status_get_dev_state man page on OpenIndiana

Man page or keyword search:  
man Server   20441 pages
apropos Keyword Search (all sections)
Output format
OpenIndiana logo
[printable version]

ct_dev_status_get_devContractCManagementct_dev_status_get_dev_state(3CONTRACT)

NAME
       ct_dev_status_get_dev_state,	ct_dev_status_get_aset,	   ct_dev_sta‐
       tus_get_minor, ct_dev_status_get_noneg - read contract status  informa‐
       tion from a status object

SYNOPSIS
       cc [ flag... ] file... -D_LARGEFILE64_SOURCE  -lcontract	 [ library... ]
       #include <libcontract.h>
       #include <sys/contract/device.h>

       int ct_dev_status_get_dev_state(ct_stathdl_t stathdl,
	    uint_t *statep);

       int ct_dev_status_get_aset(ct_stathdl_t stathdl,
	    uint_t *asetp);

       int ct_dev_status_get_minor(ct_stathdl_t stathdl, char *buf,
	    size_t *buflenp);

       int ct_dev_status_get_noneg(ct_stathdl_t stathdl,
	    uint_t *nonegp);

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  con‐
		  tract

       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

       stathdl	  a status object returned by ct_status_read(3CONTRACT)

       statep	  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  con‐
       tract.  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.

RETURN VALUES
       Upon successful completion, these functions return 0.  Otherwise,  they
       return a non-zero error value.

ERRORS
       The ct_dev_status_get_minor() function will fail if:

       EOVERFLOW    The buffer size is too small to hold the result.

       The	 ct_dev_status_get_dev_state(),	     ct_dev_status_get_aset(),
       ct_dev_status_get_minor() and ct_dev_status_get_noneg()	functions will
       fail if:

       EINVAL	 An invalid argument was specified.

       ENOENT	 The requested data is not present in the status object.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Committed			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │MT-Level		     │Safe			   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       ct_status_free(3CONTRACT),      ct_status_read(3CONTRACT),      libcon‐
       tract(3LIB), contract(4), devices(4), attributes(5), lfcompile(5)

SunOS 5.11			  9 Aug ct_dev_status_get_dev_state(3CONTRACT)
[top]

List of man pages available for OpenIndiana

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net