perfstat_fcstat_wwpn Subroutine
Purpose
Retrieves the Fibre Channel (FC) adapter statistics for a worldwide port name (WWPN) ID.
Library
Perfstat library (libperfstat.a)
Syntax
#include <libperfstat.h>
int perfstat_fcstat_wwpn (name, userbuff, sizeof_struct, desired_number)
perfstat_wwpn_id_t *name;
perfstat_fcstat_t *userbuff;
size_t sizeof_struct;
int desired_number;
typedef struct { /* structure element identifier */
char name[IDENTIFIER_LENGTH]; /* name of the fc adapter identifier */
u_longlong_t initiator_wwpn_name; /* initiator, WWPN name */ }
perfstat_wwpn_id_t;
Description
The perfstat_fcstat_wwpn subroutine
retrieves individual FC adapter statistics for a specified WWPN ID.
Note: The perfstat_fcstat_wwpn subroutine
does not work for the nonroot user.
Parameters
Item | Description |
---|---|
name | Specifies the name of the FC adapter and the WWPN name, for which the statistics are captured. If it is set to NULL, the error message is displayed. |
userbuff | Points to the memory area that is to be filled with the perfstat_fcstat_t structure. |
sizeof_struct | Specifies the size of the perfstat_fcstat_t structure. |
desired_number | Specifies the number of perfstat_fcstat_t structures that are copied to the userbuff pointer. The parameter is set to 1 for the perfstat_fcstat_wwpn subroutine. |
Return Values
On successful completion of the subroutine unless the function is used to retrieve an available structure, a filled structure is returned. If the subroutine is unsuccessful, a value of -1 is returned and the errno global variable is set.
Error Codes
The subroutine is unsuccessful if one of the following is true:
Item | Description |
---|---|
EINVAL | One of the parameters is not valid. |
ENOMEM | The default length of the string is too short. |