On Wed 08-01-14 14:07:03, Raghavendra K T wrote:On 01/06/2014 04:26 PM, Jan Kara wrote:Hum, but this call should have rather been:On Mon 06-01-14 15:51:55, Raghavendra K T wrote:---
test file looked something like this:
char buf[4096];
int main()
{
int fd = open("testfile", O_RDONLY);
unsigned long read_bytes = 0;
int sz;
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
struct stat st;
fstat(fd, &st);
posix_fadvise(fd, 0, st.st_size, POSIX_FADV_WILLNEED);
The posix_fadvise() call you had doesn't do anything...
Honza
do {
sz = read(fd, buf, 4096);
read_bytes += sz;
} while (sz > 0);
close(fd);
printf (" Total bytes read = %lu \n", read_bytes);
return 0;
}