OSDN Git Service

Convert release and draft pages to UTF-8.
[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 .RS 4
61 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
62 .RE
63 .ad
64 .\"O .SH DESCRIPTION
65 .SH 説明
66 .\"O These functions are used to access or to change the domain name of the
67 .\"O host system.
68 これらの関数は、ホストシステムのドメイン名を取得・変更するために使われる。
69
70 .\"O .BR setdomainname ()
71 .\"O sets the domain name to the value given in the character array
72 .\"O .IR name .
73 .\"O The
74 .\"O .I len
75 .\"O argument specifies the number of bytes in
76 .\"O .IR name .
77 .\"O (Thus,
78 .\"O .I name
79 .\"O does not require a terminating null byte.)
80 .BR setdomainname ()
81 は、ドメイン名を、文字配列
82 .I name
83 で指定された値に設定する。
84 引き数
85 .I len
86 には、
87 .I name
88 のバイト数を指定する
89 (そのため、
90 .I name
91 では文字列終端の NULL バイトは必要ない)。
92
93 .\"O .BR getdomainname ()
94 .\"O returns the null-terminated domain name in the character array
95 .\"O .IR name ,
96 .\"O which has a length of
97 .\"O .I len
98 .\"O bytes.
99 .\"O If the null-terminated domain name requires more than \fIlen\fP bytes,
100 .\"O .BR getdomainname ()
101 .\"O returns the first \fIlen\fP bytes (glibc) or gives an error (libc).
102 .BR getdomainname ()
103 は、NULL 終端されたドメイン名を、
104 .I len
105 バイトの長さの文字配列
106 .I name
107 に格納して返す。
108 NULL 終端されたドメイン名が \fIlen\fP バイトより長い場合、
109 .BR getdomainname ()
110 は、(glibc では) 始めの \fIlen\fP バイトを返し、(libc では) エラーとなる。
111 .\"O .SH "RETURN VALUE"
112 .SH 返り値
113 .\"O On success, zero is returned.
114 .\"O On error, \-1 is returned, and
115 .\"O .I errno
116 .\"O is set appropriately.
117 成功した場合 0 が返る。失敗した場合 \-1 が返り、
118 .I errno
119 がエラーの内容に従って設定される。
120 .\"O .SH ERRORS
121 .SH エラー
122 .\"O .BR setdomainname ()
123 .\"O can fail with the following errors:
124 .BR setdomainname ()
125 は以下のエラーで失敗する可能性がある。
126 .TP
127 .B EFAULT
128 .\"O .I name
129 .\"O pointed outside of user address space.
130 .I name
131 がユーザアドレス空間の外を指した。
132 .TP
133 .B EINVAL
134 .\"O .I len
135 .\"O was negative or too large.
136 .I len
137 が負であるか、長すぎる。
138 .TP
139 .B EPERM
140 .\"O the caller is unprivileged (Linux: does not have the
141 .\"O .B CAP_SYS_ADMIN
142 .\"O capability).
143 .BR setdomainname ()
144 において、呼び出した人に特権がない
145 (Linux では
146 .B CAP_SYS_ADMIN
147 ケーパビリティ (capability) がない)。
148 .PP
149 .\"O .BR getdomainname ()
150 .\"O can fail with the following errors:
151 .BR getdomainname ()
152 は以下のエラーで失敗する可能性がある。
153 .TP
154 .B EINVAL
155 .\"O For
156 .\"O .BR getdomainname ()
157 .\"O under libc:
158 .\"O .I name
159 .\"O is NULL or
160 .\"O .I name
161 .\"O is longer than
162 .\"O .I len
163 .\"O bytes.
164 libc での
165 .BR getdomainname ()
166 において、
167 .I name
168 が NULL ポインタであるか、
169 .I len
170 バイトより長い。
171 .\"O .SH "CONFORMING TO"
172 .SH 準拠
173 .\"O POSIX does not specify these calls.
174 .\"O .\" But they appear on most systems...
175 POSIX では、これら関数は定義されていない。
176 .\" しかし、ほとんどのシステムにある...
177 .\"O .SH NOTES
178 .SH 注意
179 .\"O Since Linux 1.0, the limit on the length of a domain name,
180 .\"O including the terminating null byte, is 64 bytes.
181 .\"O In older kernels, it was 8 bytes.
182 Linux 1.0 以降では、ドメイン名の長さの上限は
183 終端の NULL バイトを含めて 64 バイトである。
184 もっと古いカーネルでは 8 バイトであった。
185
186 .\"O On most Linux architectures (including x86),
187 .\"O there is no
188 .\"O .BR getdomainname ()
189 .\"O system call; instead, glibc implements
190 .\"O .BR getdomainname ()
191 .\"O as a library function that returns a copy of the
192 .\"O .I domainname
193 .\"O field returned from a call to
194 .\"O .BR uname (2).
195 (x86 を含む) Linux のほとんどのアーキテクチャでは、
196 .BR getdomainname ()
197 というシステムコールは存在しない。
198 その代わり、glibc で
199 .BR getdomainname ()
200 がライブラリ関数として実装されており、この関数は
201 .BR uname (2)
202 の呼び出しで返された
203 .I domainname
204 フィールドのコピーを返す。
205 .\"O .SH "SEE ALSO"
206 .SH 関連項目
207 .BR gethostname (2),
208 .BR sethostname (2),
209 .BR uname (2)