"Inappropriate ioctl for device" when using scsi_sg

Xin LI delphij at delphij.net
Wed Aug 5 23:48:32 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, Tim,

Tim wrote:
> Hello,
> 
> I'm trying to port a small piece of software from Linux to FreeBSD
> which utilizes the Linux SCSI sg interface.  I saw that FreeBSD offers
> a similar interface in version 7 and later, so I thought I would give
> it a try.
[...]
> Any ideas what I'm doing wrong?  I can provide source code, though it
> is almost identical to the current release version (see link above).
> Initially I mostly just wanted to ensure I wasn't missing something
> obvious.  If this isn't the appropriate mailing list, please direct me
> to the correct one. 

My understanding is that, by default (GENERIC), sg device is not
compiled into the kernel, so, in order to use it, you may have to
compile your own kernel and add:

	device sg

In the configuration.  The device would appear as "/dev/sg0", etc.;
Linux style "/dev/sga /dev/sgb" would appear as symlinks.

Cheers,
- --
Xin LI <delphij at delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iEYEARECAAYFAkp6GfIACgkQi+vbBBjt66DTKwCfe8I/ijSY4LifmqRghfd9Gbmi
424AoItYL9LxrUOEdi2JGMSHAGEMX5Qs
=AHh0
-----END PGP SIGNATURE-----


More information about the freebsd-scsi mailing list