libIO.3x (2010 09)

l
libIO(3X) libIO(3X)
Description
io_get_devs()
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 say if the
dev_t
type is D_CHR (character) or D_BLK (block).
The user will need to allocate memory for the array and indicate its size (of io_dev_info_t)incount . The
interface will copy the data into the array if it is big enough. If it is too small, no data is returned and the
count is set to indicate the needed size (number of io_dev_info_t). Callers need to reallocate and call the
API again.
Arguments
node An I/O node token to retrieve its
dev_ts.
dev_arry Possible values are:
INPUT:
A pointer to an array of io_dev_info_t. The array is allocated by the caller. The ini-
tial size can be
IO_MAX_DEVS_IN_IOQ
(this is currently set to 48).
OUTPUT:
The io_dev_info_t
returned will be copied into this array.
count Possible values are:
INPUT:
Number of io_dev_info_t expected. Should be set to
IO_MAX_DEVS_IN_IOQ ini-
tially.
OUTPUT:
Number of io_dev_info_t in the returned array if the array is big enough. If the
array is not big enough:
1) No token will be returned.
2) Count will be set to the real count of io_dev_info_t to be returned.
3) The API will return IO_ERROR.
4)
io_errno will be set to IO_E_BUF_TOO_SMALL
.
In this case, the caller needs to allocate a bigger buffer after recalculating it
using:
(sizeof(io_dev_info_t)*count)
with the returned count value. and needs to call the API again with the new
buffer and count values.
Return Value
IO_SUCCESS - Upon success.
IO_ERROR - Otherwise. io_errno is set to indicate the error.
Errors
[IO_E_DCONF_OPEN]
[IO_E_NODE_NOEXIST]
[IO_E_DCONF_ACCESS]
[IO_E_SYSCALL]
[IO_E_MEM_ALLOC]
[IO_BUF_TOO_SMALL]
libIO FUNCTION
Name
io_block_to_raw() - returns the character dev_t of the given block dev_t
Synopsis
int io_block_to_raw(dev_t bdev, dev_t *rdev);
Description
This API is used to retrieve character dev_t corresponding to the block dev_t.
18 Hewlett-Packard Company 18 HP-UX 11i Version 3: September 2010