📄 syscalls_47.html
字号:
<!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpeername</TITLE>
<P>Go to the <A HREF="syscalls_46.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_48.html">next</A> section.<P>
<H2><A NAME="SEC47" HREF="syscalls_toc.html#SEC47" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC47">getpeername</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getpeername(int <VAR>s</VAR>, struct sockaddr *<VAR>name</VAR>, int
*<VAR>namelen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket.
<P>
<VAR>name</VAR>: [out] points to the buffer where to store the name.
<P>
<VAR>namelen</VAR>: [in out] the maximum length (in bytes) of <VAR>name</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Returns the name of the peer machine connected to the remote end of a
socket. If the buffer is too small, the name is truncated.
<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>EBADF</CODE>, <CODE>ENOSOCK</CODE>, <CODE>ENOTCONN</CODE>, <CODE>ENOBUFS</CODE> and
<CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_46.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_48.html">next</A> section.<P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -