All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Kiryukhin <savl@dev.rtsoft.ru>
To: linux-mips@linux-mips.org
Cc: Pavel Kiryukhin <savl@dev.rtsoft.ru>
Subject: input_event for 64-bit kernel and 32-bit userland.
Date: Wed, 02 Jun 2004 14:06:10 +0400	[thread overview]
Message-ID: <40BDA692.50606@dev.rtsoft.ru> (raw)

Hi all,
I stuck in simple situation:
USB mouse (or keyboard). n64 kernel (2.4.20), n32 userland.

Userspace application tries to read "input_event" (16 bytes) from 
"/dev/input/event0" [ read(fd,&key_ev, sizeof(key_ev)) ],
input core driver treats "input_event" as 24 bytes structure. It is due 
to different size of  "timeval" (and finally  "long") in n64 kernel and 
n32 userland.

Application gets some garbage as mouse events . No solutions like "ioctl 
wrappers" applicable in this case.

I don't want to change any arch independent files, but can not find any
acceptable solution. It looks like headers "/usr/include/linux/input.h" 
in root file system and "/include/linux/input.h" in kernel should be the 
same,
 (All works fine as soon as I declare a new "input_event" structure in 
user application that corresponds in size to kernel
structure - but this is not acceptable).

Can anybody advice me what to do with the difference in "input_event"
structure sizes in o32/n32 userland and n64 kernel? Just a general 
approach that can be used when  driver's read/write operation treat some 
values as 64 bit while user application tries to read/write 32-bit 
values (based on the same headers).

Please, don't kick me if solution is simple and obvious.
---
Thanks,
Pavel Kiryukhin.

             reply	other threads:[~2004-06-02 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 10:06 Pavel Kiryukhin [this message]
2004-06-02 10:55 ` input_event for 64-bit kernel and 32-bit userland Jan-Benedict Glaw

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=40BDA692.50606@dev.rtsoft.ru \
    --to=savl@dev.rtsoft.ru \
    --cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.