문제

I use fork() in order to exec some another program, for example "vim" or "man bash". But, at that moment I lost control, I can't print anything in vim or scroll or quite.

So, my question: how give child full access over terminal(input/output) and get it back for parent after child death?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top