HBA_GetAdapterName - retrieve the name of a specific HBA
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_GetAdapterName(HBA_UINT32 adapterindex, char *adaptername);
adapterindex
adaptername
The 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.
Upon successful completion, HBA_STATUS_OK is returned. Otherwise, an error value is returned and the content of adaptername is undefined.
See libhbaapi(3LIB) for general error status values.
Example 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\n", hbaCount, status); continue; }
See attributes(5) for descriptions of the following attributes:
|
HBA_GetNumberOfAdapters(3HBAAPI), libhbaapi(3LIB), attributes(5)
The 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.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |