* mmap() maps the file descriptor at offset 0.

This commit is contained in:
Sam Hocevar
2007-01-09 15:40:08 +00:00
committed by sam
parent 0bde2e4ad9
commit 24f3d04a30

View File

@@ -261,7 +261,7 @@ int nbmaps = 0;
if(ret) \
{ \
void *tmp = malloc(length); \
int i; \
int i, oldpos; \
for(i = 0; i < nbmaps; i += 2) \
if(maps[i] == NULL) \
break; \
@@ -272,8 +272,11 @@ int nbmaps = 0;
} \
maps[i] = tmp; \
maps[i + 1] = ret; \
oldpos = _zz_getpos(fd); \
_zz_setpos(fd, offset); /* mmap() maps the fd at offset 0 */ \
memcpy(tmp, ret, length); /* FIXME: get rid of this */ \
_zz_fuzz(fd, tmp, length); \
_zz_setpos(fd, oldpos); \
ret = tmp; \
} \
debug(STR(fn)"(%p, %li, %i, %i, %i, %lli) = %p", start, \