From owner-freebsd-hackers Sun Aug 22 17:37:12 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 4E489154CD; Sun, 22 Aug 1999 17:36:58 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id KAA15386; Mon, 23 Aug 1999 10:06:56 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id KAA83413; Mon, 23 Aug 1999 10:06:54 +0930 (CST) Date: Mon, 23 Aug 1999 10:06:54 +0930 From: Greg Lehey To: Matthew Dillon Cc: FreeBSD Hackers , FreeBSD Committers Subject: Re: Mandatory locking? Message-ID: <19990823100654.B83273@freebie.lemis.com> References: <19990823095310.A83273@freebie.lemis.com> <199908230031.RAA00909@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199908230031.RAA00909@apollo.backplane.com>; from Matthew Dillon on Sun, Aug 22, 1999 at 05:31:44PM -0700 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sunday, 22 August 1999 at 17:31:44 -0700, Matthew Dillon wrote: > >> Questions: >> >> 1. Do we have some form of mandatory locking? If so, what is it? > > No we don't, unless you count the ad-hoc lockout in the master/slave pty > interface :-). > >> 2. Would it make sense to implement System V's fcntl semantics? >> They're rather tacky: you set the setgid bit and reset the group >> exec bit of the file permissions. > > Ugh. Yuch. No, nothing to do with permission bits, not for something > this convoluted! I don't like it either, but for compatibility reasons it would make sense. That's why I suggested a sysctl knob. >> 3. Alternatively (or additionally), would it make sense to have an >> additional fcntl function which performs mandatory locking? >> >> I think that it's probably a good idea to implement (3), and also to >> do (2), possibly subject to a sysctl knob. > > Well, #3 can't be mandatory if you have to make a fcntl call! Somehow you need to get a lock. > You mean have one program make a fcntl call that causes other > programs to return an error or block if they try to open that > file while the first program holds an open descriptor? Correct. I suppose it's worth discussing what the default should be. Should they get EAGAIN or block? Obviously you'd want a way of specifying which, but there would have to be a default for non-lock-aware programs. I think I'd go for blocking; it's less error prone. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message