.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified 1997-08-25 by Nicolás Lichtmaier .\" Modified 2004-06-17 by Michael Kerrisk .\" Modified 2008-11-27 by mtk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki .\" all rights reserved. .\" Translated 1997-06-27, SUTO, Mitsuaki .\" Updated 2000-10-03, Yuichi SATO .\" Updated & Modified 2004-12-29, Yuichi SATO .\" Updated 2008-12-26, Akihiro MOTOKI , LDP v3.15 .\" .TH GETDOMAINNAME 2 2012\-10\-25 Linux "Linux Programmer's Manual" .SH 名前 getdomainname, setdomainname \- NIS ドメイン名の取得・設定をする .SH 書式 \fB#include \fP .sp \fBint getdomainname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .br \fBint setdomainname(const char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fBgetdomainname\fP(), \fBsetdomainname\fP(): .RS 4 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .RE .ad .SH 説明 これらの関数は、ホストシステムの NIS ドメイン名を取得・変更するために使われる。 \fBsetdomainname\fP() は、ドメイン名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、 \fIname\fP のバイト数を指定する (そのため、 \fIname\fP では文字列終端のヌルバイトは必要ない)。 \fBgetdomainname\fP() は、NULL 終端されたドメイン名を、 \fIlen\fP バイトの長さの文字配列 \fIname\fP に格納して返す。ヌル終端されたドメイン名が \fIlen\fP バイトより長い場合、 \fBgetdomainname\fP() は、(glibc では) 始めの \fIlen\fP バイトを返し、(libc では) エラーとなる。 .SH 返り値 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー \fBsetdomainname\fP() は以下のエラーで失敗する可能性がある。 .TP \fBEFAULT\fP \fIname\fP がユーザーアドレス空間の外を指した。 .TP \fBEINVAL\fP \fIlen\fP が負であるか、長すぎる。 .TP \fBEPERM\fP \fBsetdomainname\fP() において、呼び出した人に特権がない (Linux では \fBCAP_SYS_ADMIN\fP ケーパビリティ (capability) がない)。 .PP \fBgetdomainname\fP() は以下のエラーで失敗する可能性がある。 .TP \fBEINVAL\fP libc での \fBgetdomainname\fP() において、 \fIname\fP が NULL であるか、 \fIlen\fP バイトより長い。 .SH 準拠 .\" But they appear on most systems... POSIX では、これら関数は定義されていない。 .SH 注意 Linux 1.0 以降では、ドメイン名の長さの上限は 終端のヌルバイトを含めて 64 バイトである。 もっと古いカーネルでは 8 バイトであった。 (x86 を含む) Linux のほとんどのアーキテクチャーでは、 \fBgetdomainname\fP() というシステムコールは存在しない。 その代わり、glibc で \fBgetdomainname\fP() がライブラリ関数として実装されており、この関数は \fBuname\fP(2) の呼び出しで返された \fIdomainname\fP フィールドのコピーを返す。 .SH 関連項目 \fBgethostname\fP(2), \fBsethostname\fP(2), \fBuname\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。