Text File

Aucbvax.4110 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Tue Sep 29 16:35:40 1981 mail locking problems >From pur-ee!rick@Berkeley Tue Sep 29 16:33:43 1981 In-reply-to: decvax!duke!smb

There are several possible locking problems that could cause mailboxes to be garbaged. One is that /bin/mail and /u/ucb/mail use different conventions as to what a lock is. If they are not the same, obviously, there will never be any interlocking done and your mailbox can be smashed.

The other that comes to mind is that /bin/mail uses a very poor locking scheme. It uses the world execute bit of the mailfile to indicate busy, not busy. The lock code must do a stat, followed by a chmod of the file if it is not already busy. There is plently of time for a race condition to occur on a loaded system. I would recommend using the presence of a lock file and trying to link to it as a pretty reliable interlock scheme. This is similar to the way /usr/ucb/mail does it (Although they do it on a different file). ---rick (pur-ee!rick)

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.