Re: Redundant memset in AIO read_events

From: Dan Kegel (dank@kegel.com)
Date: Wed Jul 09 2003 - 11:13:38 EST


Luck, Tony wrote:
> That is true, but here's the definition of the io_event strcuture:
>
> struct io_event {
> __u64 data;
> __u64 obj;
> __s64 res;
> __s64 res2;
> };
>
> In the words of the comment, C may be "fun", but I've
> having trouble envisioning an architecture where a structure
> that consists of four equal sized objects has some padding!

<newbie>
There might be some architecture that requires 16 byte alignment...
how about surrounding the memcpy with if (sizeof(struct io_event) != 4 * sizeof(__u64)) ?
</newbie>

-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

- 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 : Tue Jul 15 2003 - 22:00:31 EST