[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

perfstat_netinterface_total Subroutine

Purpose

Retrieves global network interface usage statistics.

Library

Perfstat Library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_netinterface_total (name, userbuff, sizeof_struct, desired_number)
perfstat_id_t *name;
perfstat_netinterface_total_t *userbuff;
size_t sizeof_struct;
int desired_number;

Description

The perfstat_netinterface_total subroutine returns global network interface usage statistics in a perfstat_netinterface_total_t structure.

To get statistics that are global to the whole system, the name parameter must be set to NULL, the userbuff parameter must be allocated, and the desired_number parameter must be set to 1.

The perfstat_netinterface_total subroutine retrieves information from the ODM database. This information is automatically cached into a dictionary which is assumed to be frozen once loaded. The perfstat_reset subroutine must be called to flush the dictionary whenever the machine configuration has changed.

Parameters

name

Must be set to NULL.

userbuff Points to the memory area that is to be filled with the perfstat_netinterface_total_t structure.
sizeof_struct Specifies the size of the perfstat_netinterface_total_t structure: sizeof(perfstat_netinterface_total_t).
desired_number Must be set to 1.

Return Values

Upon successful completion, the number of structures filled is returned. This will always be 1. If unsuccessful, a value of -1 is returned and the errno variable is set.

Error Codes

The perfstat_netinterface_total subroutine is unsuccessful if one of the following is true:

EINVAL One of the parameters is not valid.
EFAULT Insufficient memory.

Files

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

Related Information

perfstat_netbuffer Subroutine, perfstat_cpu Subroutine, perfstat_cpu_total Subroutine, perfstat_disk Subroutine, perfstat_diskadapter Subroutine, perfstat_disk_total Subroutine, perfstat_memory_total Subroutine, perfstat_netinterface Subroutine, perfstat_pagingspace Subroutine, perfstat_protocol Subroutine, and perfstat_reset Subroutine.

Perfstat API in Performance Tools and APIs Technical Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]