basic.%ioctl
Special IO control.
Syntax
variable= %ioctl(file.descriptor, request, arg)
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.
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 )
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
