#include <lkmi.h >
int lkmi_hdd (lkmi_hdd_t *hdd_info, int index, int num, short flag);
Pointer to structure which is described bellow. If this pointer is NULL
then number of disk drives is returned.
The index of HDD or partition (depends on flag parameter). If this index is -1 and hdd_info
is not NULL then only number of disks is returned.
Flag determines if only whole disks are evaluated LKMI_HDD_DISKS or
all partitions (without disks) are evaluated LKMI_HDD_PARTS.
Function retrieves information about Hard Disk Drive (HDD)
and their counters in structure lkmi_hdd_t which contains these fields.
This field contains actual number of drives. This field is set on each successful call.
This field contain name of device without /dev/. I.e. first IDE disk has name hda.
NOTE: Meaning of the next fields have to be checked against kernel source code.
Number of reading operations.
Number of write operations.
If parameter nic_info is NULL then number of NICs is returned.
If this parameter is valid pointer and function ends successfully then returns 0.
If call fail, functions returns -1 and sets
errno value to:
The flag parameter has incorrect value;
HDD index is out of range. Not all array elements has useful data.
The lkmi_hdd function may also fail and set errno
for any of the errors specified for the routine fopen(3).
Please use the SourceForge Reporting page
which is located here:
This function is written as part of lkmi library for Linux system
and may be freely distributed under GPL terms.
Copyright (c) 1995, 2002 David Doubrava (linux_monitor(at)volny(dot)cz).
Origin of values description is in Linux kernel source.