Page MenuHomePhorge

iostat.c
No OneTemporary

Authored By
Unknown
Size
726 B
Referenced Files
None
Subscribers
None

iostat.c

#include <stdio.h>
#include <sys/types.h>
#include <syslog.h>
#include "libconfig.h"
#include "iostat.h"
void read_io_count(struct io_count *iocount) {
FILE *file = NULL;
char buf[64] = "";
if ((file = fopen("/proc/self/io", "r")) != NULL ) {
while(fgets(buf,sizeof(buf),file)) {
//syslog(LOG_DEBUG,"/proc/self/io content:%s",buf);
sscanf(buf,"read_bytes:%d",&(iocount->io_read_count));
sscanf(buf,"write_bytes:%d",&(iocount->io_write_count));
}
fclose (file);
return;
}
else {
syslog(LOG_ERR,"IOERROR: opening file /proc/self/io\n");
config_iolog = 0;
syslog(LOG_ERR,"I/O log has been deactivated\n");
}
}

File Metadata

Mime Type
text/x-c
Expires
Fri, Apr 24, 1:05 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18742710
Default Alt Text
iostat.c (726 B)

Event Timeline