Pregunta

I want to use APR to mmap really large file, greater than 4Gb. At first I need to create file this big but I found that function apr_file_seek accepts parameter of type apr_seek_where_t that is just an alias for int. So it is possible to seek the first 4 gigs only. Is it possible to handle large files with APR?

¿Fue útil?

Solución

You can seek multiple times with APR_CUR.
Also note that an int on a 32-bit system allows you two seek two gibibytes forward, not four.

Also note that on a 32-bit system the mmap will most probably fail to map more than two to three gibibytes. (When the address space is limited by 32 bits the maximum address space is four gibibytes but the operating system has to reserve some of that address space to itself).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top