From owner-freebsd-hackers Fri Aug 30 13:21:58 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA18049 for hackers-outgoing; Fri, 30 Aug 1996 13:21:58 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id NAA17968 for ; Fri, 30 Aug 1996 13:21:10 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id WAA18444 for ; Fri, 30 Aug 1996 22:21:03 +0200 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id WAA14930 for freebsd-hackers@freebsd.org; Fri, 30 Aug 1996 22:21:02 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id VAA04330 for freebsd-hackers@freebsd.org; Fri, 30 Aug 1996 21:52:25 +0200 (MET DST) From: J Wunsch Message-Id: <199608301952.VAA04330@uriah.heep.sax.de> Subject: Re: [ELM 2.4ME+ PL25 (25)] - folder is corrupt! To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Fri, 30 Aug 1996 21:52:24 +0200 (MET DST) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199608301035.OAA00606@nagual.ru> from "[?KOI8-R?]" at "Aug 30, 96 02:35:27 pm" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As [?KOI8-R?] wrote: > > fcntl() on the entire file is identical to flock() -- they use the > > same functions internally. > > No, you lose your fcntl lock on any close of the file, so you > can't fcntl lock passwd then use getpw*() functions, read Ok. So it's not identical, but the behaviour when locking a mail spool is the same (as long as you don't apply getpw* functions to your mail spool :). I haven't tested it, but from reading the code it looks as if two applications where one applies the lock with fcntl() and the other one tests with flock() (or visa verse) will do the right thing. > man fcntl for more info. fcntl lock treated as depriciated > in BSD. It's not deprecated (after all, it's Posix), only stupid. ;) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)