Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 2010 18:17:18 +0330
From:      Mohammad Hedayati <hedayati.mo@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Inappropriate ioctl for device
Message-ID:  <AANLkTimuz3KWG80yXR8gmg%2BYxVKW0pQyF2wtfwXqKU3K@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I'm writing a simple char device. So far everything went so good
(read/write), but here I'm going to add support for ioctl.

int
ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
     int error = 0;
     uprintf("Here...\n");
     return(error);
}
and I'm calling it here:

len = ioctl(cd, 0);
perror("ioctl");

but when runnig it says:

ioctl: Inappropriate ioctl for device



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimuz3KWG80yXR8gmg%2BYxVKW0pQyF2wtfwXqKU3K>