Let's say I have a 4GB file. I open it and call "lseek64" to get its long long size. Now I want to memory map the entire file with mmap64. The problem is that the length parameter with mmap64 is a size_t (just like mmap), and the offset value is what is long long.
To map the whole file, you would need to set the offset to zero, so offset being long long isn't all that meaningful. With the length parameter being a mere size_t, is there no way to map the entire file? It seems like all that mmap64 offers over mmap is the ability to map sections of the file far into it.
In Win32 I believe you can map an entire (huge) file using
CreateFileMapping (if you pass in 0 as the max map size then it uses the size of the file). Is there no way to do this in *nix?
Thanks,
Blake