From owner-freebsd-bugs Sun Nov 18 13:46:57 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from lion.com.ua (lion.com.ua [213.133.161.130]) by hub.freebsd.org (Postfix) with ESMTP id 5C70337B405; Sun, 18 Nov 2001 13:46:50 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by lion.com.ua (8.11.6/8.11.6) with ESMTP id fAILkjx62186; Sun, 18 Nov 2001 23:46:45 +0200 (EET) (envelope-from sacomsys@lion.com.ua) Date: Sun, 18 Nov 2001 23:46:45 +0200 (EET) From: Andrey Simonenko To: iedowse@FreeBSD.org Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/23353: fcntl(F_GETLK) return l_pid equal to -1 for the file loked with flock() In-Reply-To: <200111181559.fAIFxE920989@freefall.freebsd.org> Message-ID: <20011118233624.H62085-100000@lion.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, 18 Nov 2001 iedowse@FreeBSD.org wrote: > Synopsis: fcntl(F_GETLK) return l_pid equal to -1 for the file loked with flock() > > State-Changed-From-To: open->feedback > State-Changed-By: iedowse > State-Changed-When: Sun Nov 18 07:58:16 PST 2001 > State-Changed-Why: > > Can this be closed? In the audit-trail it is suggested that this is > expected behaviour. > May be my bug report isn't really a bug, but a message from Maxim didn't make me think so. I know that in one case locks are inhereted by childs, and in other case they aren't. The original my bug report was about another thing. In the fcntl(2) manual page we can read that: "Note that flock(2) and fcntl(2) locks can be safely used concurrently". And this works. And if I locked some file with flock(2), then fcntl(F_GETLK) call in some another process can tell me that that file is locked. But l_pid field in the flock structure always is equal to -1 if file is locked with flock(2) call (at least in my experiments). Also I haven't find any information about this in manual pages. > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23353 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message