syscalls_24.html

来自「Linux系统调用」· HTML 代码 · 共 36 行

HTML
36
字号
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - read</TITLE>
<P>Go to the <A HREF="syscalls_23.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_23.html">previous</A>, <A HREF="syscalls_25.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_25.html">next</A> section.<P>
<H2><A NAME="SEC24" HREF="syscalls_toc.html#SEC24" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC24">read</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int read(int <VAR>fd</VAR>, char *<VAR>buf</VAR>, size_t <VAR>count</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor to read from.
<P>
<VAR>buf</VAR>: [out] the buffer that will contain information read.
<P>
<VAR>count</VAR>: [in] the maximal size of <VAR>buf</VAR>. 
<P>
<H3>DESCRIPTION</H3>
<P>
Reads up to <VAR>count</VAR> bytes into <VAR>buf</VAR> from <VAR>fd</VAR>. 
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>fd</VAR> cannot be read.
<LI><CODE>EINTR</CODE>, <CODE>EAGAIN</CODE>, <CODE>EISDIR</CODE>, <CODE>EBADF</CODE> and
<CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_23.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_23.html">previous</A>, <A HREF="syscalls_25.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_25.html">next</A> section.<P>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?