.\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" 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. .\" .\" @(#) getpeername. 2 8.1 (Berkeley) 6/4/93 .\" %FreeBSD: src/lib/libc/sys/getpeername. 2, v 1.9. 2.8 2001/12/14 18:34:00 ru Exp % .\" .\" $FreeBSD: doc/ja_JP.eucJP/man/man2/getpeername. 2, v 1.8 2001/12/23 00:03:42 horikawa Exp $ .Dd June 4, 1993 .Dt GETPEERNAME 2 .Os .Sh ¸íĪ .Nm getpeername .Nd Á¢¼ÓµÈ ÇǾî (Åë½Å »ó´ë)ÀÇ À̸§ÀÇ Ãëµæ .Sh ÇÁ·Î±×·¥ ¶óÀ̺귯¸® .Lb libc .Sh ¼­½Ä .In sys/types.h .In sys/socket.h .Ft int .Fn getpeername "int s" "struct sockaddr *name" "socklen_t *namelen" .Sh ÇØ¼³ .Fn getpeername (Àº)´Â, ¼ÒÄÏ .Fa s ¿¡ Á¢¼ÓµÈ ÇǾî (Åë½Å »ó´ë)ÀÇ À̸§À» µ¹·ÁÁÝ´Ï´Ù. .Fa namelen ÆÄ¶ó¹ÌÅÍ¿¡´Â, .Fa name ÇÏÁö¸¸ °¡¸®Å°´Â °ø°£ÀÇ ¾çÀ» ³ªÅ¸³»´Â °ªÀ» ³Ö¾î µÑ Çʿ䰡 ÀÖ½À´Ï´Ù. µ¹¾Æ¿Ã ¶§¿¡, À̰Ϳ¡´Â µ¹·ÁÁÖ¾îÁø À̸§ÀÇ ½ÇÁ¦ÀÇ »çÀÌÁî (¹ÙÀÌÆ® ´ÜÀ§)°¡ ³ÖÀ» ¼ö ÀÖ½À´Ï´Ù. ÁغñµÈ ¹öÆÛ°¡ ³Ê¹« ÀÛÀº °æ¿ì, À̸§Àº Àß¶ó ¹ö¸± ¼ö ÀÖ½À´Ï´Ù. .Sh ¹Ýȯ°ª .Rv -std getpeername .Sh ¿¡·¯ ÀÌÈÄÀÇ °æ¿ì¸¦ Á¦¿ÜÇØ È£ÃâÀº 󸮿¡ ¼º°øÇÕ´Ï´Ù. .Bl -tag -width Er .It Bq Er EBADF Àμö .Fa s ÇÏÁö¸¸ À¯È¿ÇÑ ±â¼úÀÚ°¡ ¾Æ´Õ´Ï´Ù. .It Bq Er ECONNRESET Á¢¼ÓÀÌ ÇǾ ÀÇÇØ ¸®¼ÂÆ® µÇ¾ú½À´Ï´Ù. .It Bq Er ENOTSOCK Àμö .Fa s (Àº)´Â ¼ÒÄÏÀº ¾Æ´Ï°í ÆÄÀÏÀÔ´Ï´Ù. .It Bq Er ENOTCONN ¼ÒÄÏÀÌ Á¢¼ÓµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. .It Bq Er ENOBUFS Á¶ÀÛÀ» ½ÇÇàÇϱâ À§ÇÑ ÃæºÐÇÑ ¸®¼Ò½º°¡ ½Ã½ºÅÛ¿¡ ¾ø½À´Ï´Ù. .It Bq Er EFAULT .Fa name ÆÄ¶ó¹ÌÅÍ´Â, ÇÁ·Î¼¼½ºÀÇ address °ø°£ÀÇ À¯È¿ÇÑ areaÀÇ ¹üÀ§¿Ü¸¦ °¡¸®Å°°í ÀÖ½À´Ï´Ù. .El .Sh °ü·Ã Ç׸ñ .Xr accept 2 , .Xr bind 2 , .Xr getsockname 2 , .Xr socket 2 .Sh ¿ª»ç .Fn getpeername ÇÔ¼ö´Â .Bx 4.2 ±×¸®°í µîÀåÇß½À´Ï´Ù.