OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / getdomainname.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified 1997-08-25 by Nicolas Lichtmaier <nick@debian.org>
26 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
27 .\" Modified 2008-11-27 by mtk
28 .\"
29 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
30 .\"         all rights reserved.
31 .\" Translated 1997-06-27, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
32 .\" Updated 2000-10-03, Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
33 .\" Updated & Modified 2004-12-29, Yuichi SATO <ysato444@yahoo.co.jp>
34 .\" Updated 2008-12-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.15
35 .\"
36 .TH GETDOMAINNAME 2 2009-09-27 "Linux" "Linux Programmer's Manual"
37 .\"O .SH NAME
38 .SH Ì¾Á°
39 .\"O getdomainname, setdomainname \- get/set domain name
40 getdomainname, setdomainname \- ¥É¥á¥¤¥ó̾¤Î¼èÆÀ¡¦ÀßÄê¤ò¤¹¤ë
41 .\"O .SH SYNOPSIS
42 .SH ½ñ¼°
43 .B #include <unistd.h>
44 .sp
45 .BI "int getdomainname(char *" name ", size_t " len );
46 .br
47 .BI "int setdomainname(const char *" name ", size_t " len );
48 .sp
49 .in -4n
50 .\"O Feature Test Macro Requirements for glibc (see
51 .\"O .BR feature_test_macros (7)):
52 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
53 .RB ( feature_test_macros (7)
54 »²¾È):
55 .in
56 .sp
57 .ad l
58 .BR getdomainname (),
59 .BR setdomainname ():
60 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
61 .ad b
62 .\"O .SH DESCRIPTION
63 .SH ÀâÌÀ
64 .\"O These functions are used to access or to change the domain name of the
65 .\"O host system.
66 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¥Û¥¹¥È¥·¥¹¥Æ¥à¤Î¥É¥á¥¤¥ó̾¤ò¼èÆÀ¡¦Êѹ¹¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£
67
68 .\"O .BR setdomainname ()
69 .\"O sets the domain name to the value given in the character array
70 .\"O .IR name .
71 .\"O The
72 .\"O .I len
73 .\"O argument specifies the number of bytes in
74 .\"O .IR name .
75 .\"O (Thus,
76 .\"O .I name
77 .\"O does not require a terminating null byte.)
78 .BR setdomainname ()
79 ¤Ï¡¢¥É¥á¥¤¥ó̾¤ò¡¢Ê¸»úÇÛÎó
80 .I name
81 ¤Ç»ØÄꤵ¤ì¤¿ÃͤËÀßÄꤹ¤ë¡£
82 °ú¤­¿ô
83 .I len
84 ¤Ë¤Ï¡¢
85 .I name
86 ¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë
87 (¤½¤Î¤¿¤á¡¢
88 .I name
89 ¤Ç¤Ïʸ»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ÏɬÍפʤ¤)¡£
90
91 .\"O .BR getdomainname ()
92 .\"O returns the null-terminated domain name in the character array
93 .\"O .IR name ,
94 .\"O which has a length of
95 .\"O .I len
96 .\"O bytes.
97 .\"O If the null-terminated domain name requires more than \fIlen\fP bytes,
98 .\"O .BR getdomainname ()
99 .\"O returns the first \fIlen\fP bytes (glibc) or gives an error (libc).
100 .BR getdomainname ()
101 ¤Ï¡¢NULL ½ªÃ¼¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤ò¡¢
102 .I len
103 ¥Ð¥¤¥È¤ÎŤµ¤Îʸ»úÇÛÎó
104 .I name
105 ¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
106 NULL ½ªÃ¼¤µ¤ì¤¿¥É¥á¥¤¥ó̾¤¬ \fIlen\fP ¥Ð¥¤¥È¤è¤êŤ¤¾ì¹ç¡¢
107 .BR getdomainname ()
108 ¤Ï¡¢(glibc ¤Ç¤Ï) »Ï¤á¤Î \fIlen\fP ¥Ð¥¤¥È¤òÊÖ¤·¡¢(libc ¤Ç¤Ï) ¥¨¥é¡¼¤È¤Ê¤ë¡£
109 .\"O .SH "RETURN VALUE"
110 .SH ÊÖ¤êÃÍ
111 .\"O On success, zero is returned.
112 .\"O On error, \-1 is returned, and
113 .\"O .I errno
114 .\"O is set appropriately.
115 À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ
116 .I errno
117 ¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£
118 .\"O .SH ERRORS
119 .SH ¥¨¥é¡¼
120 .\"O .BR setdomainname ()
121 .\"O can fail with the following errors:
122 .BR setdomainname ()
123 ¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
124 .TP
125 .B EFAULT
126 .\"O .I name
127 .\"O pointed outside of user address space.
128 .I name
129 ¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤¿¡£
130 .TP
131 .B EINVAL
132 .\"O .I len
133 .\"O was negative or too large.
134 .I len
135 ¤¬Éé¤Ç¤¢¤ë¤«¡¢Ä¹¤¹¤®¤ë¡£
136 .TP
137 .B EPERM
138 .\"O the caller is unprivileged (Linux: does not have the
139 .\"O .B CAP_SYS_ADMIN
140 .\"O capability).
141 .BR setdomainname ()
142 ¤Ë¤ª¤¤¤Æ¡¢¸Æ¤Ó½Ð¤·¤¿¿Í¤ËÆø¢¤¬¤Ê¤¤
143 (Linux ¤Ç¤Ï
144 .B CAP_SYS_ADMIN
145 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¤)¡£
146 .PP
147 .\"O .BR getdomainname ()
148 .\"O can fail with the following errors:
149 .BR getdomainname ()
150 ¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
151 .TP
152 .B EINVAL
153 .\"O For
154 .\"O .BR getdomainname ()
155 .\"O under libc:
156 .\"O .I name
157 .\"O is NULL or
158 .\"O .I name
159 .\"O is longer than
160 .\"O .I len
161 .\"O bytes.
162 libc ¤Ç¤Î
163 .BR getdomainname ()
164 ¤Ë¤ª¤¤¤Æ¡¢
165 .I name
166 ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¤«¡¢
167 .I len
168 ¥Ð¥¤¥È¤è¤êŤ¤¡£
169 .\"O .SH "CONFORMING TO"
170 .SH ½àµò
171 .\"O POSIX does not specify these calls.
172 .\"O .\" But they appear on most systems...
173 POSIX ¤Ç¤Ï¡¢¤³¤ì¤é´Ø¿ô¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
174 .\" ¤·¤«¤·¡¢¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ë¤¢¤ë...
175 .\"O .SH NOTES
176 .SH Ãí°Õ
177 .\"O Since Linux 1.0, the limit on the length of a domain name,
178 .\"O including the terminating null byte, is 64 bytes.
179 .\"O In older kernels, it was 8 bytes.
180 Linux 1.0 °Ê¹ß¤Ç¤Ï¡¢¥É¥á¥¤¥ó̾¤ÎŤµ¤Î¾å¸Â¤Ï
181 ½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤ò´Þ¤á¤Æ 64 ¥Ð¥¤¥È¤Ç¤¢¤ë¡£
182 ¤â¤Ã¤È¸Å¤¤¥«¡¼¥Í¥ë¤Ç¤Ï 8 ¥Ð¥¤¥È¤Ç¤¢¤Ã¤¿¡£
183
184 .\"O On most Linux architectures (including x86),
185 .\"O there is no
186 .\"O .BR getdomainname ()
187 .\"O system call; instead, glibc implements
188 .\"O .BR getdomainname ()
189 .\"O as a library function that returns a copy of the
190 .\"O .I domainname
191 .\"O field returned from a call to
192 .\"O .BR uname (2).
193 (x86 ¤ò´Þ¤à) Linux ¤Î¤Û¤È¤ó¤É¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ç¤Ï¡¢
194 .BR getdomainname ()
195 ¤È¤¤¤¦¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¸ºß¤·¤Ê¤¤¡£
196 ¤½¤ÎÂå¤ï¤ê¡¢glibc ¤Ç
197 .BR getdomainname ()
198 ¤¬¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤Î´Ø¿ô¤Ï
199 .BR uname (2)
200 ¤Î¸Æ¤Ó½Ð¤·¤ÇÊÖ¤µ¤ì¤¿
201 .I domainname
202 ¥Õ¥£¡¼¥ë¥É¤Î¥³¥Ô¡¼¤òÊÖ¤¹¡£
203 .\"O .SH "SEE ALSO"
204 .SH ´ØÏ¢¹àÌÜ
205 .BR gethostname (2),
206 .BR sethostname (2),
207 .BR uname (2)