bugifx: child pid in parent process is non-zero value
implements terminal file open
close all file descriptors except STDIN, STDOUT and STDERR