<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#/usr/local/bin/perl
    require 'syscall.ph';
    require 'fcntl.ph';

    sub sysopen { 
	local($path, $flags, $mode) = @_;
	local($fd, $fh);
	if (($fd = syscall(&amp;SYS_open, $path, $flags, $mode)) == -1) {
	    return undef;
	} 
	$fh = 'sysfh' . ++$sysopen'fh;
	open($fh, "+&gt;&amp;$fd") || return undef; # XXX: wrong mode
	return $fh;
    } 

    $tty = &amp;sysopen("/dev/tty1M19", &amp;O_RDWR | &amp;O_NDELAY | &amp;O_EXCL, 0444);
    die "sysopen /dev/tty: $!" unless defined $tty;

    printf "tty handle is %s, fdesc is %d\n", $tty, fileno($tty);

    print $tty "Bob please write me if you see this. Bill\n";

#--tom
</pre></body></html>