Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120834595
iostat.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
726 B
Referenced Files
None
Subscribers
None
iostat.c
View Options
#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
Details
Attached
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)
Attached To
Mode
R111 cyrus-imapd
Attached
Detach File
Event Timeline