/usr/share/doc/HOWTO/ja-html/Serial-Programming-HOWTO-2.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>The Linux Serial Programming HOWTO: $B$O$8$a$F$_$^$7$g$&(B</TITLE>
<LINK HREF="Serial-Programming-HOWTO-3.html" REL=next>
<LINK HREF="Serial-Programming-HOWTO-1.html" REL=previous>
<LINK HREF="Serial-Programming-HOWTO.html#toc2" REL=contents>
</HEAD>
<BODY>
<A HREF="Serial-Programming-HOWTO-3.html">$B<!$N%Z!<%8(B</A>
<A HREF="Serial-Programming-HOWTO-1.html">$BA0$N%Z!<%8(B</A>
<A HREF="Serial-Programming-HOWTO.html#toc2">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s2">2.</A> <A HREF="Serial-Programming-HOWTO.html#toc2">$B$O$8$a$F$_$^$7$g$&(B</A></H2>
<H2><A NAME="ss2.1">2.1</A> <A HREF="Serial-Programming-HOWTO.html#toc2.1">$B%G%P%C%0$NJ}K!(B</A>
</H2>
<P>$B$"$J$?$,=q$$$?%3!<%I$r%G%P%C%0$9$k$?$a$N:G$bNI$$J}K!$O!$(BLinux $B%^%7%s$r(B
$B$b$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9T$o$l$^$9!%$3$NE@$O(B raw $B%G%P(B
$B%$%9$r;H$C$FDL?.$9$k%W%m%0%i%`$r9T$&>l9g$K$O!$Cm0U$7$F$*$+$J$1$l$P$J$j(B
$B$^$s!%Nc$($P!$Aw$C$?%-%c%i%/%?$r%(%3!<%P%C%/$5$;$k$h$&$K%7%j%"%k%]!<%H(B
$B$r@_Dj$5$l$F$$$^$9$,!$DL>o%G!<%?Aw?.$N$?$a$K$O$3$N@_Dj$OJQ99$7$J$1$l$P(B
$B$$$1$^$;$s!%(B</P>
<P>$BA4$F$N%Q%i%a!<%?$O%W%m%0%i%`Fb$G4JC1$K@_Dj$G$-$^$9!%@_Dj$O(B
$B%X%C%@%U%!%$%k(B<CODE><asm/termbits.h></CODE>$B$GDj5A$5$l$F$$$k(B
<CODE>termios $B9=B$BN(B</CODE>$B$KJ]B8$5$l$^$9!%(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
#define NCCS 19
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control characters */
};
</PRE>
</CODE></BLOCKQUOTE>
$B$3$N(B<CODE><asm/termbits.h></CODE> $B%U%!%$%k$K$O!$%U%i%0$NDj5A$bA4$F5-(B
$B=R$5$l$F$$$^$9!%(B<CODE>c_iflag</CODE> $B%U%i%0$K$OF~NO%b!<%I$N%U%i%0$,$$$/$D(B
$B$+4^$^$l$F$*$j!$A4$F$NF~NO=hM}$r;XDj$7$^$9!%F~NO=hM}$H$O!$%G%P%$%9$+$i(B
$BAw$i$l$?%-%c%i%/%?$O!$(B<CODE>read</CODE>$B$GFI$_=P$5$l$kA0$K=hM}$9$k$3$H$,$G(B
$B$-$k$H$$$&$3$H$G$9!%F1MM$K!$(B<CODE>c_oflag</CODE>$B$O=PNO=hM}$r07$$$^$9!%(B
<CODE>c_cflag</COD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