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

  • 如果用屏幕显示控制台,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;
    }
posted @ 2018-01-25 09:01  陈富林  阅读(518)  评论(0编辑  收藏  举报