[sane-devel] Re: Sane on Ultra Sparc

T. Ribbrock emgaron@gmx.net
Fri, 10 Jan 2003 22:00:01 +0100

On Fri, Jan 10, 2003 at 05:38:12PM +0100, abel deuring wrote:
> "T. Ribbrock" wrote:
> Hmmm. Are you sure that cdrecord works as a 32 bit application on a 64
> bit Linux kernel using the SG interface?

Aparently yes... I don't have a burner in an Ultra myself, but on
aurora-devel, there's at least one person happily buring away on his
U10. And the app itself is indeed compiled as 32bit, as is libc on
which it depends.

> But the point, where the SG driver complains, is different: Sane uses
> the SG3 interface. This means to define a variable of type strct
> sg_io_hdr, defined in sg.h, to fill in the proper value and to issue a
> write() call for an SG device with this variable.
> struct sg_io_hdr is defined as:
> One of the first things done by the SG driver is to check, if the 3rd
> parameter of the write call, i.e., the write size, equals
> sizeof(sg_io_hdr). If this is not the case, errno is set to EINVAL (22
> for SPARC Linux). And exactly this happens, because sizeof(sg_io_hdr) is
> different for 32 bit and 64 bit programs.

Ah. Thanks for the clarification! Very enlightening, indeed!

> So, what you can do:

> I'd prefer (1) or (2), because the SG3 interface is much cleaner than
> the old interface, but it might be a bit easier, because the the old
> interface did paass any pointers to the driver. 

From what I can see so far, (2) would probably be the most "elegant"
Status: O

in so far as it reflects the reality in userland on these systems. But
that's my opinion.

Regards and thanks for all the information!

      Thomas Ribbrock    http://www.ribbrock.org    ICQ#: 15839919
   "You have to live on the edge of reality - to make your dreams come true!"