亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tty layer - the user perspective.htm

?? Linux Kernel Programming by Examples(1)[Xeroo]
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0060)http://www.geocities.com/marco_corvi/games/lkpe/tty/user.htm -->
<HTML><HEAD><TITLE>The TTY layer</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK 
href="tty layer - The user perspective_file/style.css" rel=stylesheet>
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<H2>tty layer - The user perspective</H2>
<DIV>References:<BR>W.R. Stevens, "Adavnced Programming in the UNIX 
environment", Addison-Wesley 1993 <BR></DIV><BR clear=all><BR clear=all><BR 
clear=all>
<DIV><IMG height=200 src="tty layer - The user perspective_file/ttyio.gif" 
width=240 align=right> The user perspective of the tty layer is the terminal 
I/O. This is a complex topic because it is used to control a lot of different 
devices (terminals, modem, serial lines, ...). The logical view is shown in the 
figure on the side. Between the user input/output, mediated by the device 
drivers, and the process read/write, there is the tty layer, which buffers the 
data in two queues. Both queues have a maximum size. When the output queue is 
full the process is put to wait. When the input queue is full characters are 
lost. If echo is enabled the input characters are echoed on the output queue. 
</DIV>
<DIV>The kernel characteristics of a tty are contained in a <CODE>struct 
termio</CODE> (defined in include/asm/termios.h). This contains 
<UL>
  <LI><CODE>c_iflag</CODE>, the input mode flags; 
  <LI><CODE>c_oflag</CODE>, the output mode flags; 
  <LI><CODE>c_lflag</CODE>, the local mode flags; 
  <LI><CODE>c_cflag</CODE>, the control mode flags; 
  <LI><CODE>c_line</CODE>, line discipline type (this is not seen by the user); 
  <LI><CODE>c_cc</CODE>, an array of control characters </LI></UL>A similar 
