Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.apps Subject: Re: mmap unuseable for interactive application? Date: Sun, 17 Jul 2011 19:40:58 +0100 Lines: 31 Message-ID: <87y5zwvjgl.fsf@sapphire.mobileactivedefense.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net JM2mhRNTGg7YcvP7C70DMgMRwEEMWCCywAMEFTIMT7hn07cxg= Cancel-Lock: sha1:hIp0LkFgRwYxQ2GvA47eK3cRccQ= sha1:zOQ3fQdzCyjidMmcibB/7UPL7CM= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:186 Peter writes: > I was wondering about some crash of my application, which always > seemed to happen, when I edit the file currently read by it. > As it turns out, when editing the file one may truncate it, > which makes some area of memory created via mmap unuseable. > This is even documented in the man page of mmap. "Concurrent access to shared resources requires ... COORDINATION !!!! The end of the world is sure to follow soon !!" > So -- not only should one not use mmap to write into a sparse file > (as one may get an unuseable SIGSEGV/SIGBUS for "out of diskspace" Nope. For 'out of memory' ... > (please don't suggest setjmp/longjmp to me)). ... but it DON'T WANT to handle that ... > The same is true for readonly access to a file via mmap. > If at least one could make certain, that no other handle can be > created for this file while one is using it. But I was told earlier, > this is a feature -- not a bug! It is documented. Consequently, it's a feature, > I again want congratulate apple for choosing linux as the basis for > their OS! They didn't. They are using a bastardized microkernel and BSD.