IOCTL function provides a thin wrapper over the Unix
system call. IOTCL performs special functions on the specified
file. The set of functions actually available depends on your version of Unix and the type of file (tty, tape, disk file, etc.) referred to.
To use IOCTL, read the C programmer's documentation describing the
function for the desired device and convert all constants and data to their IDL equivalents.
The value returned by the system
function is returned as the value of the IDL IOCTL function.
A longword integer that specifies the ioctl request code. These codes are usually contained in C language header files provided by the operating system, and are not generally portable between Unix versions. If one of the "MT" keywords is used, this argument can be omitted.
A named variable through which data if passed to and from ioctl. IOCTL requests usually request data from the system or supply the system with information. The user must make Arg the correct type and size. Errors in typing or sizing Arg can corrupt the IDL address space and/or make IDL crash. If one of the MT keywords is used, this argument can be omitted.
Note that the keyword below that start with "MT" can be used to issue commonly used magnetic tape ioctl() calls. When these keywords are used, the Request and Arg arguments are ignored and an be omitted. Magnetic tape operations not available via these keywords can still be executed by supplying the appropriate Request and Arg values. When issuing magnetic tape IOCTL calls, be aware that different devices have different rules for which ioctl calls are allowed, and when. The documentation for your computer system explains those rules.
The following example prints the size of the terminal being used by the current IDL session. It is known to work under SunOS 4.1.2. Changes may be necessary for other operating systems or even other versions of SunOS.
ioctlin the winsize variable (as documented in the
termio(4)manual page). Not providing a large enough result buffer would cause IDL's memory to be corrupted.
/usr/include/sysdirectory. Such values are not always portable between major operating system releases.