OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / getpeername.2
1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)getpeername.2       6.5 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Sat Jul 24 16:37:50 1993 by Rik Faith <faith@cs.unc.edu>
35 .\" Modified Thu Jul 30 14:37:50 1993 by Martin Schulze <joey@debian.org>
36 .\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer <aeb@cwi.nl>
37 .\" Modified 17 Jul 2002, Michael Kerrisk <mtk.manpages@gmail.com>
38 .\"     Added 'socket' to NAME, so that "man -k socket" will show this page.
39 .\"
40 .\" Japanese Version Copyright (c) 1997-1999 HANATAKA Shinya
41 .\"         all rights reserved.
42 .\" Translated Sat Apr  3 14:53:19 JST 1999
43 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
44 .\" Updated Tue Nov 26 JST 2002 by Kentaro Shirakata <argrath@ub32.org>
45 .\"
46 .\"WORD:        connect                 Àܳ
47 .\"WORD:        peer                    Áê¼ê
48 .\"WORD:        socket                  ¥½¥±¥Ã¥È
49 .\"WORD:        buffer                  ¥Ð¥Ã¥Õ¥¡
50 .\"WORD:        descriptor              ¥Ç¥£¥¹¥¯¥ê¥×¥¿
51 .\"WORD:        argument                °ú¤­¿ô
52 .\"
53 .TH GETPEERNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual"
54 .SH Ì¾Á°
55 getpeername \- Àܳ¤·¤Æ¤¤¤ëÁê¼ê¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë
56 .SH ½ñ¼°
57 .B #include <sys/socket.h>
58 .sp
59 .BI "int getpeername(int " sockfd ", struct sockaddr *" addr \
60 ", socklen_t *" addrlen );
61 .SH ÀâÌÀ
62 .BR getpeername ()
63 ¤Ï¡¢¥½¥±¥Ã¥È(socket)
64 .I sockfd
65 ¤ËÀܳ¤·¤Æ¤¤¤ëÁê¼ê¤Î¥¢¥É¥ì¥¹¤ò¡¢
66 .I addr
67 ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
68 .I addrlen
69 °ú¤­¿ô¤Ï¡¢
70 .I addr
71 ¤¬»Ø¤·¤Æ¤¤¤ëÎΰè¤Î¥µ¥¤¥º¤Ë½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
72 ´Ø¿ô¤¬ÊÖ¤ë»þ¤Ë¤Ï¡¢
73 .I addrlen
74 ¤Ë¤Ï¼ÂºÝ¤ËÊÖ¤µ¤ì¤¿Ì¾Á°¤Î¥µ¥¤¥º¤¬ (¥Ð¥¤¥Èñ°Ì¤Ç) ³ÊǼ¤µ¤ì¤ë¡£
75 Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ¤¹¤®¤¿¾ì¹ç¤Ë¤Ï¡¢Ì¾Á°¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£
76
77 ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤¿¾ì¹ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£
78 ¤³¤Î¾ì¹ç¤Ë¤Ï¡¢
79 .I addrlen
80 ¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¡£
81 .SH ÊÖ¤êÃÍ
82 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
83 .I errno
84 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
85 .SH ¥¨¥é¡¼
86 .TP
87 .B EBADF
88 °ú¤­¿ô
89 .I sockfd
90 ¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
91 .TP
92 .B EFAULT
93 .I addr
94 °ú¤­¿ô¤Î»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬Í­¸ú¤Ê¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Î
95 °ìÉô¤Ç¤Ê¤¤¡£
96 .TP
97 .B EINVAL
98 .I addrlen
99 ¤¬ÉÔÀµ¤Ç¤¢¤ë (Î㤨¤Ð¡¢Éé¤Ç¾ì¹ç¤Ê¤É)¡£
100 .TP
101 .B ENOBUFS
102 ¤³¤ÎÁàºî¤ò¹Ô¤Ê¤¦¤Î¤Ë½½Ê¬¤Ê»ñ¸»¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£
103 .TP
104 .B ENOTCONN
105 ¥½¥±¥Ã¥È¤¬Àܳ¤·¤Æ¤¤¤Ê¤¤¡£
106 .TP
107 .B ENOTSOCK
108 °ú¤­¿ô
109 .I sockfd
110 ¤¬¥½¥±¥Ã¥È¤Ç¤Ê¤¯¤Æ¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£
111 .SH ½àµò
112 SVr4, 4.4BSD
113 .RB ( getpeername ()
114 ´Ø¿ô¤Ï 4.2BSD ¤ÇÅо줷¤¿), POSIX.1-2001.
115 .SH Ãí°Õ
116 .BR getpeername ()
117 ¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï¼ÂºÝ¤Ë¤Ï
118 .I `int *'
119 ¤Ç¤¢¤ë (4.x BSD, libc4, libc5 ¤Ç¤Ï
120 ¤³¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë)¡£
121 POSIX ¤Ç¤Ïäþ;¶ÊÀÞ¤ò·Ð¤Æ¸½ºß¤Î
122 .I socklen_t
123 ¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢
124 glibc ¤Ç¤â
125 .I socklen_t
126 ¤ò»È¤Ã¤Æ¤¤¤ë¡£
127 .BR accept (2)
128 ¤â»²¾È¤Î¤³¤È¡£
129 .SH ´ØÏ¢¹àÌÜ
130 .BR accept (2),
131 .BR bind (2),
132 .BR getsockname (2),
133 .BR ip (7),
134 .BR socket (7),
135 .BR unix (7)