Usage: ptyexec Connects the stdio of to a pseudoterminal. Returns something like: MASTER: /dev/ptyqa SLAVE: /dev/ttypa You should extract the SLAVE device and open it or pass it to the application for use. E.g. the i/o of could be a fake a "serial" device for a communications app, say pppd.