basic.%ioctl

C Function/BASIC Program, Releases: AP/Unix

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

Command Name Type Description
basic.cfunc Definition can be called from a Pick/BASIC program or subroutine in AP/DOS and AP/Unix implementations using a syntax similar to that of normal C.
basic.cfunction Definition Declare a list of C functions.
basic.%ttyname C Function Returns a pointer to a terminal name.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.