mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Gordeev <lasaine@lvk.cs.msu.su>
To: uClibc <uclibc@uclibc.org>, linux-kernel@vger.kernel.org
Subject: timerfd incompatibility on mips
Date: Fri, 28 Jan 2011 03:24:43 +0300	[thread overview]
Message-ID: <20110128032443.6f8b877e@apollo.gnet> (raw)

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

Hi!

I've just found a problem with TFD_NONBLOCK flag that can be passed to
timerfd_create.

<uclibc>/libc/sysdeps/linux/common/sys/timerfd.h which is installed
to /usr/include/sys/timerfd.h defines TFD_NONBLOCK as 04000 ie 0x800.
BTW glibc/eglibc headers do the same thing.

<linux>/include/linux/timerfd.h declares it as O_NONBLOCK which is
defined in fcntl.h. Usually O_NONBLOCK is 0x800 too but some
architectures including MIPS it redefine it:

arch/mips/include/asm/fcntl.h:#define O_NONBLOCK	0x0080
arch/alpha/include/asm/fcntl.h:#define O_NONBLOCK	00004
arch/sparc/include/asm/fcntl.h:#define O_NONBLOCK	0x4000
arch/parisc/include/asm/fcntl.h:#define O_NONBLOCK	000200004

My tests show that kernel thinks that TFD_NONBLOCK is 0x80 on MIPS. I
get what I want when I pass 0x80 and EINVAL when I pass 0x800. I don't
know why there are such uncertain things in Linux. Probably the problem
should be fixed in the kernel.

Right now one cannot use timerfd_create(..., TFD_NONBLOCK) on MIPS but
can use timerfd_create(..., O_NONBLOCK) instead.

-- 
  Alexander

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

             reply	other threads:[~2011-01-28  0:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28  0:24 Alexander Gordeev [this message]
2011-01-28  0:53 ` Davide Libenzi
2011-01-28  1:24   ` Alexander Gordeev
2011-01-28  1:49     ` Davide Libenzi
2011-01-28 10:17       ` Alexander Gordeev

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=20110128032443.6f8b877e@apollo.gnet \
    --to=lasaine@lvk.cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uclibc@uclibc.org \
    /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

all inboxes | Powered by JetHome®