Linux 使用tty0 显示10分钟自动关闭功能

时间:2021-12-19 09:15:56
  • 如果用屏幕显示控制台,10分钟左右会自动关闭,有如下方法可以解决

  • 在应用层调用如下代码:

    #include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h> int main(int argc ,char *argv[])
{
int f0;
f0 = open("/dev/tty0", O_RDWR);
write(f0, "\033[9;0]", 8); close(f0);
return 0;
}