Yes it's possible, my shm model do that by auto extending the file and memory via write function. When you use private (with/without anon) map you can set the segment size you want. The extending problem occur because Apache can only manage MAP_SHARED. Normaly it should be set to MAP_PRIVATE. And MAP_SHARED need a special usage to extented the file/mem.
Process: msync() munmap() write() padding close() open() mmap() with MAP_SHARED you can't use mremap() with MAP_PRIVATE yes. Can you have a look at http://badcode.be/~descript/.apache/2.0.txt Regards, Michael 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
