Query: hba_getadaptername
OS: sunos
Section: 3hbaapi
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
HBA_GetAdapterName(3HBAAPI) Common Fibre Channel HBA Information Library Functions HBA_GetAdapterName(3HBAAPI)NAMEHBA_GetAdapterName - retrieve the name of a specific HBASYNOPSIScc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_GetAdapterName(HBA_UINT32 adapterindex, char *adaptername);PARAMETERSadapterindex the index of the adapter, between 0 and one less than the value returned by HBA_GetNumberOfAdapters(3HBAAPI). adaptername the buffer where the name of the adapter will be stored. The recommended size is 256 bytes.DESCRIPTIONThe HBA_GetAdapterName() function stores the name of the adapter specified by adapterindex in the buffer pointed to by adaptername. The caller is responsible for allocating space for the name.RETURN VALUESUpon successful completion, HBA_STATUS_OK is returned. Otherwise, an error value is returned and the content of adaptername is undefined.ERRORSSee libhbaapi(3LIB) for general error status values.EXAMPLESExample 1: Return adapter name. Given an hbacount >= 0 and < total number of adapters on the system, the following example returns the adaptername for that adapter. if ((status = HBA_GetAdapterName(hbaCount, adaptername)) != HBA_STATUS_OK) { fprintf(stderr, "HBA %d name not available for " "reason %d ", hbaCount, status); continue; }ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard: FC-MI 1.92 (API | | |version 1) | +-----------------------------+-----------------------------+ | |Standard: FC-HBA Version 4 | | |(API version 2) | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+SEE ALSOHBA_GetNumberOfAdapters(3HBAAPI), libhbaapi(3LIB), attributes(5) T11 FC-MI SpecificationBUGSThe HBA_GetAdapterName() function does not take a name length argument to define how large the buffer is, yet the specification does not indicate a maximum name length. Failure to pass in a large enough buffer will result in a buffer over-run, which may lead to segmentation faults or other failures. Callers should be sure to allocate a large buffer to ensure the Vendor library will not overrun during the copy. SunOS 5.10 1 Sep 2003 HBA_GetAdapterName(3HBAAPI)
Similar Topics in the Unix Linux Community |
---|
The 500 Mile Email |
Is UNIX an open source OS ? |
UNIX fun stuff - echo and dc - obfuscate/garble a string sort of |
Outputting sequences based on length with sed |