A set of utility functions are provided to set up the xterm. A
function, xtermRead
, is provided to read from
the xterm and a function, xtermWrite
to write
to the xterm. Both these functions are blocking on the operating
system. The write function should always be able to write with
minimal delay. However the read function must only be called when
the SIGIO
signal handler has determined input is
available, in order to avoid blocking the SystemC simulation.
There is some internal state to hold the pseudo-TTY file descriptors and the process ID of the xterm (so it can be killed by the destructor). It is the slave file descriptor that is used for both input and output.