On Tue, Feb 04, 2003, Christopher Hoover <[EMAIL PROTECTED]> wrote: > libusb (cvs development branch) fails on ARM and probably on other RISC > architectures under Linux because key structures passed from the kernel > to user space differ in the use of the packed attribute. > > In particular struct usb_device_descriptor comes up as 20 bytes in user > space and as 18 bytes in the kernel on ARM. The kernel writes it one > way, libusb reads it another, and bad stuff happens. > > There may be other instances of this. > > The solution with gcc and linux is easy: use __attribute__ ((packed)) > precisely as it is used in the kernel. I leave the more generic > solution as an exercise for the reader. :-)
Aha. I'm worried that using the extended gcc syntax will reduce the portability of the code to the other platforms that support (or will support) libusb. Perhaps it would be better to hand parse the structure out? JE ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
