[sane-devel] Found: why Sane make barfed under RH6.1

Douglas Gilbert dgilbert@interlog.com
Thu, 14 Mar 2002 22:20:32 -0500


Tim Waugh wrote:
> On Thu, Mar 14, 2002 at 10:10:15AM +0300, Max Ushakov wrote:
> 
> 
>>So maybe it is still correct to use all kernel includes instead
>>of the corresponding glibc includes.
>>
> 
> It is not.

Definitely not all of them. Only one springs to mind :-)
In 99% of cases applications get to kernel facilities
via glibc interfaces. That allows for compliance with
posix and Unix98 (etc) standards and a measure of cross
platform portability between Unix like OS-es (e.g. Solaris,
Linux and FreeBSD). However glibc (and the linux kernel itself)
don't offer much support for talking to things like
scanners.

In the case of the Linux sg driver the only support glibc
offers is a reworked version of sg's header file. Since
the linux kernel and glibc are released by different
groups on different timetables, there is bound to be
an "impedance mismatch" from time to time. It is also
worth noting that some recent distributions do not have
the kernel headers (i.e. /usr/src/linux/include/*)
loaded by default.

Short (politically incorrect) answer: copy the sg header
from the kernel source if you must.

Doug Gilbert