lkml.org 
[lkml]   [1999]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: How can Emacs get a unique ID per Linux reboot?
Date

-----Original Message-----
From: Paul Eggert <eggert@twinsun.com>

>I'm trying to help RMS fix a problem with Linux and recent test
>releases of GNU Emacs. When the user edits a file FOO, Emacs 20.3.10
>creates a symbolic link from .#FOO to USER@HOSTNAME:PID:BOOTID, where
>BOOTID is a unique identifier for this reboot of the kernel. This
>symlink lets Emacs determine whether someone else is editing this
>file. The symlink is stale if BOOTID does not correspond to last time
>that the kernel was rebooted. (Emacs doesn't rely on lockf or its
>relatives to create advisory locks on files; I believe that this is
>because they aren't portable and reliable enough with networked file
>systems.)


I don't understand why this method works; two users may well be logged onto
the same machine & kernel. What does BOOTID give you that HOSTNAME doesn't?
Won't a reboot while editing leave a file with a stale lock?

As to lockf, your BOOTID seems to have portability problems too.

Tom Leete



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.026 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site