且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

中断C / C ++与信号的readline

更新时间:2021-08-06 09:18:21

约阿希姆Pileborg回答评论这个问题。

Joachim Pileborg answered this question in a comment.

***的解决办法似乎是使用readline的备用接口。该文档是在 http://www.delorie.com/gnu/docs/readline /rlman_41.html

The best solution seems to be using the readline alternate interface. The docs are at http://www.delorie.com/gnu/docs/readline/rlman_41.html

此外,在 http://www.mcld.co一个非常基本的例子。英国/博客/ blog.php的?274 只是需要适应使用选择,而不是与睡眠投票。

Also an extremely basic example at http://www.mcld.co.uk/blog/blog.php?274 that just needs to be adapted to use select instead of polling with sleep.

比使用信号更好!