structure exists (<CODE>termios</CODE>) which differ only in the typing of the 
fields (POSIX like). Userland has the <CODE>struct termios</CODE> (define in 
/usr/include/bits/termios.h) which contains also i/o speed fields. The values of 
the flags bits and the special characters are listed in the tables below. </DIV>
<TABLE cellSpacing=0 cellPadding=2 border=1>
  <TBODY>
  <TR>
    <TH rowSpan=14>c_iflag</TH>
    <TD>BRKINT</TD>
    <TD>generate SIGINT on BREAK</TD></TR>
  <TR>
    <TD>ICRNL</TD>
    <TD>map CR to NL on input</TD></TR>
  <TR>
    <TD>IGNBRK</TD>
    <TD>ignore BREAK</TD></TR>
  <TR>
    <TD>IGNCR</TD>
    <TD>ignore CR</TD></TR>
  <TR>
    <TD>IGNPAR</TD>
    <TD>ignore characters with parity errors</TD></TR>
  <TR>
    <TD>IMAXBEL</TD>
    <TD>ring bell on input when the input queue is full</TD></TR>
  <TR>
    <TD>INLCR</TD>
    <TD>map NL to CR </TD></TR>
  <TR>
    <TD>INPCK</TD>
    <TD>enable input parity checking</TD></TR>
  <TR>
    <TD>ISTRIP</TD>
    <TD>strip eighth bit off input characters</TD></TR>
  <TR>
    <TD>IUCLC</TD>
    <TD>map uppercase to lowercase on input</TD></TR>
  <TR>
    <TD>IXANY</TD>
    <TD>exable any character to restart output</TD></TR>
  <TR>
    <TD>IXOFF</TD>
    <TD>enable start/stop input flow control</TD></TR>
  <TR>
    <TD>IXON</TD>
    <TD>enable start/stop output flow control</TD></TR>
  <TR>
    <TD>PARMRK</TD>
    <TD>mark parity errors</TD></TR>
  <TR>
    <TH rowSpan=16>c_oflag</TH>
    <TD>BSDLY</TD>
    <TD>backspace delay mask</TD></TR>
  <TR>
    <TD>CRDLY</TD>
    <TD>CR delay mask</TD></TR>
  <TR>
    <TD>FFDLY</TD>
    <TD>formfeed delay mask</TD></TR>
  <TR>
    <TD>NLDLY</TD>
    <TD>NL delay mask</TD></TR>
  <TR>
    <TD>OCRNL</TD>
    <TD>map CR to NL on output</TD></TR>
  <TR>
    <TD>OFDEL</TD>
    <TD>fill is DEL (else is NUL)</TD></TR>
  <TR>
    <TD>OFILL</TD>
    <TD>use fill characters for delay</TD></TR>
  <TR>
    <TD>OLCUL</TD>
    <TD>map lowercase to uppercase on output</TD></TR>
  <TR>
    <TD>ONLCR</TD>
    <TD>map NL to CR-NL (this is CRMOD)</TD></TR>
  <TR>
    <TD>ONLRET</TD>
    <TD>NL performs CR function</TD></TR>
  <TR>
    <TD>ONOCR</TD>
    <TD>no CR output at column 0</TD></TR>
  <TR>
    <TD>ONOEOT</TD>
    <TD>discard EOF (^D) on output</TD></TR>
  <TR>
    <TD>OPOST</TD>
    <TD>perform output processing</TD></TR>
  <TR>
    <TD>OXTABS</TD>
    <TD>expand tabs to spaces</TD></TR>
  <TR>
    <TD>TABDLY</TD>
    <TD>horizontal tab delay mask</TD></TR>
  <TR>
    <TD>VTDLY</TD>
    <TD>vertical tab delay mask</TD></TR>
  <TR>
    <TH rowSpan=11>c_cflag</TH>
    <TD>CCTS_OFLOW</TD>
    <TD>CTS flow control of output</TD></TR>
  <TR>
    <TD>CIGNORE</TD>
    <TD>ignore control flags</TD></TR>
  <TR>
    <TD>CLOCAL</TD>
    <TD>ignore modem status line</TD></TR>
  <TR>
    <TD>CREAD</TD>
    <TD>enable receiver</TD></TR>
  <TR>
    <TD>CRTS_IFLOW</TD>
    <TD>RTS flow control on input</TD></TR>
  <TR>
    <TD>CSIZE</TD>
    <TD>character size mask</TD></TR>
  <TR>
    <TD>CSTOPB</TD>
    <TD>send two stop bits (else send one)</TD></TR>
  <TR>
    <TD>HUPCL</TD>
    <TD>hangup on last close</TD></TR>
  <TR>
    <TD>MDMBUF</TD>
    <TD>flow control output via Carrier</TD></TR>
  <TR>
    <TD>PARENB</TD>
    <TD>parity enable</TD></TR>
  <TR>
    <TD>PARODD</TD>
    <TD>parity is odd (else is even)</TD></TR>
  <TR>
    <TH rowSpan=17>c_lflag</TH>
    <TD>ALTWERASE</TD>
    <TD>use alternate WERASE algorithm</TD></TR>
  <TR>
    <TD>ECHO</TD>
    <TD>enable echo</TD></TR>
  <TR>
    <TD>ECHOCTL</TD>
    <TD>echo control characters as ^Char</TD></TR>
  <TR>
    <TD>ECHOE</TD>
    <TD>visually erase characters</TD></TR>
  <TR>
    <TD>ECHOK</TD>
    <TD>echo KILL (by erasing the entire line)</TD></TR>
  <TR>
    <TD>ECHOKE</TD>
    <TD>visual erase for KILL</TD></TR>
  <TR>
    <TD>ECHONL</TD>
    <TD>echo NL</TD></TR>
  <TR>
    <TD>ECHOPRT</TD>
    <TD>visula erase mode for hardcopy</TD></TR>
  <TR>
    <TD>FLUSHO</TD>
    <TD>output being flushed</TD></TR>
  <TR>
    <TD>ICANON</TD>
    <TD>canonical input</TD></TR>
  <TR>
    <TD>IEXTEN</TD>
    <TD>enable extended input character processing</TD></TR>
  <TR>
    <TD>ISIG</TD>
    <TD>enable terminal-generated signals</TD></TR>
  <TR>
    <TD>NOFLSH</TD>
    <TD>disable flush after interrupt or quit</TD></TR>
  <TR>
    <TD>NOKERNINFO</TD>
    <TD>no kernel output from STATUS</TD></TR>
  <TR>
    <TD>PENDIN</TD>
    <TD>retype pending input</TD></TR>
  <TR>
    <TD>TOSTOP</TD>
    <TD>send SIGTTOU for background output</TD></TR>
  <TR>
    <TD>XCASE</TD>
    <TD>canonical upper/lower presentation</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=2 border=1>
  <TBODY>
  <TR>
    <TH colSpan=2>Special characters</TH>
    <TH>subscript</TH>
    <TH>enabled by</TH></TR>
  <TR>
    <TD>CR</TD>
    <TD>carriage return</TD>
    <TD>-</TD>
    <TD rowSpan=10>ICANON</TD></TR>
  <TR>
    <TD>EOF</TD>
    <TD>end-of-file</TD>
    <TD>VEOF</TD></TR>
  <TR>
    <TD>EOL</TD>
    <TD>end-of-line</TD>
    <TD>VEOL</TD></TR>
  <TR>
    <TD>EOL2</TD>
    <TD>alternate end-of-line</TD>
    <TD>VEOL2</TD></TR>
  <TR>
    <TD>ERASE</TD>
    <TD>backspace one character</TD>
    <TD>VERASE</TD></TR>
  <TR>
    <TD>KILL</TD>
    <TD>VKILL</TD>
    <TD>erase line</TD></TR>
  <TR>
    <TD>NL</TD>
    <TD>linefeed</TD>
    <TD>-</TD></TR>
  <TR>
    <TD>REPRINT</TD>
    <TD>reprint all input</TD>
    <TD>VREPRINT</TD></TR>
  <TR>
    <TD>STATUS</TD>
    <TD>status request</TD>
    <TD>VSTATUS</TD></TR>
  <TR>
    <TD>WERASE</TD>
    <TD>backspace one word</TD>
    <TD>VWERASE</TD></TR>
  <TR>
    <TD>START</TD>
    <TD>resume output</TD>
    <TD>VSTART</TD>
    <TD rowSpan=2>IXON / IXOFF</TD></TR>
  <TR>
    <TD>STOP</TD>
    <TD>stop output</TD>
    <TD>VSTOP</TD></TR>
  <TR>
    <TD>DSUSP</TD>
    <TD>delayed suspend (SIGTSTP)</TD>
    <TD>VDSUSP</TD>
    <TD rowSpan=4>ISIG</TD></TR>
  <TR>
    <TD>INTR</TD>
    <TD>interrupt signal (SIGINT)</TD>
    <TD>VINTR</TD></TR>
  <TR>
    <TD>QUIT</TD>
    <TD>quit signal (SIGQUIT)</TD>
    <TD>VQUT</TD></TR>
  <TR>
    <TD>SUSP</TD>
    <TD>suspend signal (SIGTSTP)</TD>
    <TD>VSUSP</TD></TR>
  <TR>
    <TD>DISCARD</TD>
    <TD>discard output</TD>
    <TD>VDISCARD</TD>
    <TD rowSpan=2>IEXTEN</TD></TR>
  <TR>
    <TD>LNEXT</TD>
    <TD>literal next</TD>
    <TD>VLNEXT</TD></TR></TBODY></TABLE>
