Inappropriate ioctl for device

dieterbsd at engineer.com dieterbsd at engineer.com
Fri Dec 24 18:47:44 UTC 2010


> and I'm calling it here:
>
> len = ioctl(cd, 0);
> perror("ioctl");
>
> but when runnig it says:
>
> ioctl: Inappropriate ioctl for device
>
> where's the problem?

You should only call perror if ioctl returned -1.
Try:

len = ioctl(cd, 0);
if (len == -1)
   {
      perror("ioctl");
   }




More information about the freebsd-drivers mailing list