qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: include <linux/fcntl.h> for F_EXLCK


From: Felix Janda
Subject: Re: [Qemu-devel] [PATCH] linux-user: include <linux/fcntl.h> for F_EXLCK and F_SHLCK
Date: Sat, 1 Oct 2016 07:47:46 -0400
User-agent: Mutt/1.6.1 (2016-04-27)

Peter Maydell wrote:
> On 30 September 2016 at 16:39, Felix Janda <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]