简体   繁体   English

程序执行时如何创建控制终端?

[英]How to create a controlling terminal while the program is executing?

在程序执行时如何创建控制tty(以便可以在上面打印错误消息)?

You could use TIOCSCTTY (see man tty_ioctl ) to set the controlling terminal. 您可以使用TIOCSCTTY (请参阅man tty_ioctl )来设置控制终端。 However there are multiple caveats as given in the link https://blog.nelhage.com/2011/02/changing-ctty/ . 但是,链接https://blog.nelhage.com/2011/02/changing-ctty/中给出了多个警告。 See if the solution given in the link is useful. 查看链接中给出的解决方案是否有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM