Terminal Window: disable the interrupt character
来源:互联网 发布:comicstudio mac破解版 编辑:程序博客网 时间:2024/06/01 07:57
这个例子也很好玩,相应的位置设置成_POSIX_VDISABLE就可以把相应的字符disable掉。
/*
* =====================================================================================
*
* Filename: disable_interrupt.c
*
* Description:
*
* Version: 1.0
* Created: 09/15/2010 03:58:55 PM
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Company:
*
* =====================================================================================
*/
#include <termios.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(void)
{
struct termios term;
long vdisable;
if (isatty(STDIN_FILENO) == 0)
{
printf("standard input is not a terminal device/n");
return -1;
}
if ((vdisable = fpathconf(STDIN_FILENO, _PC_VDISABLE)) < 0)
{
printf("fpathconf error or _POSIX_VDISABLE not in effect/n");
return -1;
}
if (tcgetattr(STDIN_FILENO, &term) < 0)
perror("tcgetattr error");
term.c_cc[VINTR] = vdisable; /* disable INTR character */
term.c_cc[VEOF] = 2; /* EOF is ^B */
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &term) < 0)
perror("tcsetattr error");
return 0;
}
- Terminal Window: disable the interrupt character
- Mac Terminal Disable Beep(转载)
- Get terminal window size
- Start / Stop / Enable / Disable Terminal services from command line
- Disable The File Save Dialog
- Get the Middle Character
- The Terminal -- Life is waiting.
- Putty Change the Terminal Font
- How to launch terminal Window in Fedora
- Use The Terminal Download The JDK
- Disable the useless service in Solaris
- disable the alterabyteblaster service with command
- android disable the Auto light off
- Platform Builder: Disable the USB Driver Dialog
- disable autocrc cause some error the analysis
- How-to disable the before-session timeout
- Disable the authentication loopback check for SharePoint
- Platform Builder: Disable the USB Driver Dialog .
- 修改表结构
- 基于Maven的Flex/Webapp项目示例
- armlinux学习笔记--IIS音频驱动程序分析
- 使用 Android 实现联网
- java网络异常
- Terminal Window: disable the interrupt character
- flex框架Cairngorm的使用
- XMLHttpRequest
- 数组数组专辑
- Kernel panic
- 三十五个非主流开源数据库
- CHARINDEX函数
- Oracle中如果不知道system,sys用户的密码后可用如下方法找回
- 小波变换与傅里叶变换