diff options
| author | Paul Eggert | 2013-05-04 17:51:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-05-04 17:51:49 -0700 |
| commit | cbee2131718baa6389713bb551bcfd5c72b39035 (patch) | |
| tree | 2f28d12ed0cac14194f0e9a56376b19ccad3c2b5 /doc | |
| parent | fd3a9a6b378e556c3b09b217920d95cb129a13d6 (diff) | |
| download | emacs-cbee2131718baa6389713bb551bcfd5c72b39035.tar.gz emacs-cbee2131718baa6389713bb551bcfd5c72b39035.zip | |
`write-region-inhibit-fsync' defaults to noninteractive.
* cmdargs.texi (Initial Options):
* files.texi (Customize Save): Document this.
* etc/NEWS: Document this.
* src/fileio.c (syms_of_fileio): Implement this.
* src/filelock.c (create_lock_file): If symbolic links don't work, so
we use a regular file as a lock file, do not fsync the lock file;
it's not needed.
Fixes: debbugs:14273
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/emacs/cmdargs.texi | 3 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 28 |
3 files changed, 29 insertions, 8 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 2c47bdd4fad..348100c8408 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-05-05 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273). | ||
| 4 | * cmdargs.texi (Initial Options): | ||
| 5 | * files.texi (Customize Save): Document this. | ||
| 6 | |||
| 1 | 2013-05-04 Glenn Morris <rgm@gnu.org> | 7 | 2013-05-04 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * calendar.texi (Importing Diary): Mention diary-from-outlook-function. | 9 | * calendar.texi (Importing Diary): Mention diary-from-outlook-function. |
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 19b439afc7f..e285104b5de 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -251,7 +251,8 @@ terminal's standard input stream (@code{stdin}) instead. | |||
| 251 | but @file{site-start.el} is loaded nonetheless. It also causes Emacs | 251 | but @file{site-start.el} is loaded nonetheless. It also causes Emacs |
| 252 | to exit after processing all the command options. In addition, it | 252 | to exit after processing all the command options. In addition, it |
| 253 | disables auto-saving except in buffers for which auto-saving is | 253 | disables auto-saving except in buffers for which auto-saving is |
| 254 | explicitly requested. | 254 | explicitly requested, and when saving files it omits the @code{fsync} |
| 255 | system call unless otherwise requested. | ||
| 255 | 256 | ||
| 256 | @item --script @var{file} | 257 | @item --script @var{file} |
| 257 | @opindex --script | 258 | @opindex --script |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 1f78747eaa6..13fa516af66 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -705,13 +705,27 @@ setting the latter variable, you can control how these modes handle | |||
| 705 | final newlines. | 705 | final newlines. |
| 706 | 706 | ||
| 707 | @vindex write-region-inhibit-fsync | 707 | @vindex write-region-inhibit-fsync |
| 708 | When Emacs saves a file, it invokes the @code{fsync} system call to | 708 | Normally, when a program writes a file, the operating system briefly |
| 709 | force the data immediately out to disk. This is important for safety | 709 | caches the file's data in main memory before committing the data to |
| 710 | if the system crashes or in case of power outage. However, it can be | 710 | disk. This can greatly improve performance; for example, when running |
| 711 | disruptive on laptops using power saving, as it may force a disk | 711 | on laptops, it can avoid a disk spin-up each time a file is written. |
| 712 | spin-up each time you save a file. If you accept an increased risk of | 712 | However, it risks data loss if the operating system crashes before |
| 713 | data loss, you can set @code{write-region-inhibit-fsync} to a | 713 | committing the cache to disk. |
| 714 | non-@code{nil} value to disable the synchronization. | 714 | |
| 715 | To lessen this risk, Emacs can invoke the @code{fsync} system call | ||
| 716 | after saving a file. Using @code{fsync} does not eliminate the risk | ||
| 717 | of data loss, partly because many systems do not implement | ||
| 718 | @code{fsync} properly, and partly because Emacs's file-saving | ||
| 719 | procedure typically relies also on directory updates that might not | ||
| 720 | survive a crash even if @code{fsync} works properly. | ||
| 721 | |||
| 722 | The @code{write-region-inhibit-fsync} variable controls whether | ||
| 723 | Emacs invokes @code{fsync} after saving a file. The variable's | ||
| 724 | default value is @code{nil} when Emacs is interactive, and @code{t} | ||
| 725 | when Emacs runs in batch mode. | ||
| 726 | |||
| 727 | Emacs never uses @code{fsync} when writing auto-save files, as these | ||
| 728 | files might lose data anyway. | ||
| 715 | 729 | ||
| 716 | @node Interlocking | 730 | @node Interlocking |
| 717 | @subsection Protection against Simultaneous Editing | 731 | @subsection Protection against Simultaneous Editing |