Subject: Re: uugetty for NetBSD
To: None <cjs@portal.ca>
From: Simon J. Gerraty <sjg@Quick.com.au>
List: current-users
Date: 11/11/1996 23:35:52
In lists.netbsd.current-users Curt Sampson writes:
>.Ft int
>.Fn pidlock "const char *lockfile" "int flags" "pid_t *locker"

Just while you are thinking about this, and at the risk of being
flamed mightily by all and sundry :-) My misc lock routine (not used
for uucp locks - I have simpler versions for that) puts the host name
and file being locked into the lock file.  

The file name so that scripts can simply cat the lock file at the user
to explain why they can't proceed, and the hostname because I've had
occasion to need to do locks on shared filesystems (eg NFS) and while
I'm sure its not a perfect solution (what is?) it is better than
nothing. The lock function knows it can only test the lock's validity
if the hostnames match.

--sjg
-- 
Simon J. Gerraty        <sjg@quick.com.au>

#include <disclaimer>   /* imagine something _very_ witty here */