📄 console20.txt
字号:
Example:
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <linux/vt.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#define ERROR -1
void main()
{
int fd;
int tty;
printf("w00w00!\n\n");
if (argc < 2) {
printf("Usage: %s <tty>\n", argv[0]);
printf("tty is a tty to disallocate\n\n");
exit(ERROR);
}
tty = atoi(argv[1]);
/* used as fd for ioctl() */
if ((fd = open("/dev/tty", O_NOCTTY)) == ERROR) {
perror("open");
exit(ERROR);
}
printf("disallocating tty%d\n", tty);
if (ioctl(fd, VT_DISALLOCATE, tty) == ERROR) {
perror("ioctl");
close(fd);
exit(ERROR);
}
close(fd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -