Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site laidbak.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!dual!qantel!ihnp4!laidbak!dpb From: dpb@laidbak.UUCP (Darryl Baker) Newsgroups: net.bugs.uucp Subject: A better way to check lockfiles for HoneyDANBER. Message-ID: <247@laidbak.UUCP> Date: Tue, 8-Oct-85 14:21:29 EDT Article-I.D.: laidbak.247 Posted: Tue Oct 8 14:21:29 1985 Date-Received: Fri, 11-Oct-85 08:23:56 EDT Reply-To: dpb@laidbak.UUCP (Darryl Baker) Organization: LAI Chicago Lines: 25 In looking at justifing the cost of us getting HoneyDANBER uucp for our 4.2BSD system I found it still used timestamps on the lock file to see if the lock was old. On System V systems HoneyDANBER uses kill(0,pid) to see if the process who created the lock file still exists. Well on 4.2 systems it could do the same sort of thing using the getpriority() system call since it allows anyone to get the priority of a process. The usage would be: errno = 0; /* the kernel also clear this */ getpriority(PRIO_PROCESS, pid);/* returns the priority of */ /* but who cares and -1 is */ /* a valid priority */ if(errno == ESRCH){ remove lockfile } else { lock valid } Using this would eliminate the problem of getting two processes doing things at the same time. -- from the sleepy terminal of Darryl Baker [ihnp4!]laidbak!dpb