Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 2010 13:47:25 -0500
From:      dieterbsd@engineer.com
To:        freebsd-drivers@freebsd.org
Subject:   Re: Inappropriate ioctl for device
Message-ID:  <8CD71B2243BC410-958-12946@web-mmc-d03.sysops.aol.com>

index | next in thread | raw e-mail

> 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");
   }




help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8CD71B2243BC410-958-12946>