unsigned char *map_file(char *filename, uint64_t *len) {
uint64_t fd = open64(filename, O_RDONLY);
struct stat64 st;
fstat64(fd, &st)
unsigned char *map;
map = (unsigned char *)mmap64(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
st.st_size ends as 4294967295 for large files (I'm testing a 8.7gb file) and causes segmentation errors (47%). The machine is 64-bit and the OS (ubuntu) is 64 bit. What am I doing wrong?
Chris source
share