mail locking
Jay Lepreau
lepreau at utah-cs.UUCP
Fri Mar 16 17:04:00 AEST 1984
That's the whole point, that EVERY program that writes on /usr/spool/mail/user
must observe the same locking protocol. Another problem with the locking as
distributed (in 4.x bsd at least) is that the timeout in binmail is too
short: only 30 seconds. After that binmail declares the lock defunct and
merrily appends to the mail file. That can easily be exceeded on a not very
loaded system by a user with a big mailbox, and many keep their boxes full of
pending mail. As distributed, UCB Mail has the long timeout of 5 minutes,
but that is the program that normally only needs a short timeout, as
/bin/mail will append quickly.
Anyway, I have extracted the relevant locking code into a module mlock.c
containing, ah hah, mlock and mfree, which lock on /tmp. If people want I'll
send it out (it's pretty minor, but it's done). I didn't use 4.2 file locking
locking so it is portable.
Jay Lepreau
More information about the Comp.unix
mailing list