473 B
473 B
- Use /dev/ptmx, to get ptmx (master) and pts (slave) file descriptors, then fork and exec shfx as child (+ close ptmx), then close pts as parent.
Note
Use
termios(3)to enable raw mode (implemented incursed.c) (for the slave or master?)
- Implement a SIGCHLD handler instead of using
waitpidinkillchild(), see 2nd example inman wait(3p) - Use threads to launch
killchildto avoid blocking, then just join all the threads using atexit()