#Set stdin, stdout, stderr, and logging output to /vio/1 iff not already in
 use
if { [shParse {tstz = open ("/vio/1",2,0)}] != -1 } {
     shParse {vioFd = tstz} ;
     shParse {ioGlobalStdSet (0,vioFd)} ;
     shParse {ioGlobalStdSet (1,vioFd)} ;
     shParse {ioGlobalStdSet (2,vioFd)} ;
     shParse {logFdAdd (vioFd)} ;
     shParse {printf ("Std I/O set here !\n")}
} else {
     shParse {printf ("Std I/O unchanged.\n")}
}

# OVERRIDE shell.tcl to write VIO_WRITE event's messages to a file.

###########################################################################
###
#
# VIO_WRITE_Handler - handle a VIO_WRITE event
#
# SYNOPSIS:
#   VIO_WRITE_Handler event
#
# PARAMETERS:
#
#
# RETURNS:
#
#
# ERRORS:
#

proc VIO_WRITE_Handler {event} {
    set vioChan [lindex $event 1]
    set mblk [lindex $event 2]
    if {$mblk != ""} {
     # The data of the VIO is in the memory block returned with the
     # event.  Dump that block to stdout and free it.
#    memBlockWriteFile $mblk -
     memBlockWriteFile -append $mblk log.txt
     memBlockDelete $mblk
    }
}

