How do I get tcsetpgrp() to work in C?

后端 未结 3 474
情歌与酒
情歌与酒 2020-12-03 11:04

I\'m trying to give a child process (via fork()) foreground access to the terminal.

After I fork(), I run the following code in the child p

3条回答
  •  孤街浪徒
    2020-12-03 11:41

    Figured it out. I have to ignore any SIGTTOU signals.

    I did that by adding:

    signal(SIGTTOU, SIG_IGN);
    

    Before the tcsetpgrp() call.

提交回复
热议问题