[sane-devel] failing make sane-backends-1.0.18;
sanei_scsi question
Gerhard Jaeger
gerhard at gjaeger.de
Fri Jan 19 08:12:39 CET 2007
On Thursday 18 January 2007 20:55, abel deuring wrote:
[SNIPSNAP]
> GNU C Library stable release version 2.5 (20061011), by Roland
ah - I see pretty new beast ;)
> Compiled on a Linux 2.6.18 system on 2006-11-26.
Hmmm - okay. So they will use these headers...
>
> >>> Anyway could you guys please try and add the compiler.h only to the
> >>> HAVE_SCSI_SG_H path?
> >> Well, before making any "real" patch, the first thing I'd like to
> >> know is, if we have a special Suse 10.2 bug, or if something changed
> >> in the kernel headers...
> >
> > Hmmm - seems we need to check how they compile their glibc and which
> > kernel-headers they use - I think Johannes is around and might could
> > shade some light on that - maybe also on that resmgr stuff.
>
> I think you spotted the cause in the diff file:
Well, I've only copied the patch from the SuSE srpm ;)
> > BTW: they use the following patch:
> > --- sanei/sanei_scsi.c.orig 2005-04-22 10:36:17.000000000 +0200
> > +++ sanei/sanei_scsi.c 2006-07-04 10:16:49.000000000 +0200
> > @@ -1273,7 +1273,7 @@
> > disconnect... ;-( */
> > {
> > int timeout;
> > - timeout = sane_scsicmd_timeout * HZ;
> > + timeout = sane_scsicmd_timeout * sysconf(_SC_CLK_TCK);
> > ioctl (fd, SG_SET_TIMEOUT, &timeout);
> > }
> > #endif
>
> Seems that the Suse folks did not trust the usage of the HZ macro
> that much. IIRC, HZ gives something like the kernel-internal timer
> resolution or similar, and specifiying this value outside a header
> file make some sense.
Since 2.6, the kernel runs with two timer resolutions, one for the
internal accounting, which is in general 1000Hz -> 1ms and the other
one having a 4ms = 100Hz resolution (the default). The later one is in
general reflected by the HZ, that is used in the scsi lib.
While doing some cross-compilation stuff, I've already seen this
sysconf stuff, so it should be save to use it. Could you please
check the attached patch? (It's borrowed from gdb code)
> Compiling sanei_scsi.c from sane-backends 1.1.18 with this patch
> instead of the added #include line works fine.
>
That's what I've expected ;)
Gerhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sanei_scsi-HZ.patch
Type: text/x-diff
Size: 1038 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20070119/1f4a7757/sanei_scsi-HZ.bin
More information about the sane-devel
mailing list