From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glynn Clements Subject: Re: tracking shared dirty pages in a mmap file Date: Sun, 27 Aug 2006 12:39:41 +0100 Message-ID: <17649.33917.396887.298434@cerise.gclements.plus.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: Kandan Venkataraman Cc: linux-c-programming@vger.kernel.org Kandan Venkataraman wrote: > I want to track any pages that have been written to a mmap file using a > segv handler. > > I have given an example program below to illustrate my idea. > > What I want to know is whether the modifications to the mmap file will > be guaranteed to be unaffected by the interruption of the signal > handler, i.e. would the resultant changes in the mmap file be as if the > mmap file had write access set. It seems to work this way on Linux, but that behaviour isn't dictated by any standard. In particular, Unix98 says: The behavior of a process is undefined after it returns normally from a signal-catching function for a SIGBUS, SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(), sigqueue(), or raise(). -- Glynn Clements