- 論壇徽章:
- 0
|
在unix環(huán)境高級(jí)編程中底18-10演示的代碼中- #include "apue.h"
- #include <termios.h>
- int
- main(void)
- {
- struct termios term;
- long vdisable;
- if (isatty(STDIN_FILENO) == 0)
- err_quit("standard input is not a terminal device");
- if ((vdisable = fpathconf(STDIN_FILENO, _PC_VDISABLE)) < 0)
- err_quit("fpathconf error or _POSIX_VDISABLE not in effect");
- if (tcgetattr(STDIN_FILENO, &term) < 0) /* fetch tty state */
- err_sys("tcgetattr error");
- term.c_cc[VINTR] = vdisable; /* disable INTR character */
- [color=Red]//這里為什么把控制字符設(shè)置為2就是CTRL-B[/color]
- term.c_cc[VEOF] = 2; /* EOF is Control-B */
- if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &term) < 0)
- err_sys("tcsetattr error");
- exit(0);
- }
復(fù)制代碼 我想問下控制字符的取值有哪些,比如像Ctrl-B,Ctrl-C,Ctrl-D等的取值是什么怎么查詢? |
|