Author image Patrick LeBoutillier

NAME

IO::Tty::Util - Perl bindings for libutil.so tty utility functions

SYNOPSIS

  use IO::Tty::Util qw(openpty login_tty forkpty) ;

  my ($master, $slave) = openpty(25, 80) ;
  my %ok = login_tty($slave) ;

  my ($pid, $master) = forkpty(25, 80, "/usr/bin/top") ;

DESCRIPTION

IO::Tty::Util provides basic Perl bindings to the openpty and login_tty functions found in libutil.so and provides a Perl implementation of the forkpty function.

FUNCTIONS

openpty ( $ROWS, $COLS )

Opens a pseudo-tty. Returns returns the master and slave handles on success, or an empty list on error.

login_tty ( $HANDLE )

Prepares for a login on tty handle HANDLE. Returns true on success or false on error.

forkpty ( $ROWS, $COLS, @COMMAND )

Combines openpty, fork and login_tty to create a new process operating in a pseudo-tty. Returns the pid and master handle on success, or an empty list on error.

EXPORT

None by default.

SEE ALSO

IO::Tty provides a lower level interface to ttys.

openpty(3), login_tty(3), forkpty(3).

BUGS AND DEFICIENCIES

Incomplete Support

The current implementation does not support passing the name parameter or the struct termios terminal properties parameter to openpty and forkpty.

AUTHOR

Patrick LeBoutillier, <patl@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006-2007 by Patrick LeBoutillier

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.