OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man2 / getdomainname.2
1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified 1997-08-25 by Nicolás 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 .\"*******************************************************************
30 .\"
31 .\" This file was generated with po4a. Translate the source file.
32 .\"
33 .\"*******************************************************************
34 .TH GETDOMAINNAME 2 2012\-10\-25 Linux "Linux Programmer's Manual"
35 .SH 名前
36 getdomainname, setdomainname \- get/set NIS domain name
37 .SH 書式
38 \fB#include <unistd.h>\fP
39 .sp
40 \fBint getdomainname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP
41 .br
42 \fBint setdomainname(const char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP
43 .sp
44 .in -4n
45 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
46 .in
47 .sp
48 .ad l
49 \fBgetdomainname\fP(), \fBsetdomainname\fP():
50 .RS 4
51 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
52 .RE
53 .ad
54 .SH 説明
55 These functions are used to access or to change the NIS domain name of the
56 host system.
57
58 \fBsetdomainname\fP()  は、ドメイン名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、
59 \fIname\fP のバイト数を指定する (そのため、 \fIname\fP では文字列終端の NULL バイトは必要ない)。
60
61 \fBgetdomainname\fP()  は、NULL 終端されたドメイン名を、 \fIlen\fP バイトの長さの文字配列 \fIname\fP に格納して返す。
62 NULL 終端されたドメイン名が \fIlen\fP バイトより長い場合、 \fBgetdomainname\fP()  は、(glibc では) 始めの
63 \fIlen\fP バイトを返し、(libc では) エラーとなる。
64 .SH 返り値
65 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
66 .SH エラー
67 \fBsetdomainname\fP()  は以下のエラーで失敗する可能性がある。
68 .TP 
69 \fBEFAULT\fP
70 \fIname\fP がユーザアドレス空間の外を指した。
71 .TP 
72 \fBEINVAL\fP
73 \fIlen\fP が負であるか、長すぎる。
74 .TP 
75 \fBEPERM\fP
76 \fBsetdomainname\fP()  において、呼び出した人に特権がない (Linux では \fBCAP_SYS_ADMIN\fP ケーパビリティ
77 (capability) がない)。
78 .PP
79 \fBgetdomainname\fP()  は以下のエラーで失敗する可能性がある。
80 .TP 
81 \fBEINVAL\fP
82 libc での \fBgetdomainname\fP()  において、 \fIname\fP が NULL ポインタであるか、 \fIlen\fP バイトより長い。
83 .SH 準拠
84 .\" But they appear on most systems...
85 POSIX では、これら関数は定義されていない。
86 .SH 注意
87 Linux 1.0 以降では、ドメイン名の長さの上限は 終端の NULL バイトを含めて 64 バイトである。 もっと古いカーネルでは 8
88 バイトであった。
89
90 (x86 を含む) Linux のほとんどのアーキテクチャでは、 \fBgetdomainname\fP()  というシステムコールは存在しない。
91 その代わり、glibc で \fBgetdomainname\fP()  がライブラリ関数として実装されており、この関数は \fBuname\fP(2)
92 の呼び出しで返された \fIdomainname\fP フィールドのコピーを返す。
93 .SH 関連項目
94 \fBgethostname\fP(2), \fBsethostname\fP(2), \fBuname\fP(2)
95 .SH この文書について
96 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
97 である。プロジェクトの説明とバグ報告に関する情報は
98 http://www.kernel.org/doc/man\-pages/ に書かれている。