ptmx/ptm + pts/N

Разработка на C# под linux
 
Good example code in C:
http://rachid.koucha.free.fr/tech_corner/pty_pdip.html
(shows when to dup and when to fork)

http://unix.stackexchange.com/a/120071
https://github.com/poderosaproject/
How to pass handles to another process, If you can't fork in mono?

http://www.codeproject.com/Articles/170017/Solving-Problems-of-Monitoring-Standard-Output-and

Create a System.Diagnostic.ProcessStartInfo object, and set the UseShellExecute property to false, and the RedirectStandardInput, RedirectStandardOutput, RedirectStandardError properties to true.
Call System.Diagnostic.Process.Start() passing in the pre-initialized ProcessStartInfo object to that method.
To read output asynchronously (do not block waiting of output), add an event handler to the Process.OutputDataReceived event and call Process.BeginOutputReadLine(). The handler will receive text when the process writes to its standard output stream.
To read output synchronously (block until process writes text to output stream), call the Process.Read(), Process.ReadLine(), or Process.ReadToEnd() methods.