site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com —Jens _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I'm calling mmap to create a new mapping of a file. Later on I append data to the file (just using regular write calls) and then I want to map in the new data. If possible I want to grow the existing mapping in place, to avoid invalidating all the existing pointers. Based on the mmap(2) man page, it sounded as though I could do this by passing in the base address of the old mapping and the MAP_FIXED flag; and it would replace the mapping with a larger one if possible, or return MAP_FAILED if there wasn't room. ::mmap(_start, newLength, PROT_READ, MAP_SHARED | MAP_FIXED, _fd, _position); Instead, what I see happening (by running vmmap(1) before and after the call) is that the mmap call blows away any other following VM regions to make room for my request. Since these regions are often things like stacks, object code or malloc heaps, this is immediately fatal. :-( Is there any way to get the behavior I want, where mmap will extend the mapping but will fail rather than deleting any other mappings? This email sent to site_archiver@lists.apple.com