Re: sg.h

Douglas Gilbert (dgilbert@interlog.com)
Sat, 20 Nov 1999 00:27:36 -0500


> Hello,
>
> I suppose this has been asked before, but what I should use
> /usr/include/scsi/ (the one that comes with glibc-2.1.x) or I should make
> a link
>
> /usr/include/scsi -> /usr/src/linux/include/scsi
>
> it seems that the SG_BIG_BUF macro is defined in /usr/include/scsi/sg.h
> but also in /usr/src/linux/include/scsi/sg.h and it appears that they are
> not synced. So if I change /usr/include/scsi/sg.h (for cdrecord & co)
> should I change the sg.h in the kernel tree?

The directory /usr/include/scsi belongs to the GNU library
while /usr/src/linux/include/scsi belongs to kernel source
tree. "Logically" they should contain the same files. What
actually seems to happen is that the former lags the latter.

Now if you replaced the word "scsi" with "linux" in the
2 directories in the above paragraph then this is no problem
because /usr/src/linux is a symbolic link to the other.
Andreas Jaeger <aj@suse.de> and others have suggested that
it is wrong-headed of me to suggest the same solution
should apply to /usr/include/scsi. So that's where we stand at
the moment. RH 6.0 and RH 6.1 have out of sync sg.h headers.
Andreas has indicated that he will get them into sync. This
will be quiet difficult to do because sg.h is different in
the 2.2 and 2.3 series of kernels (only marginally at the moment).

At least 3 Linux kernel header files (for user space usage) are
effected by this:
sg.h [ as noted above ]
scsi.h [ currently in sync ]
scsi_ioctl.h [ not present in /usr/include/scsi ]
I have yet to check but the multiple queue work on the SCSI
sub-system by Eric Youngdale may well open up a difference
in the 2.2 and the 2.3 versions of scsi.h .

Monty who is the author of cdparanoia cleverly side steps
these problems by including sg.h in his application as follows:
#include <linux/../scsi/sg.h>
I also follow the same pattern in my example and utility
programs based on sg.

Perhaps it would make more sense if
#include <linux/scsi/sg.h>
found the relevant header. Also scsi.h is a bit quirky and
would also make more sense under the linux directory. An
example of this quirkiness is CHECK_CONDITION being defined
as 1 in the Linux SCSI sub-system and having the value 2
in the SCSI standards.

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/