Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283027

Re: [Y2038] [PATCH 0/3] introduce new evdev interface type

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [Y2038] [PATCH 0/3] introduce new evdev interface type
Date 2015-12-03 14:00 +0100
Message-ID <qBBEn-58q-27@gated-at.bofh.it> (permalink)
References <qzo8y-1rQ-7@gated-at.bofh.it> <qBBEm-58q-11@gated-at.bofh.it> <qBBEm-58q-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thursday 03 December 2015 13:54:47 Arnd Bergmann wrote:
> > > struct input_event {
> > > #if !defined(__KERNEL__) && __TIME_T_BITS == __BITS_PER_LONG
> > >        struct timeval time;
> > 
> > > #else
> > >     struct {
> > >             union {
> > >                     __u32 tv_sec __attribute__((deprecated));
> > >                     __u32 tv_sec_monotonic;
> > >             };
> > >             __s32 tv_usec;
> > >     } time;
> > > #endif
> > >        __u16 type;
> > >        __u16 code;
> > >        __s32 value;
> > > };
> > 
> > I have one question here, if userspace use this structure, all helper functions
> > of timeval will not work. And userspace need to write extra helper function for
> > this fake timeval. This just create an another urgly time structure.
> 
> Correct, this is a useful side-effect of the change: any user space access to
> the event->time member that assumes it's a timeval will cause a compile-time
> warning or error (depending on the access), which helps us identify the
> broken code and fix it to use monotonic times as well as access the right
> struct members.
> 

To clarify, the code also intentionally only changes the types when
we are compiling with a new 32-bit libc: everything that builds today
will continue to build and work without warnings, unless it gets
recompiled with 64-bit time_t and needs to be fixed.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 0/3] introduce new evdev interface type Pingbo Wen <pingbo.wen@linaro.org> - 2015-12-01 09:40 +0100
  Re: [PATCH 0/3] introduce new evdev interface type Arnd Bergmann <arnd@arndb.de> - 2015-12-01 11:50 +0100
    Re: [Y2038] [PATCH 0/3] introduce new evdev interface type Arnd Bergmann <arnd@arndb.de> - 2015-12-03 14:00 +0100
      Re: [Y2038] [PATCH 0/3] introduce new evdev interface type Arnd Bergmann <arnd@arndb.de> - 2015-12-03 14:00 +0100
    Re: [PATCH 0/3] introduce new evdev interface type Pingbo Wen <pingbo.wen@linaro.org> - 2015-12-03 14:00 +0100

csiph-web