<DIV>The user control of the tty can be done with the <CODE>ioctl()</CODE> 
function, but its last argument depends on the action being performed. This 
makes type checking impossible. Therefore POSIX defines 12 functions, 
<UL>
  <LI><CODE>tcsetattr</CODE>, <CODE>tcgetattr</CODE>: to set/get the tty 
  attributes; 
  <LI><CODE>cfgetispeed</CODE>, <CODE>cfsetispeed</CODE>, 
  <CODE>cfgetospeed</CODE>, <CODE>cfsetospeed</CODE>: for the i/o speeds (baud 
  rate); 
  <LI><CODE>tcdrain</CODE>, <CODE>tcflow</CODE>, <CODE>tcflush</CODE> and 
  <CODE>tcsendbreak</CODE> are line control functions; 
  <LI><CODE>tcgetpgrp</CODE> and <CODE>tcsetpgrp</CODE>: get/set foreground 
  process group ID. </LI></UL></DIV>
<DIV><B>Canonical mode</B><BR>Canonical mode (cooked) is simple, from the user 
point of view: reads are linewise, ie, the read() call returns when a complete 
line has been entered by the device driver. A line is complete when one of the 
folloing delimiters is entered: NL, EOL, EOL2, EOF (and CR if ICRNL is set and 
INGCR is not set). Note that EOF is not returned with the read. </DIV>
<DIV><B>Noncanonical mode</B><BR>This is set by turning off ICANON. The input 
characters are not assembled into lines. These special characters are not 
processed: ERASE, KILL, EOF, NL, EOL, EOL2, CR, REPRINT, STATUS, WERASE. The two 
entries <CODE>c_cc[VMIN]</CODE> and <CODE>c_cc[VTIME]</CODE> determine the 
behaviour of the <CODE>read()</CODE>. There are four cases: 
<TABLE cellSpacing=0 cellPadding=2 border=1>
  <TBODY>
  <TR>
    <TD>MIN=0</TD>
    <TD>TIME=0</TD>
    <TD>read() returns immediately with whatever data are available (from 0 if 
      none, to the maximum number requested in the call)</TD></TR>
  <TR>
    <TD>MIN=0</TD>
    <TD>TIME&gt;0</TD>
    <TD>read() returns between 1 and the requested number if there are data 
      before the time expires; it returns 0 if the time expires</TD></TR>
  <TR>
    <TD>MIN&gt;0</TD>
    <TD>TIME=0</TD>
    <TD>read() returns between 1 and the requested number when there are data 
      available (may wait forever)</TD></TR>
  <TR>
    <TD>MIN&gt;0</TD>
    <TD>TIME&gt;0</TD>
    <TD>read() returns between MIN and the number requested before the time 
      expires, or or between 1 and MIN-1 if the time expires. It can block 
      forever if there are no data</TD></TR></TBODY></TABLE></DIV>
