⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscalls_41.html

📁 Linux系统调用
💻 HTML
字号:
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - accept</TITLE>
<P>Go to the <A HREF="syscalls_40.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_40.html">previous</A>, <A HREF="syscalls_42.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_42.html">next</A> section.<P>
<H2><A NAME="SEC41" HREF="syscalls_toc.html#SEC41" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC41">accept</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int accept(int <VAR>s</VAR>, struct sockaddr *<VAR>addr</VAR>, int
*<VAR>addrlen</VAR>);</CODE> 
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket connections are accepted from.
<P>
<VAR>addr</VAR>: [out] contains the address of the the buffer that will be
filled with the address of connecting entity.
<P>
<VAR>addrlen</VAR>: [out] on input contains the maximum length of addr in
bytes, on output contains the length of addr in bytes.
<P>
<H3>DESCRIPTION</H3>
<P>
If connections are pending on the socket <VAR>s</VAR>, the first connection
in the queue is dequeued and opened and a new socket with the same
properties of <VAR>s</VAR> is returned. If no connection is pending and the
socket is blocking, then the call blocks until a connection is requested
on <VAR>s</VAR>. Otherwise the call returns an error code. The socket <VAR>s</VAR>
remains open for future connections. The address of the connecting
entity is returned in <VAR>addr</VAR>. The format of the address depends on
the type of network on through which the socket communicates.
<CODE>accept</CODE> does not send a confirmation at the connecting entity.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns a positive value that is the file
descriptor of the new socket. On errror, the call returns -1 and sets
<CODE>errno</CODE> to one of the following error values:
<P>
<UL>
<LI><CODE>EOPNOTSUPP</CODE>: The referenced socket is not of type
<CODE>SOCK_STREAM</CODE>.
<LI><CODE>EWOULDBLOCK</CODE>: The socket is marked non-blocking and  no
connection is pending.
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE> or <CODE>EFAULT</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_40.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_40.html">previous</A>, <A HREF="syscalls_42.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_42.html">next</A> section.<P>

⌨️ 快捷键说明

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