Page 1 of 1

IOCTL function

Posted: Sun Apr 11, 2004 11:00 pm
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

RE:IOCTL function

Posted: Mon Apr 12, 2004 11:00 pm
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.

RE:IOCTL function

Posted: Mon Apr 12, 2004 11:00 pm
by pepito
Yes, but I do it using the 'dev_open()' and 'dev_write()' functions.

Do the IOCTL() the same?

pepito

RE:IOCTL function

Posted: Mon Apr 12, 2004 11:00 pm
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

RE:IOCTL function

Posted: Tue Apr 13, 2004 11:00 pm
by pepito
Thank you very much!

But the link seems to be wrong!

pepito

RE:IOCTL function

Posted: Sun Apr 18, 2004 11:00 pm
by carbonBased
Works for me!

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

Jeff