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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? library_12.html

?? linux_c函數(shù),linux下編程必備的
?? HTML
?? 第 1 頁 / 共 5 頁
字號(hào):
<P>
<A NAME="IDX653"></A>
<U>Function:</U> FILE * <B>fdopen</B> <I>(int <VAR>filedes</VAR>, const char *<VAR>opentype</VAR>)</I><P>
The <CODE>fdopen</CODE> function returns a new stream for the file descriptor
<VAR>filedes</VAR>.
<P>
The <VAR>opentype</VAR> argument is interpreted in the same way as for the
<CODE>fopen</CODE> function (see section <A HREF="library_11.html#SEC120" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_11.html#SEC120">Opening Streams</A>), except that
the <SAMP>`b'</SAMP> option is not permitted; this is because GNU makes no
distinction between text and binary files.  Also, <CODE>"w"</CODE> and
<CODE>"w+"</CODE> do not cause truncation of the file; these have affect only
when opening a file, and in this case the file has already been opened.
You must make sure that the <VAR>opentype</VAR> argument matches the actual
mode of the open file descriptor.
<P>
The return value is the new stream.  If the stream cannot be created
(for example, if the modes for the file indicated by the file descriptor
do not permit the access specified by the <VAR>opentype</VAR> argument), a
null pointer is returned instead.
<P>
For an example showing the use of the <CODE>fdopen</CODE> function,
see section <A HREF="library_14.html#SEC212" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_14.html#SEC212">Creating a Pipe</A>.
<P>
<A NAME="IDX654"></A>
<U>Function:</U> int <B>fileno</B> <I>(FILE *<VAR>stream</VAR>)</I><P>
This function returns the file descriptor associated with the stream
<VAR>stream</VAR>.  If an error is detected (for example, if the <VAR>stream</VAR>
is not valid) or if <VAR>stream</VAR> does not do I/O to a file,
<CODE>fileno</CODE> returns <CODE>-1</CODE>.
<P>
<A NAME="IDX655"></A>
<A NAME="IDX656"></A>
<P>
There are also symbolic constants defined in <TT>`unistd.h'</TT> for the
file descriptors belonging to the standard streams <CODE>stdin</CODE>,
<CODE>stdout</CODE>, and <CODE>stderr</CODE>; see section <A HREF="library_11.html#SEC119" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_11.html#SEC119">Standard Streams</A>.
<A NAME="IDX657"></A>
<P>
<DL COMPACT>
<A NAME="IDX658"></A>
<DT><CODE>STDIN_FILENO</CODE>
<DD>This macro has value <CODE>0</CODE>, which is the file descriptor for
standard input.
<A NAME="IDX659"></A>
<P>
<A NAME="IDX660"></A>
<DT><CODE>STDOUT_FILENO</CODE>
<DD>This macro has value <CODE>1</CODE>, which is the file descriptor for
standard output.
<A NAME="IDX661"></A>
<P>
<A NAME="IDX662"></A>
<DT><CODE>STDERR_FILENO</CODE>
<DD>This macro has value <CODE>2</CODE>, which is the file descriptor for
standard error output.
<A NAME="IDX663"></A>
</DL>
<P>
<A NAME="IDX664"></A>
<A NAME="IDX665"></A>
<A NAME="IDX666"></A>
<A NAME="IDX667"></A>
<H2><A NAME="SEC176" HREF="library_toc.html#SEC176" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC176">Precautions for Mixing Streams and Descriptors</A></H2>
<P>
You can have multiple file descriptors and streams (let's call both
streams and descriptors "channels" for short) connected to the same
file, but you must take care to avoid confusion between channels.  There
are two cases to consider: <DFN>linked</DFN> channels that share a single
file position value, and <DFN>independent</DFN> channels that have their own
file positions.
<P>
It's best to use just one channel in your program for actual data
transfer to any given file, except when all the access is for input.
For example, if you open a pipe (something you can only do at the file
descriptor level), either do all I/O with the descriptor, or construct a
stream from the descriptor with <CODE>fdopen</CODE> and then do all I/O with
the stream.
<P>
<A NAME="IDX668"></A>
<H3><A NAME="SEC177" HREF="library_toc.html#SEC177" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC177">Linked Channels</A></H3>
<P>
Channels that come from a single opening share the same file position;
we call them <DFN>linked</DFN> channels.  Linked channels result when you
make a stream from a descriptor using <CODE>fdopen</CODE>, when you get a
descriptor from a stream with <CODE>fileno</CODE>, and when you copy a
descriptor with <CODE>dup</CODE> or <CODE>dup2</CODE>.  For files that don't support
random access, such as terminals and pipes, <EM>all</EM> channels are
effectively linked.  On random-access files, all append-type output
streams are effectively linked to each other.
<A NAME="IDX669"></A>
<P>
If you have been using a stream for I/O, and you want to do I/O using
another channel (either a stream or a descriptor) that is linked to it,
you must first <DFN>clean up</DFN> the stream that you have been using.
See section <A HREF="library_12.html#SEC179" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_12.html#SEC179">Cleaning Streams</A>.
<P>
Terminating a process, or executing a new program in the process,
destroys all the streams in the process.  If descriptors linked to these
streams persist in other processes, their file positions become
undefined as a result.  To prevent this, you must clean up the streams
before destroying them.
<P>
<A NAME="IDX670"></A>
<H3><A NAME="SEC178" HREF="library_toc.html#SEC178" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC178">Independent Channels</A></H3>
<P>
When you open channels (streams or descriptors) separately on a seekable
file, each channel has its own file position.  These are called
<DFN>independent channels</DFN>.
<P>
The system handles each channel independently.  Most of the time, this
is quite predictable and natural (especially for input): each channel
can read or write sequentially at its own place in the file.
The precautions you should take are these:
<P>
<UL>
<LI>
You should clean an output stream after use, before doing anything else
that might read or write from the same part of the file.
<P>
<LI>
You should clean an input stream before reading data that may have been
modified using an independent channel.  Otherwise, you might read
obsolete data that had been in the stream's buffer.
</UL>
<P>
If you do output to one channel at the end of the file, this will
certainly leave the other independent channels positioned somewhere
before the new end.  If you want them to output at the end, you must set
their file positions to end of file, first.  (This is not necessary if
you use an append-type descriptor or stream; they always output at the
current end of the file.)  In order to make the end-of-file position
accurate, you must clean the output channel you were using, if it is a
stream.  (This is necessary even if you plan to use an append-type
channel next.)
<P>
It's impossible for two channels to have separate file pointers for a
file that doesn't support random access.  Thus, channels for reading or
writing such files are always linked, never independent.  Append-type
channels are also always linked.  For these channels, follow the rules
for linked channels; see section <A HREF="library_12.html#SEC177" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_12.html#SEC177">Linked Channels</A>.
<P>
<H3><A NAME="SEC179" HREF="library_toc.html#SEC179" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC179">Cleaning Streams</A></H3>
<P>
On the GNU system, you can clean up any stream with <CODE>fclean</CODE>:
<P>
<A NAME="IDX671"></A>
<U>Function:</U> int <B>fclean</B> <I>(<VAR>stream</VAR>)</I><P>
Clean up the stream <VAR>stream</VAR> so that its buffer is empty.  If
<VAR>stream</VAR> is doing output, force it out.  If <VAR>stream</VAR> is doing
input, give the data in the buffer back to the system, arranging to
reread it.
<P>
On other systems, you can use <CODE>fflush</CODE> to clean a stream in most
cases.
<P>
You can skip the <CODE>fclean</CODE> or <CODE>fflush</CODE> if you know the stream
is already clean.  A stream is clean whenever its buffer is empty.  For
example, an unbuffered stream is always clean.  An input stream that is
at end-of-file is clean.  A line-buffered stream is clean when the last
character output was a newline.
<P>
There is one case in which cleaning a stream is impossible on most
systems.  This is when the stream is doing input from a file that is not
random-access.  Such streams typically read ahead, and when the file is
not random access, there is no way to give back the excess data already
read.  When an input stream reads from a random-access file,
<CODE>fflush</CODE> does clean the stream, but leaves the file pointer at an
unpredictable place; you must set the file pointer before doing any
further I/O.  On the GNU system, using <CODE>fclean</CODE> avoids both of
these problems.
<P>
Closing an output-only stream also does <CODE>fflush</CODE>, so this is a
valid way of cleaning an output stream.  On the GNU system, closing an
input stream does <CODE>fclean</CODE>.
<P>
You need not clean a stream before using its descriptor for control
operations such as setting terminal modes; these operations don't affect
the file position and are not affected by it.  You can use any
descriptor for these operations, and all channels are affected
simultaneously.  However, text already "output" to a stream but still
buffered by the stream will be subject to the new terminal modes when
subsequently flushed.  To make sure "past" output is covered by the
terminal settings that were in effect at the time, flush the output
streams for that terminal before setting the modes.  See section <A HREF="library_16.html#SEC272" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_16.html#SEC272">Terminal Modes</A>.
<P>
<A NAME="IDX672"></A>
<A NAME="IDX673"></A>
<A NAME="IDX674"></A>
<H2><A NAME="SEC180" HREF="library_toc.html#SEC180" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC180">Waiting for Input or Output</A></H2>
<P>
Sometimes a program needs to accept input on multiple input channels
whenever input arrives.  For example, some workstations may have devices
such as a digitizing tablet, function button box, or dial box that are
connected via normal asynchronous serial interfaces; good user interface
style requires responding immediately to input on any device.  Another
example is a program that acts as a server to several other processes
via pipes or sockets.
<P>
You cannot normally use <CODE>read</CODE> for this purpose, because this
blocks the program until input is available on one particular file
descriptor; input on other channels won't wake it up.  You could set
nonblocking mode and poll each file descriptor in turn, but this is very
inefficient.
<P>
A better solution is to use the <CODE>select</CODE> function.  This blocks the
program until input or output is ready on a specified set of file
descriptors, or until timer expires, whichever comes first.  This
facility is declared in the header file <TT>`sys/types.h'</TT>.
<A NAME="IDX675"></A>
<A NAME="IDX676"></A>
<P>
The file descriptor sets for the <CODE>select</CODE> function are specified
as <CODE>fd_set</CODE> objects.  Here is the description of the data type
and some macros for manipulating these objects.
<P>
<A NAME="IDX677"></A>
<U>Data Type:</U> <B>fd_set</B><P>
The <CODE>fd_set</CODE> data type represents file descriptor sets for the
<CODE>select</CODE> function.  It is actually a bit array.
<P>
<A NAME="IDX678"></A>
<U>Macro:</U> int <B>FD_SETSIZE</B><P>
The value of this macro is the maximum number of file descriptors that a
<CODE>fd_set</CODE> object can hold information about.  On systems with a
fixed maximum number, <CODE>FD_SETSIZE</CODE> is at least that number.  On
some systems, including GNU, there is no absolute limit on the number of
descriptors open, but this macro still has a constant value which
controls the number of bits in an <CODE>fd_set</CODE>.
<P>
<A NAME="IDX679"></A>
<U>Macro:</U> void <B>FD_ZERO</B> <I>(fd_set *<VAR>set</VAR>)</I><P>
This macro initializes the file descriptor set <VAR>set</VAR> to be the
empty set.
<P>
<A NAME="IDX680"></A>
<U>Macro:</U> void <B>FD_SET</B> <I>(int <VAR>filedes</VAR>, fd_set *<VAR>set</VAR>)</I><P>
This macro adds <VAR>filedes</VAR> to the file descriptor set <VAR>set</VAR>.
<P>
<A NAME="IDX681"></A>
<U>Macro:</U> void <B>FD_CLR</B> <I>(int <VAR>filedes</VAR>, fd_set *<VAR>set</VAR>)</I><P>
This macro removes <VAR>filedes</VAR> from the file descriptor set <VAR>set</VAR>.
<P>
<A NAME="IDX682"></A>
<U>Macro:</U> int <B>FD_ISSET</B> <I>(int <VAR>filedes</VAR>, fd_set *<VAR>set</VAR>)</I><P>
This macro returns a nonzero value (true) if <VAR>filedes</VAR> is a member
of the the file descriptor set <VAR>set</VAR>, and zero (false) otherwise.
<P>
Next, here is the description of the <CODE>select</CODE> function itself.
<P>
<A NAME="IDX683"></A>
<U>Function:</U> int <B>select</B> <I>(int <VAR>nfds</VAR>, fd_set *<VAR>read_fds</VAR>, fd_set *<VAR>write_fds</VAR>, fd_set *<VAR>except_fds</VAR>, struct timeval *<VAR>timeout</VAR>)</I><P>
The <CODE>select</CODE> function blocks the calling process until there is
activity on any of the specified sets of file descriptors, or until the
timeout period has expired.
<P>
The file descriptors specified by the <VAR>read_fds</VAR> argument are
checked to see if they are ready for reading; the <VAR>write_fds</VAR> file
descriptors are checked to see if they are ready for writing; and the
<VAR>except_fds</VAR> file descriptors are checked for exceptional
conditions.  You can pass a null pointer for any of these arguments if
you are not interested in checking for that kind of condition.
<P>
"Exceptional conditions" does not mean errors--errors are reported
immediately when an erroneous system call is executed, and do not
constitute a state of the descriptor.  Rather, they include conditions
such as the presence of an urgent message on a socket.  (See section <A HREF="library_15.html#SEC216" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_15.html#SEC216">Sockets</A>,
for information on urgent messages.)
<P>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩久久99精品久久久久久夜| 成人美女在线视频| 国产精品私房写真福利视频| 欧美日韩中文字幕一区二区| 国内外成人在线视频| 亚洲精品乱码久久久久久| 日韩欧美成人午夜| 日本精品一区二区三区四区的功能| 久久99精品国产91久久来源| 亚洲成人精品在线观看| 中文字幕亚洲欧美在线不卡| 精品福利一二区| 欧美日本国产一区| 色女孩综合影院| 成人av在线网| 狠狠狠色丁香婷婷综合激情| 亚洲国产日韩综合久久精品| 国产精品国产三级国产三级人妇| 日韩视频在线永久播放| 欧美亚一区二区| 91在线丨porny丨国产| 国产剧情一区二区| 紧缚奴在线一区二区三区| 午夜欧美电影在线观看| 亚洲一区二区五区| 伊人一区二区三区| 成人免费一区二区三区视频| 国产精品你懂的| 久久精品欧美一区二区三区不卡 | 日日噜噜夜夜狠狠视频欧美人| 中文字幕在线不卡一区| 亚洲国产精品激情在线观看| 精品久久国产97色综合| 日韩欧美三级在线| 日韩美女在线视频| 日韩精品中午字幕| 日韩欧美国产一区二区在线播放| 91精品国产免费| 日韩亚洲欧美一区二区三区| 日韩一区二区三区电影在线观看 | 一区二区三区国产豹纹内裤在线| 国产精品乱码久久久久久| 久久久久久久久久久久久女国产乱 | 欧美一区二区二区| 精品人在线二区三区| 欧美一级久久久久久久大片| 日韩欧美亚洲国产精品字幕久久久| 日韩欧美中文字幕精品| 91蝌蚪porny| 粉嫩绯色av一区二区在线观看| 国产精品一区免费视频| 丁香天五香天堂综合| 不卡的看片网站| 色视频一区二区| 欧美精品丝袜中出| 日韩一级成人av| 久久久三级国产网站| 欧美激情一区二区| 亚洲精品视频观看| 丝袜美腿亚洲综合| 国产精品一区二区x88av| 白白色 亚洲乱淫| 日本电影亚洲天堂一区| 欧美日本高清视频在线观看| 日韩免费高清视频| 中文字幕不卡在线观看| 一区二区三区欧美日韩| 免费成人小视频| 风间由美一区二区三区在线观看 | 美女爽到高潮91| 国产成人精品影视| 色综合视频在线观看| 日韩一级免费观看| 欧美激情一区二区三区蜜桃视频| 一区二区三区在线播| 美国毛片一区二区三区| 国产69精品久久久久毛片| 欧美日韩亚洲综合| 久久久国产精品不卡| 一区二区三区在线免费| 激情小说亚洲一区| 99久久免费精品高清特色大片| 制服丝袜亚洲网站| 国产精品久久久久久亚洲毛片 | www国产成人| 亚洲欧美一区二区不卡| 久久国内精品视频| 91在线porny国产在线看| 51精品久久久久久久蜜臀| 久久精品欧美日韩精品 | 99久久精品国产一区二区三区| 欧美三级中文字| 国产欧美精品一区二区色综合朱莉| 一区二区日韩电影| 成人免费视频app| 欧美一区二区久久久| 亚洲视频 欧洲视频| 国产一二精品视频| 欧美日本一区二区三区| 亚洲日本成人在线观看| 久久99精品久久久久久久久久久久 | 夜夜精品视频一区二区| 国产乱码精品1区2区3区| 欧美嫩在线观看| 亚洲最色的网站| 成人免费观看男女羞羞视频| 欧美一级专区免费大片| 亚洲国产日韩综合久久精品| 99re热视频这里只精品| 久久女同性恋中文字幕| 久久精品国内一区二区三区| 欧美丝袜丝交足nylons图片| 亚洲视频香蕉人妖| 99热精品一区二区| 国产亚洲精品超碰| 国产一区在线看| 精品欧美一区二区在线观看| 日韩av一二三| 欧美女孩性生活视频| 亚洲成人www| 在线精品观看国产| 亚洲人快播电影网| 色综合视频在线观看| 亚洲欧洲日韩在线| caoporn国产精品| 欧美国产日本视频| 成人影视亚洲图片在线| 国产日本亚洲高清| 国产不卡在线一区| 欧美激情中文不卡| 成人久久久精品乱码一区二区三区| 国产欧美一区二区精品秋霞影院 | 日本免费在线视频不卡一不卡二| 欧美日产在线观看| 奇米色777欧美一区二区| 欧美日韩亚洲国产综合| 午夜视频在线观看一区二区三区| 欧美主播一区二区三区美女| 一区二区三区四区av| 91国产视频在线观看| 亚洲成人一区在线| 欧美一区二区三区在线观看 | 国产精品毛片久久久久久| 国产福利一区二区三区视频 | 国产91在线|亚洲| 日本一区二区三区四区在线视频 | 26uuu亚洲综合色| 激情图片小说一区| 欧美激情在线观看视频免费| av亚洲精华国产精华精| 一区二区三区不卡在线观看 | 日韩精品一二三| 26uuu精品一区二区三区四区在线| 精品写真视频在线观看| 国产精品女同一区二区三区| 91蝌蚪porny九色| 婷婷综合在线观看| 久久人人超碰精品| 99re亚洲国产精品| 亚洲综合另类小说| 日韩一区二区精品葵司在线| 国产99久久久精品| 亚洲色图一区二区三区| 欧美男人的天堂一二区| 九色综合狠狠综合久久| 中文无字幕一区二区三区| 日本道免费精品一区二区三区| 午夜电影久久久| 国产亚洲欧美日韩在线一区| 91丨porny丨在线| 日日夜夜一区二区| 国产视频一区在线播放| 色8久久人人97超碰香蕉987| 久久精品久久精品| 亚洲素人一区二区| 日韩欧美国产系列| 97精品国产露脸对白| 日韩国产一二三区| 国产精品国产馆在线真实露脸 | 岛国精品在线播放| 亚洲一区二区精品视频| 久久综合九色综合欧美亚洲| 99re亚洲国产精品| 国内一区二区视频| 亚洲成国产人片在线观看| 久久日韩粉嫩一区二区三区| 在线影院国内精品| 粉嫩蜜臀av国产精品网站| 香港成人在线视频| 亚洲天堂2016| 久久综合成人精品亚洲另类欧美| 欧洲精品中文字幕| 国产成人三级在线观看| 视频一区视频二区中文| 亚洲欧洲日韩女同| 久久综合九色综合97婷婷女人| 欧美日韩精品专区| 99久久精品久久久久久清纯| 国产在线一区观看| 视频在线在亚洲|