From 91060a1772628ada88a3b219f75e449200308008 Mon Sep 17 00:00:00 2001 From: leitner Date: Sat, 10 Jan 2004 00:09:30 +0000 Subject: [PATCH] still bus error --- io/iob_prefetch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/iob_prefetch.c b/io/iob_prefetch.c index 16e62a3..5955148 100644 --- a/io/iob_prefetch.c +++ b/io/iob_prefetch.c @@ -14,9 +14,11 @@ void iob_prefetch(io_batch* b,uint64 bytes) { char* c,* d; uint64 before=bytes; if (e->n>=1000000) { - d=c=mmap(0,bytes+4095,PROT_READ,MAP_SHARED,e->fd,(e->offset|4095)+1); + long l=e->offset&4095; + d=c=mmap(0,bytes,PROT_READ,MAP_SHARED,e->fd,(e->offset|4095)+1); + bytes-=l; if (c!=MAP_FAILED) { - while (bytes>4096) { + while (bytes>4095) { x=*d; bytes-=4096; d+=4096;