OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man2 / getpeername.2
index 732bfc0..4d31fc4 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -28,6 +29,7 @@
 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
+.\" %%%LICENSE_END
 .\"
 .\"     @(#)getpeername.2      6.5 (Berkeley) 3/10/91
 .\"
@@ -42,7 +44,7 @@
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH GETPEERNAME 2 2008\-12\-03 Linux "Linux Programmer's Manual"
+.TH GETPEERNAME 2 2013\-02\-12 Linux "Linux Programmer's Manual"
 .SH 名前
 getpeername \- 接続している相手ソケットの名前を取得する
 .SH 書式
@@ -85,10 +87,22 @@ SVr4, 4.4BSD (\fBgetpeername\fP()  関数は 4.2BSD で登場した), POSIX.1\-2
 \fBgetpeername\fP()  の三番目の引き数は実際には \fI`int *'\fP である (4.x BSD, libc4, libc5 では
 このようになっている)。 POSIX では紆余曲折を経て現在の \fIsocklen_t\fP になっており、 glibc でも \fIsocklen_t\fP
 を使っている。 \fBaccept\fP(2)  も参照のこと。
+
+For stream sockets, once a \fBconnect\fP(2)  has been performed, either socket
+can call \fBgetpeername\fP()  to obtain the address of the peer socket.  On the
+other hand, datagram sockets are connectionless.  Calling \fBconnect\fP(2)  on
+a datagram socket merely sets the peer address for outgoing datagrams sent
+with \fBwrite\fP(2)  or \fBrecv\fP(2).  The caller of \fBconnect\fP(2)  can use
+\fBgetpeername\fP()  to obtain the peer address that it earlier set for the
+socket.  However, the peer socket is unaware of this information, and
+calling \fBgetpeername\fP()  on the peer socket will return no useful
+information (unless a \fBconnect\fP(2)  call was also executed on the peer).
+Note also that the receiver of a datagram can obtain the address of the
+sender when using \fBrecvfrom\fP(2).
 .SH 関連項目
 \fBaccept\fP(2), \fBbind\fP(2), \fBgetsockname\fP(2), \fBip\fP(7), \fBsocket\fP(7),
 \fBunix\fP(7)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。