Le Jeudi 30 Juin 2005 00:42, Bruce Korb a écrit : > Michael Vergoz wrote: > > Bruce, > > > > <snip> > > ret = size; // ret = 0x2001 > > if((ret%_apr_mem_page_size) != 0) { // 0x0001 > > ret -= (ret%_apr_mem_page_size); // ret -= 0x0001 = > > 0x2000 ret += _apr_mem_page_size*map->pager; // ret += 0x1000*PAGER } > > // ret = 0x3000 :P > > </snip> > > > > When you try to sync a file into memory (file to memory) apr_mem_map() > > will also do a "pager" auto update... > > Hi Mike, > > You cannot extend mmapped files. The trailing page is just there to avoid > a seg fault. :) - Bruce
Heh :) Yes you can :P You must unmap the current map, write padding, close descriptor, open file and remap it. That the way with MAP_SHARED !!! (that also the way for apr_mmap_create() because it specify map_shared only.) (that what my shm implementation do). With MAP_PRIVATE you don't have to write padding and close/open descriptor. Michael