<DIV>There are two noncanonical modes (i am aware of), cbreak and raw. 
<TABLE cellSpacing=0 cellPadding=2 border=1>
  <TBODY>
  <TR>
    <TH>cbreak </TH>
    <TD>ECHO and ICANON off</TD>
    <TD>&nbsp; </TD>
    <TD>&nbsp; </TD>
    <TD>&nbsp; </TD>
    <TD>MIN=1, TIME=0 </TD></TR>
  <TR>
    <TH>raw </TH>
    <TD>ECHO, ICANON, IEXTEN and ISIG off </TD>
    <TD>BRKINT, ICRNL, INPCK, ISTRIP, IXON off </TD>
    <TD>CSIZE, PARENB and OPOST off </TD>
    <TD>CS8 (set 8-bit characters) </TD>
    <TD>MIN=1, TIME=0 </TD></TR></TBODY></TABLE></DIV><BR clear=all>
<DIV>To conclude this summary of terminal I/O look at this example from Steven's 
book. <BR><A 
href="http://www.geocities.com/marco_corvi/games/lkpe/tty/tty_raw.c">tty_raw.c</A>, 
set a tty in raw mode<BR></DIV><BR clear=all><FONT size=-1>Marco Corvi - 
2003</FONT> 
<!-- text below generated by server. PLEASE REMOVE --></OBJECT></LAYER>
<DIV></DIV></SPAN></STYLE></NOSCRIPT></TABLE></SCRIPT></APPLET>
<SCRIPT 
language=JavaScript>var PUpage="76001084"; var PUprop="geocities"; </SCRIPT>

