OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / draft / man2 / gethostname.2
diff --git a/draft/man2/gethostname.2 b/draft/man2/gethostname.2
deleted file mode 100644 (file)
index 1e9a714..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-.\" 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 1995-07-22 by Michael Chastain <mec@duracef.shout.net>:
-.\"   'gethostname' is real system call on Linux/Alpha.
-.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
-.\" Modified 2000-06-04, 2001-12-15 by aeb
-.\" Modified 2004-06-17 by mtk
-.\" 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 <suto@av.crl.sony.co.jp>
-.\" Updated 2000-09-30, Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
-.\" Updated & Modified 2002-01-14, Yuichi SATO <ysato@h4.dion.ne.jp>
-.\" Updated & Modified 2004-12-30, Yuichi SATO <ysato444@yahoo.co.jp>
-.\" Updated & Modified 2006-01-31, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.15
-.\"
-.TH GETHOSTNAME 2 2014\-08\-19 Linux "Linux Programmer's Manual"
-.SH 名前
-gethostname, sethostname \- ホスト名の取得・設定をする
-.SH 書式
-\fB#include <unistd.h>\fP
-.sp
-\fBint gethostname(char *\fP\fIname\fP\fB, size_t \fP\fIlen\fP\fB);\fP
-.br
-\fBint sethostname(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
-.PD 0
-\fBgethostname\fP():
-.RS 4
-glibc 2.12 以降: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
-.br
-|| /* glibc 2.12 以降: */ _POSIX_C_SOURCE\ >=\ 200112L
-.RE
-.br
-\fBsethostname\fP():
-.RS 4
-_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
-.RE
-.PD
-.ad
-.SH 説明
-これらのシステムコールは、現在のプロセッサのホスト名を取得・変更するために 使用される。
-
-\fBsethostname\fP()  は、ホスト名を、文字配列 \fIname\fP で指定された値に設定する。 引き数 \fIlen\fP には、 \fIname\fP
-のバイト数を指定する (そのため、 \fIname\fP では文字列終端のヌルバイトは必要ない)。
-
-\fBgethostname\fP()  は、NULL 終端されたホスト名を、 \fIlen\fP バイトの長さの文字配列 \fIname\fP
-に格納して返す。ヌル終端されたホスト名が格納先のバッファーよりも長い場合は、 ホスト名は切り詰められ、エラーは返されない (下記の「注意」の節を参照)。
-POSIX.1\-2001 では、結果の切り詰めが発生した場合に、 返されたバッファーに終端のヌルバイトが含まれているかどうかは 規定されていない。
-.SH 返り値
-成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
-.SH エラー
-.TP 
-\fBEFAULT\fP
-\fIname\fP が不正なアドレスである。
-.TP 
-\fBEINVAL\fP
-.\" Can't occur for gethostbyname() wrapper, since 'len' has an
-.\" unsigned type; can occur for the underlying system call.
-\fIlen\fP が負である。 \fBsethostname\fP()  において \fIlen\fP が許容された最大サイズを越えている。
-.TP 
-\fBENAMETOOLONG\fP
-(glibc \fBgethostname\fP()  で)  \fIlen\fP が実際のホスト名の長さよりも小さい (glibc バージョン 2.1
-より前では、この状況で \fBEINVAL\fP が使用される)。
-.TP 
-\fBEPERM\fP
-\fBsethostname\fP()  において、呼び出した人が \fBCAP_SYS_ADMIN\fP ケーパビリティ (capability)
-を持っていなかった。
-.SH 準拠
-SVr4, 4.4BSD (これらのインターフェースは 4.2BSD で初めて登場した)。 POSIX.1\-2001 では
-\fBgethostname\fP()  については規定しているが、 \fBsethostname\fP()  は規定していない。
-.SH 注意
-SUSv2 では「ホスト名が 255 バイトに制限される」ことを保証している。 POSIX.1\-2001 では「ホスト名 (終端のヌルバイトは含まない)
-が \fBHOST_NAME_MAX\fP バイトに制限される」ことを保証している。 Linux では、 \fBHOST_NAME_MAX\fP は 64
-に定義されており、 Linux 1.0 以降ではこれが上限となってきた (もっと古いカーネルでは 8 バイトの上限が適用されていた)。
-.SS "C ライブラリとカーネル ABI の違い"
-GNU C ライブラリは、 \fBgethostname\fP()  システムコールを利用していない。その代わり、 \fBgethostname\fP()
-をライブラリ関数として実装しており、 この関数は \fBuname\fP(2)  を呼び出し、 \fBuname\fP(2)  が返した \fInodename\fP
-フィールド (の最大 \fIlen\fP バイト) を \fIname\fP にコピーする。 コピーを行った際に、この関数は \fInodename\fP の長さが
-\fIlen\fP 以上かの確認を行い、 \fIlen\fP 以上の場合には \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。
-この場合、返された \fIname\fP には終端のヌルバイトは含まれない。
-
-.\" At least glibc 2.0 and 2.1, older versions not checked
-バージョン 2.2 より前の glibc では、 \fInodename\fP の長さが \fIlen\fP 以上の場合の扱いが異なる; \fIlen\fP
-以上の場合には、 \fIname\fP には何もコピーせず、関数は \-1 を返し、 \fIerrno\fP に \fBENAMETOOLONG\fP を設定する。
-.SH 関連項目
-\fBgetdomainname\fP(2), \fBsetdomainname\fP(2), \fBuname\fP(2)
-.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。