OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man2 / getsockname.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 .\"     @(#)getsockname.2       6.4 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Sat Jul 24 16:30:29 1993 by Rik Faith <faith@cs.unc.edu>
35 .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
36 .\" Modified Sun Mar 28 21:26:46 1999 by Andries Brouwer <aeb@cwi.nl>
37 .\"
38 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
39 .\"         all rights reserved.
40 .\" Translated Thu Jun 26 20:36:49 JST 1997
41 .\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
42 .\" Modified Sat Apr  3 14:56:26 JST 1999
43 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
44 .\" Updated & Modified Sat Feb  5 17:23:11 JST 2005
45 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
46 .\"
47 .TH GETSOCKNAME 2 2008-12-03 "Linux" "Linux Programmer's Manual"
48 .SH Ì¾Á°
49 getsockname \- ¥½¥±¥Ã¥È¤Î̾Á°¤ò¼èÆÀ¤¹¤ë
50 .SH ½ñ¼°
51 .nf
52 .B #include <sys/socket.h>
53 .sp
54 .BI "int getsockname(int " sockfd ", struct sockaddr *" addr \
55 ", socklen_t *" addrlen );
56 .fi
57 .SH ÀâÌÀ
58 .BR getsockname ()
59 ¤Ï¡¢¥½¥±¥Ã¥È
60 .I sockfd
61 ¤Ë·ë¤ÓÉÕ¤±¤é¤ì¤Æ¤¤¤ë¸½ºß¤Î¥¢¥É¥ì¥¹¤ò¡¢
62 .I addr
63 ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
64 .I addrlen
65 °ú¤­¿ô¤Ï¡¢
66 .I addr
67 ¤¬»Ø¤·¤Æ¤¤¤ëÎΰè¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ë½é´ü²½¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
68 ´Ø¿ô¤¬ÊÖ¤ë»þ¤Ë¤Ï¡¢
69 .I addrlen
70 ¤Ë¤Ï¥½¥±¥Ã¥È¥¢¥É¥ì¥¹¤Î¼ÂºÝ¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤¬³ÊǼ¤µ¤ì¤ë¡£
71
72 ÅϤµ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬¾®¤µ²á¤®¤¿¾ì¹ç¤Ï¡¢ÊÖ¤µ¤ì¤ë¥¢¥É¥ì¥¹¤ÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤ë¡£
73 ¤³¤Î¾ì¹ç¤Ë¤Ï¡¢
74 .I addrlen
75 ¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·»þ¤Ë»ØÄꤵ¤ì¤¿Ãͤè¤ê¤âÂ礭¤ÊÃͤ¬³ÊǼ¤µ¤ì¤ë¡£
76 .SH ÊÖ¤êÃÍ
77 À®¸ù¤·¤¿¾ì¹ç 0 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤òÊÖ¤·¡¢
78 .I errno
79 ¤ò¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤹ¤ë¡£
80 .SH ¥¨¥é¡¼
81 .TP
82 .B EBADF
83 °ú¤­¿ô
84 .I sockfd
85 ¤¬Í­¸ú¤Ê¥Ç¥£¥¹¥¯¥ê¥×¥¿ (descriptor) ¤Ç¤Ï¤Ê¤¤¡£
86 .TP
87 .B EFAULT
88 °ú¤­¿ô
89 .I addr
90 ¤Î»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÍ­¸ú¤ÊÉôʬ¤Ç¤Ï¤Ê¤¤¡£
91 .TP
92 .B EINVAL
93 .I addrlen
94 ¤¬ÉÔÀµ¤Ç¤¢¤ë (Î㤨¤Ð¡¢Éé¤Ç¾ì¹ç¤Ê¤É)¡£
95 .TP
96 .B ENOBUFS
97 ½èÍý¤ò¤¹¤ë¤À¤±¤Î½½Ê¬¤Ê¥ê¥½¡¼¥¹¤¬¥·¥¹¥Æ¥à¤Ë̵¤¤¡£
98 .TP
99 .B ENOTSOCK
100 °ú¤­¿ô
101 .I sockfd
102 ¤¬¥½¥±¥Ã¥È¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£
103 .SH ½àµò
104 SVr4, 4.4BSD
105 .RB ( getsockname ()
106 ´Ø¿ô¤Ï 4.2BSD ¤ÇÄɲ䵤줿), POSIX.1-2001.
107 .\" SVr4 ¤Ë¤Ï¾¤Ë ENOMEM ¤È ENOSR ¤Î¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
108 .SH Ãí°Õ
109 .BR getsockname ()
110 ¤Î»°ÈÖÌܤΰú¤­¿ô¤Ï (4.x BSD ¤ä libc4, libc5 ¤ÈƱÍͤË) ¼ÂºÝ¤Ë¤Ï \fIint *\fP
111 ¤Ç¤¢¤ë¡£ glibc ¤Ç¤â»È¤ï¤ì¤Æ¤¤¤ë¸½ºß¤Î \fIsocklen_t\fP ¤Ë´Ø¤·¤Æ¡¢
112 POSIX ¤Ë¤Ï¾¯¤·º®Í𤬤¢¤ë¡£
113 ¾Ü¤·¤¯¤Ï
114 .BR accept (2)
115 ¤ò»²¾È¤Î¤³¤È¡£
116 .SH ´ØÏ¢¹àÌÜ
117 .BR bind (2),
118 .BR socket (2),
119 .BR getifaddrs (3),
120 .BR ip (7),
121 .BR socket (7),
122 .BR unix (7)