Using the HP-UX libIO Library
io_get_devs()
This routine gets all the dev_ts (including char and block dev_ts) of a given node.
It will return all the dev_ts, the device-specific options, and the dev_t type in
dev_arry. The dev_type field of dev_arry is updated to indicate if the dev_t
type is D_CHR (character) or D_BLK (block). The interface will copy the data into the
array if it is large enough. If it is too small, no data is returned and the count is set to
indicate the required size (number of io_dev_info_t). Callers need to reallocate
and call the routine again.
The function prototype of this routine is:
int io_get_devs(io_token_t node, io_dev_info_t *dev_arry,
int *count);
io_dev_to_options()
This routine gets the device specific options of agile dev_ts. The type of the dev_t
(D_CHR or D_BLK) is specified as input. The function prototype of this routine is:
int io_dev_to_options(dev_t dev, int dev_type,
uint64_t *options);
The options are returned as an integer bitmask.
io_is_legacy_dev()
This routine determines if the given dev_t is a legacy or an agile dev_t. The type
of the dev_t (D_CHR or D_BLK) is specified as input. The function prototype of this
routine is:
int io_is_legacy_dev(dev_t dev, int dev_type);
The routine returns:
IO_TOKEN_NEW – if dev_t is of an agile I/O node
IO_TOKEN_LEGACY – if dev_t is of a legacy I/O node
IO_ERROR – for failure
io_dev_to_node()