ioctl

An interface to the ioctl(2) system call.

ioctl(2) provides an interface to the operating system terminal drivers (or more commonly these days to ptys (pseudo-terminals)). ioctl is very low-level - most aspects of the terminal can be controlled with the higher-level termios(4), available in Chicken as the even higher-level stty egg.

Procedures

[procedure] (ioctl-winsize [<port-or-fileno>])

Returns a list of the form (<num-rows> <num-columns>) for the given port or file descriptor, defaulting to current-output-port.

[procedure] (ioctl <port-or-fileno> <request> [<args> ...])

Makes the given ioctl request with any arguments provided. The following requests are available:

The struct winsize *ws arguments use the winsize record:

   make-winsize free-winsize
   winsize-row winsize-col
   winsize-row-set! winsize-col-set!

The struct termios *term arguments use the term-attrs record from the stty egg.

The integer pointer arguments can be handled with pointers from the lolevel extension.

Author

Alex Shinn

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/ioctl

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

License

BSD

History

0.3
Ported to CHICKEN 5