37 lines
1.5 KiB
HTML
37 lines
1.5 KiB
HTML
<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://www.infran.ru/TechInfo/syscalls/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">next</A> section.<P>
|
|
<H2><A NAME="SEC47" HREF="syscalls_toc.html#SEC47" tppabs="http://www.infran.ru/TechInfo/syscalls/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://www.infran.ru/TechInfo/syscalls/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">next</A> section.<P>
|