all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
Cc: emacs-devel@gnu.org
Subject: Re: MAIL_USE_FLOCK and Debian.
Date: Tue, 18 Feb 2003 10:03:32 -0600	[thread overview]
Message-ID: <874r717ezv.fsf@raven.i.defaultvalue.org> (raw)
In-Reply-To: <874r7238p9.fsf@deneb.enyo.de> (Florian Weimer's message of "Mon, 17 Feb 2003 22:20:50 +0100")

Florian Weimer <fw@deneb.enyo.de> writes:

> Maybe Emacs can offer access to the relevant system calls, so
> movemail can be implemented in Lisp?  It can't be *that* hard...

Oh, and although it looks like it's not going to matter, you're
definitely right about being able to implement movemail in Lisp if we
wanted to.  As an example, you might be able to implement the Debian
strategy (embodied in liblockfile) right now, without any changes to
Emacs, since it uses fairly unremarkable system calls.  From
lockfile_create(3):

  The algorithm that is used to create a lockfile in an atomic way,  even
  over NFS, is as follows:

  1      A unique file is created. In printf format, the name of the file
         is .lk%05d%x%s. The first argument (%05d) is the current process
         id. The second argument (%x) consists of the 4 minor bits of the
         value returned by time(2). The last argument is the system host-
         name.

  2      Then  the lockfile is created using link(2). The return value of
         link is ignored.

  3      Now the lockfile is stat()ed. If the stat fails, we go  to  step
         6.

  4      The stat value of the lockfile is compared with that of the tem-
         porary file. If they are the same, we have the lock. The  tempo-
         rary  file  is deleted and a value of 0 (success) is returned to
         the caller.

  5      A check is made to see if the existing lockfile is a valid  one.
         If it isn't valid, the stale lockfile is deleted.

  6      Before  retrying,  we sleep for n seconds. n is initially 5 sec-
         onds, but after every retry 5 extra seconds is  added  up  to  a
         maximum  of  60  seconds (an incremental backoff). Then we go to
         step 2 up to retries times.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4

  parent reply	other threads:[~2003-02-18 16:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-15  7:02 MAIL_USE_FLOCK and Debian Rob Browning
2003-02-15 19:11 ` Richard Stallman
2003-02-15 20:26   ` Rob Browning
2003-02-17  7:20     ` Richard Stallman
2003-02-17 15:31       ` Rob Browning
2003-02-17 21:20         ` Florian Weimer
2003-02-17 21:32           ` Rob Browning
2003-02-17 21:41             ` Florian Weimer
2003-02-17 21:56           ` Alan Shutko
2003-02-17 22:20             ` Rob Browning
2003-02-18 16:03           ` Rob Browning [this message]
2003-02-18 13:59         ` Richard Stallman
2003-02-18 15:58           ` Rob Browning
2003-02-19  7:16             ` Richard Stallman
2003-02-19 17:11               ` Rob Browning
2003-02-19 18:03                 ` David Masterson
2003-02-20 18:21                 ` Richard Stallman
2003-02-20 19:22                   ` Rob Browning
2003-02-21 21:44                     ` Richard Stallman
2003-02-24  2:58                       ` Rob Browning
2003-02-28  8:14                       ` Michael Sperber [Mr. Preprocessor]
2003-03-01 21:44                         ` Richard Stallman
2003-03-02 10:06                           ` Michael Sperber [Mr. Preprocessor]
2003-03-03 18:58                             ` Richard Stallman
2003-03-04  8:30                               ` Michael Sperber [Mr. Preprocessor]
2003-03-05 20:46                                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874r717ezv.fsf@raven.i.defaultvalue.org \
    --to=rlb@defaultvalue.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.