implementing ioctl() commands in FreeBSD

Posted by thecoffman on Stack Overflow See other posts from Stack Overflow or by thecoffman
Published on 2010-03-22T01:40:33Z Indexed on 2010/03/22 1:41 UTC
Read the original article Hit count: 377

Filed under:
|
|
|

I am adding some code to an existing FreeBSD device driver and I am trying to pass a char* from user space to the driver. I've implemented a custom ioctl() command using the _IOW macro like so: #define TIBLOOMFILTER _IOW(0,253,char*)

My call looks something like this:

int file_desc = open("/dev/ti0", O_RDWR);
ioctl(file_desc, TIBLOOMFILTER, (*filter).getBitArray());
close(file_desc);

When I call ioctl() I get: Inappropriate ioctl for device as an error message. Any guess as to what may be doing wrong? I've defined the same macro in my device driver, and added it to the case statement.

© Stack Overflow or respective owner

Related posts about posix

Related posts about freebsd