Re: Redundant memset in AIO read_events

Dan Kegel (dank@kegel.com)
Wed, 09 Jul 2003 09:13:38 -0700


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/