Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP (Chris Torek)
Newsgroups: net.unix-wizards
Subject: Re: Question on how to implement exclusive scheduling
Message-ID: <373@umcp-cs.UUCP>
Date: Tue, 16-Oct-84 22:31:04 EDT
Article-I.D.: umcp-cs.373
Posted: Tue Oct 16 22:31:04 1984
Date-Received: Thu, 18-Oct-84 06:43:49 EDT
References: <620@trwspp.UUCP> <154@desint.UUCP>
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 26

Note, however, that implementing arbitrary mandatory locking is not
a good idea as anyone can then write something like this:

	#include 

	main() {
		int fd, i;

		for (i = 0; i < 31; i++)
			(void) signal(i, SIG_IGN);
		fd = open("/etc/passwd", 0);
		lockf(fd, -1);	/* lock it to EOF */
		pause();	/* or, for(;;); is even more malicious */
	}

If there are no system administrators already logged in you may
have to halt the machine from the console.

There are numerous ways around this, the easiest probably being to
use advisory locks rather than mandatory locks.
-- 
(This mind accidently left blank.)

In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland