IOCTL function

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

IOCTL function

Post by pepito »

I am working with into the 'device manager' and I have defined the basic functions:

dev_open()
dev_read()
dev_write()
dev_close()

But I have read that exist another function named IOCTL().

What this function do?
Is important?

Thank you,

pepito
Anton

RE:IOCTL function

Post by Anton »

IOCTL=input output contorl
This function is used for streams(sockets). For instance, if you need to write to a com port, you would open it as a stream and write to it as if it is a file.
Anton.
pepito

RE:IOCTL function

Post by pepito »

Yes, but I do it using the 'dev_open()' and 'dev_write()' functions.

Do the IOCTL() the same?

pepito
carbonBased

RE:IOCTL function

Post by carbonBased »

Check out:
http://www.die.net/doc/linux/man/man2/ioctl.2.html

Essentially IOCTL is used on open files (which, of course, can be devices in Unix) to further control their attributes -- in a device dependant way.

they can be used to set the baud rate of a modem attach to com2, for example.

Jeff
pepito

RE:IOCTL function

Post by pepito »

Thank you very much!

But the link seems to be wrong!

pepito
carbonBased

RE:IOCTL function

Post by carbonBased »

Works for me!

Just try a google search on 'ioctl man page' that's what I searched for.

Jeff
Post Reply