From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqIni-0007Y6-9M for qemu-devel@nongnu.org; Sat, 01 Oct 2016 07:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqIne-0003Sr-6U for qemu-devel@nongnu.org; Sat, 01 Oct 2016 07:49:53 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqInd-0003SV-W7 for qemu-devel@nongnu.org; Sat, 01 Oct 2016 07:49:50 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 7FC1620B0E for ; Sat, 1 Oct 2016 13:49:46 +0200 (CEST) Date: Sat, 1 Oct 2016 07:47:46 -0400 From: Felix Janda Message-ID: <20161001114746.GA274@nyan> References: <20160930233959.GB5887@nyan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] linux-user: include for F_EXLCK and F_SHLCK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Riku Voipio Peter Maydell wrote: > On 30 September 2016 at 16:39, Felix Janda wrote: > > The F_EXLCK and F_SHLCK fcntl lock constants are obsolete synonyms for > > F_WRLCK and F_RDLCK. > > This seems unlikely, since on for instance Alpha F_EXLCK is > 16, F_SHLCK is 32, F_RDLCK is 1 and F_WRLCK is 2, so they're > all distinct: > http://lxr.free-electrons.com/source/arch/alpha/include/uapi/asm/fcntl.h#L52 I've now looked at linux-1.0, linux-2.0 and linux-2.4. In all of them, the constants are used in fs/locks.c. In linux-1.0, F_SHLCK has almost the same effect as F_RDLCK, except that F_SHLCK accepts also files with write but without read permission. Similarly for F_EXLCK. In linux-2.0 when F_EXLCK or F_SHLCK are used, the flag F_BROKEN gets set. Finally, in linux-2.4 they just lead to EINVAL. So I guess that the commit message should more accurately say that the constants were used in the past for a broken flock implementation. With this closer look at the history of these constants, it is also not clear to me whether qemu should care at all about translating them. Felix