basic.%ioctl C Function/BASIC Program

basic.%ioctl

Command basic.%ioctl C Function/BASIC Program
Applicable release versions: AP/Unix
Category BASIC Program (486)
Description is a general purpose control function which passes arguments "request" and "arg" to the device designated by "file.descriptor".

The format of the arguments is device-specific. Note that most of the time, these arguments will be binary data that must be kept out of Pick/BASIC data space. See the example below.
Syntax variable= %ioctl(file.descriptor, request, arg)
Options
Example
* Allocate some data
ptr=(char*)%malloc( 128 )
* Open the terminal and get its termio structure
execute "!exec tty" capturing ttyname
fd=%open( ttyname, O$RDWR )
n=%ioctl( fd, TCGETA, (char*)ptr )
...
* Release data
%free( (char*) ptr )
Purpose
Related basic.cfunc
basic.cfunction
basic.%ttyname