I want to know how to implement ioctl
command for a character device in FreeBSD.
I already write a character device with open()
close()
read()
write()
but I don't know what argument should I pass to ioctl_handler
. Does anybody know the prototype of d_ioctl_t
?
A quick google search found this page where d_ioctl_t
is defined as:
typedef int d_ioctl_t(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td);