hwi_find_unit()

Determine which instance of a device an offset corresponds to

Synopsis:

#include <drvr/hwinfo.h>

int hwi_find_unit (unsigned hwi_off );

Arguments:

hwi_off
The offset of a device.

Library:

libdrvr

Use the -l drvr option to qcc to link against this library.

Description:

Multiple instances of a device or bus may exist in the hwinfo section of the system page. The hwi_find_unit() function determines which instance of the item hwi_off is.

Note that this routine resolves all synonyms and returns the instance of a real device or bus, not the instance of a synonym name. For example, if the second instance of synonym name “foo” resolves to the fourth instance of the real device “bar”, hwi_find_unit() returns 3 (base 0 instance numbering).

Returns:

The device or bus instance (or unit #, base 0) or -1 on error.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes