Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!news3.google.com!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: Mon, 18 Jul 2011 19:17:08 +0100 Lines: 29 Message-ID: <87y5zve9nf.fsf@sapphire.mobileactivedefense.com> References: <87ei1ptes4.fsf@araminta.anjou.terraraq.org.uk> <87livvzubf.fsf@sapphire.mobileactivedefense.com> <64b5b15f-66da-479a-acde-2c4116230da7@h7g2000prf.googlegroups.com> <87vcuzwsyc.fsf@sapphire.mobileactivedefense.com> <87r55nwsky.fsf@sapphire.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net 8ummw3VbasPTGl+8YMd5PguJ2pQsr42cD5Z38YJEzcOURxbHI= Cancel-Lock: sha1:2ONSjYTaIIP7dRLnuUUzEeTY+bw= sha1:wkDwSXU2X9GlYeOFXEAbnMKtV60= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:202 Rainer Weikusat writes: > Peter writes: >> On Jul 18, 7:42 am, Rainer Weikusat wrote: >>> 'Again' -- the solution to your 'problem' is to use the existing >>> system facilities (which have existed 'since a long time') to >>> coordinate use of shared resources by independent applications and not >>> to whine about the fact that a lot of filesystems exists which don't >>> work like the Windows file system. >> >> OK -- educate me! >> What are the "existing system facilities" to prevent users from >> accessing some file? > > cd / > rm -rf * > > There is still some chance that a user might manage to access one of > his own files while deletion is in progress but since this won't be > reproducible, you can afterwards claim that it didn't happen. For sake of completeness: Linux supports (and has supported for years, I was already using this facility with 2.4) a mechanism called 'leases' for regular files (documented in fcntl(2)) which can be used by a process in order to get notified when an otherwise unrelated process is about to gain write or read access to a file (meaning, has just called open w/ a specific mode) or has made a truncate call conflicting with the lease and while this doesn't provide 'exclusive open' it could be used to adapt a memory mapping of some file some other process just messed with.