⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 console7.txt

📁 linux/kd.h文件中介绍了ioctl函数能够使用的命令
💻 TXT
字号:
Example:
	#include <stdio.h>
	#include <fcntl.h>
	#include <unistd.h>
        #include <stdlib.h>
	#include <sys/stat.h>
	#include <linux/kd.h>
	#include <sys/types.h>
	#include <sys/ioctl.h>

	#define ERROR -1

	void main()
	{
          int fd;
          struct consolefontdesc confont;

          if ((confont.chardata = malloc(8192)) == NULL) {
             perror("malloc");
	     exit(ERROR);
          }

          /* To be used as the fd in ioctl(). */
	  if ((fd = open("/dev/console", O_NOCTTY)) == ERROR) {
	     perror("open");
	     exit(ERROR);
	  }

	  printf("w00w00!\n\n");

          /* GIO_FONTX returns struct consolefontdesc, GIO_FONT just */
          /* returns the equivalent to consolefontdesc->chardata.    */
          if ((ioctl(fd, GIO_FONTX, &confont)) == ERROR) {
	     perror("ioctl");
	     close(fd);
	     exit(ERROR);
	  }

          printf("Character count: %u\n", confont.charcount);
          printf("Character height (scan lines per character): %u\n", 
                 confont.charheight);
          printf("Font data in expanded form: %s\n", confont.chardata);
	  close(fd);
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -