qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Felix Janda <felix.janda@posteo.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Riku Voipio <riku.voipio@iki.fi>
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	[thread overview]
Message-ID: <20161001114746.GA274@nyan> (raw)
In-Reply-To: <CAFEAcA8HMcL6DB9sdc2VO0GPHXG=w6mztBg8dp3XkwGA_1__hQ@mail.gmail.com>

Peter Maydell wrote:
> On 30 September 2016 at 16:39, Felix Janda <felix.janda@posteo.de> 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

      parent reply	other threads:[~2016-10-01 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30 23:39 [Qemu-devel] [PATCH] linux-user: include <linux/fcntl.h> for F_EXLCK and F_SHLCK Felix Janda
2016-10-01  2:38 ` Peter Maydell
2016-10-01  3:20   ` Felix Janda
2016-10-01 11:47   ` Felix Janda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161001114746.GA274@nyan \
    --to=felix.janda@posteo.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).