Reputation: 24160
Is there a way to get number of bytes read by the function ?
Using function **getrusage**
I can get the count of
ru_inblock; /* block input operations */
But how to get number of bytes read by function ?
Upvotes: 0
Views: 120
Reputation: 3459
Use strace(1)
or a debugger. You will have to postprocess the output a bit, but all the information about the data transferred by syscalls is there.
Upvotes: 0
Reputation: 799580
You can't. You will need to preload your own SO that overrides read(2)
which calls it and counts how many bytes are actually read.
Upvotes: 1