Re: [rfc] epoll interface change and glibc bits ...

From: Davide Libenzi (davidel@xmailserver.org)
Date: Wed Nov 20 2002 - 18:57:26 EST


On Wed, 20 Nov 2002, Mark Mielke wrote:

> On Wed, Nov 20, 2002 at 03:19:30PM -0800, Davide Libenzi wrote:
> > On Wed, 20 Nov 2002, Mark Mielke wrote:
> > > > struct epoll_event {
> > > > unsigned short events;
> > > > unsigned short revents;
> > > > __uint64_t obj;
> > > > };
> > > Forget any argument I had against removing 'fd'. This sounds good.
> > > Perhaps 'obj' should be named 'userdata'?
> > > struct epoll_event {
> > > unsigned short events;
> > > unsigned short revents;
> > > __uint64_t userdata;
> > > };
> > Do we want to have a union instead of a direct 64bit int ?
>
> I was going to suggest this, except I couldn't figure out what to
> suggest that it look like... I finally figured that the value could be
> cast, or wrapped in a union by userspace (although theoretically, this
> might mean more words than absolutely necessary to initialize on a
> 32-bit CPU...)
>
> What were you thinking? 1X64 bit or 2X32 bit?

Something like :

typedef union epoll_obj {
        void *ptr;
        __uint32_t u32[2];
        __uint64_t u64;
} epoll_obj_t;

I'm open to suggestions though. The "ptr" enable me to avoid wierd casts
to avoid gcc screaming.

- Davide

-
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/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:34 EST