So, my question: how give child full access over terminal(input/output) and get it back for parent after child death?
waitpid()
and SIGCHLD
are mechanisms for knowing when a child process has finished. The functions tcgetpgrp(fd)
and tcsetpgrp(fd,pgrp)
and ctermid()
can be used to place a program in the foreground of a terminal.
Otherwise, the information in tcsetpgrp()
in 'C' is probably instructive.