C语言编写,使用薄荷Linux操作系统。我想谈的控制台,无论标准输入和放大器的重定向;标准输出。
Writing in C, using Mint Linux. I want to talk to the console regardless of redirection of stdin & stdout.
推荐答案的的/ dev /控制台设备并不一定提供给您。对于Linux,如果你碰巧看到当前虚拟终端该设备只能显示出任何结果。另外(包括Linux),对于大多数系统的/ dev /控制台需要提升的权限来打开它,例如,你的应用程序作为根。其原因是因为有些系统消息被写入到系统控制台。
The /dev/console device is not necessarily available to you. For Linux that device would only show any result if you happen to look at the current virtual terminal. Also (including Linux), for most systems /dev/console requires elevated permissions to open it, e.g., your application is running as root. The reason for that is because some system messages are written to the system console.
有关进一步的讨论,这里有几个链接:
For further discussion, here are a few links:
- Linux:为/ dev /控制台之间的差异,为/ dev / tty的和/ dev / tty0的
- 7。终端专项文件例如/ dev / tty的从文本的终端HOW-TO
- 谅解/从Linux杂志dev的
- Linux: Difference between /dev/console , /dev/tty and /dev/tty0
- 7. Terminal Special Files such as /dev/tty from Text-Terminal HOW-TO
- Understanding /dev from Linux Journal
更多推荐
无法打开/ dev /控制台
发布评论