From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Making fsync() optional Date: Tue, 13 Sep 2005 11:55:38 -0400 Message-ID: References: <87oe6yf5o9.fsf@pacem.orebokech.com> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1126628096 19560 80.91.229.2 (13 Sep 2005 16:14:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2005 16:14:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 13 18:14:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EFDOc-0005xj-OP for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2005 18:12:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EFDOc-0007UG-2r for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2005 12:12:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EFDJh-00069A-LP for emacs-devel@gnu.org; Tue, 13 Sep 2005 12:07:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EFDJZ-000659-Iq for emacs-devel@gnu.org; Tue, 13 Sep 2005 12:07:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EFDJY-0005uw-Vk for emacs-devel@gnu.org; Tue, 13 Sep 2005 12:07:21 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EFD8F-0007Y1-JQ for emacs-devel@gnu.org; Tue, 13 Sep 2005 11:55:39 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EFD8E-0000mM-8O; Tue, 13 Sep 2005 11:55:38 -0400 Original-To: Romain Francoise In-reply-to: <87oe6yf5o9.fsf@pacem.orebokech.com> (message from Romain Francoise on Mon, 12 Sep 2005 21:27:02 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42891 Archived-At: Would people be conceptually opposed to making the fsync() call optional in Fwrite_region? Calling it after each write It is not called after each write, just once at the end of writing the whole file. This is very important for safety. Without this, you can type C-x C-s, and see the command finish, and see the message that the file has been written, but you can still lose it all if the system crashes after that. However, I would not mind adding a flag to turn it off, as long as the doc string of that flag warns that this is dangerous. It also forces the disk to spin up on laptops (even with laptop mode and friends). It has to do that anyway. I don't want it to wait a minute before it writes the file! Of course calling fsync() is safer if the system goes down right after saving the file, but for systems with uninterruptible power, it doesn't matter. A power failure is not the only cause of crashes.