perfstat_fcstat Subroutine

Purpose

Retrieves the statistics of a Fibre Channel (FC) adapter.

Library

Perfstat library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_fcstat (name, userbuff, sizeof_struct, desired_number)

perfstat_id_t *name;
perfstat_fcstat_t *userbuff;
size_t sizeof_struct;
int desired_number;

Description

The perfstat_fcstat subroutine retrieves the statistics of one or more FC adapters. The same function is also used to retrieve the number of available FC adapter statistics.

To get one or more FC adapter statistics, specify the name of the first FC adapter for which you want the statistics by the name parameter and set the desired_number parameter accordingly. To start from the first FC adapter, set the name parameter to "" or FIRST_FCADAPTER. The userbuff parameter always points to a memory area that can contain the desired number of perfstat_fcstat_t structures that are copied by this function. On successful completion of the subroutine, the name parameter is set to the name of the next FC adapter or to "" after all the structures have been copied.

To retrieve the number of available FC adapter statistics, set the name and userbuff parameters to NULL, and the desired_number parameter to 0. The value returned is the number of available adapters.

Note:

For nonroot user, the values return by the perfstat_fcstat subroutine will always be zero for all listed fiber channel adapters.

Parameters

Item Description
name Specifies either "" or FIRST_FCADAPTER, or the name of the first network adapter for which statistics are required. For example, fcs0 or fcs1.
userbuff Points to the memory area that is to be filled with one or more perfstat_fcstat_t structures.
sizeof_struct Specifies the size of the perfstat_fcstat_t structure.
desired_number Specifies the number of perfstat_fcstat_t structures to copy to the userbuff pointer.

Return Values

On successful completion of the subroutine unless the function is used to retrieve the number of available structures, the number of structures filled 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.
EFAULT Memory is not sufficient.
ENOMEM The default length of the string is too short.
ENOMSG Cannot access the dictionary.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.