<SCRIPT language=JavaScript 
src="tty layer - The user perspective_file/pu5geo.js"></SCRIPT>

<SCRIPT language=JavaScript 
src="tty layer - The user perspective_file/ygIELib9.js"></SCRIPT>

<SCRIPT language=JavaScript>var yviContents='http://us.toto.geo.yahoo.com/toto?s=76001084&l=NE&b=1&t=1057747208';yviR='us';yfiEA(0);</SCRIPT>

<SCRIPT language=JavaScript 
src="tty layer - The user perspective_file/mc.js"></SCRIPT>

<SCRIPT language=JavaScript 
src="tty layer - The user perspective_file/geov2.js"></SCRIPT>

<SCRIPT language=javascript>geovisit();</SCRIPT>
<NOSCRIPT><IMG height=1 alt=setstats 
src="tty layer - The user perspective_file/visit.gif" width=1 
border=0></NOSCRIPT> <IMG height=1 alt=1 
src="tty layer - The user perspective_file/serv.gif" width=1> <!-- w31.geo.scd.yahoo.com compressed/chunked Wed Jul  9 03:40:08 PDT 2003 --></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一级黄| 久久久久9999亚洲精品| 日韩免费看的电影| 欧美国产精品劲爆| 日本美女一区二区三区视频| 国产.欧美.日韩| 在线播放欧美女士性生活| 国产精品视频一二| 蜜臀av国产精品久久久久| 色菇凉天天综合网| 国产亚洲一区二区三区| 亚洲成人av电影| 91亚洲午夜精品久久久久久| 精品国内片67194| 日韩成人精品在线| 色噜噜狠狠色综合中国| 国产精品久久久久精k8| 国产精品亚洲а∨天堂免在线| 欧美男生操女生| 一区二区三区四区在线免费观看| 国产一区二区三区黄视频| 51精品视频一区二区三区| 一区二区三区中文免费| 成年人午夜久久久| 亚欧色一区w666天堂| 91在线你懂得| 国产精品久久久久久久久快鸭| 国产精品一区二区在线播放| 精品国产制服丝袜高跟| 免费看欧美女人艹b| 7777女厕盗摄久久久| 亚洲一区二区三区四区中文字幕| 一本一道久久a久久精品 | 成人av资源站| 国产精品免费av| 国产东北露脸精品视频| 国产午夜亚洲精品理论片色戒| 狠狠狠色丁香婷婷综合久久五月| 精品日韩在线观看| 国产资源精品在线观看| 欧美激情在线观看视频免费| 风流少妇一区二区| 亚洲欧洲精品成人久久奇米网| 本田岬高潮一区二区三区| 国产精品福利在线播放| 91在线视频播放地址| 亚洲一区二区精品视频| 欧美精品一卡两卡| 久久se这里有精品| 国产日韩欧美综合在线| 成人动漫在线一区| 亚洲狠狠丁香婷婷综合久久久| 麻豆一区二区99久久久久| 日本成人在线不卡视频| 日韩久久久久久| 欧美一区二区三区视频在线观看| 国产激情精品久久久第一区二区 | 亚洲精品自拍动漫在线| 久久久国产精品不卡| 5566中文字幕一区二区电影| 一本一道久久a久久精品| 丰满亚洲少妇av| 激情丁香综合五月| 蜜臀av一区二区三区| 日韩中文字幕麻豆| 亚洲一区二区三区国产| 一区在线观看视频| 国产精品欧美一级免费| 国产午夜精品在线观看| 精品国产乱码91久久久久久网站| 4438成人网| 日韩欧美国产一区二区在线播放| 欧美日韩免费观看一区三区| 欧美制服丝袜第一页| 在线观看免费成人| 欧美三级在线播放| 欧美日韩午夜在线视频| 这里只有精品视频在线观看| 欧美理论电影在线| 中文字幕日韩av资源站| 国产精品你懂的| 成人欧美一区二区三区黑人麻豆| 国产精品成人网| 最近中文字幕一区二区三区| 亚洲欧美日韩国产综合在线| 亚洲免费在线电影| 亚洲第一会所有码转帖| 三级成人在线视频| 久久99精品久久久久久久久久久久| 蜜臀久久久久久久| 国产一区二区三区av电影| 国产成人在线电影| 91亚洲大成网污www| 欧美午夜寂寞影院| 日韩一区二区三免费高清| 精品国产凹凸成av人导航| 久久精品视频免费| 亚洲视频精选在线| 偷偷要91色婷婷| 国产综合久久久久影院| 成人精品亚洲人成在线| 日本久久一区二区三区| 欧美日韩国产一区| 久久久久久97三级| 自拍偷拍欧美精品| 日韩成人精品在线| 成人爽a毛片一区二区免费| 色婷婷一区二区| 日韩一区二区精品在线观看| 国产亚洲短视频| 洋洋成人永久网站入口| 看国产成人h片视频| 成人激情黄色小说| 欧美三级资源在线| 久久精品男人天堂av| 一区二区三区日韩欧美| 狠狠色2019综合网| 国产免费久久精品| 亚洲sss视频在线视频| 国产精品一线二线三线精华| 欧美综合一区二区| 久久久www成人免费无遮挡大片| 一区精品在线播放| 国产在线精品一区在线观看麻豆| 一本到高清视频免费精品| 欧美mv和日韩mv的网站| 尤物在线观看一区| 国产一区二区免费视频| 欧美日韩在线免费视频| 亚洲国产精品成人综合| 日韩精品午夜视频| 色域天天综合网| 国产日产亚洲精品系列| 视频一区在线视频| 972aa.com艺术欧美| 久久亚洲捆绑美女| 水蜜桃久久夜色精品一区的特点| 成人免费看的视频| 日韩精品自拍偷拍| 亚洲18女电影在线观看| 色悠久久久久综合欧美99| 国产日韩在线不卡| 久久精品国产亚洲高清剧情介绍 | 精品国产91乱码一区二区三区| 亚洲精品国产一区二区精华液 | 欧美日韩一区二区三区在线看| 久久精品亚洲国产奇米99| 日本不卡视频一二三区| 在线观看亚洲一区| 亚洲男同性恋视频| 国产91精品免费| 精品国产乱码久久久久久久久| 午夜精品一区二区三区三上悠亚| 一本色道久久综合亚洲精品按摩| 欧美国产欧美亚州国产日韩mv天天看完整| 日本欧美一区二区在线观看| 欧美日韩免费电影| 夜夜爽夜夜爽精品视频| 91亚洲精品一区二区乱码| 国产精品久久影院| 成人免费黄色在线| 国产蜜臀97一区二区三区| 国产成人精品免费一区二区| 久久久久99精品一区| 国模少妇一区二区三区| 欧美一区二区三区在| 免费一级欧美片在线观看| 宅男噜噜噜66一区二区66| 日本不卡一二三| 精品毛片乱码1区2区3区| 麻豆视频一区二区| 精品国产三级a在线观看| 激情五月婷婷综合网| 久久亚洲精品小早川怜子| 国产一区二区成人久久免费影院| 久久久青草青青国产亚洲免观| 精品视频色一区| 日韩精品视频网| 欧美成人免费网站| 国产一区二区调教| 中文字幕av一区二区三区| 成人av网站免费| 亚洲日本在线a| 欧美三级在线视频| 热久久免费视频| 久久综合九色综合欧美亚洲| 国产成人亚洲综合a∨婷婷| 国产欧美日韩另类一区| 99久久亚洲一区二区三区青草| 亚洲精品网站在线观看| 欧美日韩一级视频| 精品一区二区三区免费播放| 久久精品在这里| 91伊人久久大香线蕉| 亚洲第一电影网| 久久中文娱乐网| 91年精品国产| 蜜桃久久久久久| 中文欧美字幕免费| 欧美日韩国产一区二区三区地区|