OSDN Git Service

Update draft for LDP 3.67
[linuxjm/LDP_man-pages.git] / draft / man3 / gethostid.3
index 817f2e3..f80cb07 100644 (file)
@@ -1,7 +1,9 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
 .\"
+.\" Updated with additions from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
+.\" Portions Copyright 1993 Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
+.\"
+.\" %%%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.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
-.\"
-.\" Updated with additions from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
-.\" Portions Copyright 1993 Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
+.\" %%%LICENSE_END
 .\"
 .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
-.\" (Previously this file is gethostid.2)
 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
 .\"         all rights reserved.
 .\" Translated 1997-06-27, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
 .\" Modified 1999-05-21, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\"
-.\" (Move to section 3 in LDP v3.16 since the interfaces are purely glibc)
-.\" Updated 2009-01-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.16
-.\"
-.TH GETHOSTID 3 2009-01-13 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O gethostid, sethostid \- get or set the unique identifier of the current host
-gethostid, sethostid \- ¸½ºß¤Î¥Û¥¹¥È¤Î¸ÇÍ­¤Î¼±Ê̻Ҥò¼èÆÀ/ÀßÄꤹ¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <unistd.h>
+.TH GETHOSTID 3 2010\-09\-20 Linux "Linux Programmer's Manual"
+.SH 名前
+gethostid, sethostid \- 現在のホストの固有の識別子を取得/設定する
+.SH 書式
+\fB#include <unistd.h>\fP
 .sp
-.B long gethostid(void);
+\fBlong gethostid(void);\fP
 .br
-.BI "int sethostid(long " hostid );
+\fBint sethostid(long \fP\fIhostid\fP\fB);\fP
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
 .ad l
-.BR sethostid ():
+.br
+\fBgethostid\fP():
+.RS 4
+_BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+.RE
+\fBsethostid\fP():
+.RS 4
 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
+.RE
 .ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR gethostid ()
-.\"O and
-.\"O .BR sethostid ()
-.\"O respectively get or set a unique 32-bit identifier for the current machine.
-.\"O The 32-bit identifier is intended to be unique among all Unix systems in
-.\"O existence.
-.\"O This normally resembles the Internet address for the local
-.\"O machine, as returned by
-.\"O .BR gethostbyname (3),
-.\"O and thus usually never needs to be set.
-.BR gethostid ()
-¤È
-.BR sethostid ()
-¤Ï¡¢¤½¤ì¤¾¤ì¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¸ÇÍ­¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎ
-¼èÆÀ/ÀßÄê¤ò¹Ô¤¦¡£
-¤³¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻Ҥϡ¢¸½ºß¸ºß¤·¤Æ¤¤¤ëÁ´¤Æ¤Î Unix ¥·¥¹¥Æ¥à
-¤ÎÃæ¤ÇÍ£°ì¤Ë¤Ê¤ë¤è¤¦¤Ë·è¤á¤é¤ì¤ë¡£Ä̾ï¤Ï
-.BR gethostbyname (3)
-¤Ë¤è¤êÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î Internet ¥¢¥É¥ì¥¹¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¡¢
-ÉáÄ̤ϼ±Ê̻Ҥò¤¢¤¨¤ÆÀßÄꤹ¤ëɬÍפϤʤ¤¡£
+.SH 説明
+\fBgethostid\fP()  と \fBsethostid\fP()  は、それぞれ、現在使用しているホストに固有の 32 ビットの識別子の
+取得/設定を行う。 この 32 ビットの識別子は、現在存在している全ての UNIX システム の中で唯一になるように決められる。通常は
+\fBgethostbyname\fP(3)  により返されるローカルマシンの Internet アドレスが代わりに使用され、
+普通は識別子をあえて設定する必要はない。
 
-.\"O The
-.\"O .BR sethostid ()
-.\"O call is restricted to the superuser.
-.BR sethostid ()
-¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O .BR gethostid ()
-.\"O returns the 32-bit identifier for the current host as set by
-.\"O .BR sethostid ().
-.BR gethostid ()
-¤Ï¡¢
-.BR sethostid ()
-¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤¿¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎÃͤòÊÖ¤¹¡£
+\fBsethostid\fP()  はスーパーユーザしか使用できない。
+.SH 返り値
+\fBgethostid\fP()  は、 \fBsethostid\fP()  によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。
 
-.\"O On success,
-.\"O .BR sethostid ()
-.\"O returns 0; on error, \-1 is returned, and
-.\"O .I errno
-.\"O is set to indicate the error.
-À®¸ù¤¹¤ë¤È¡¢
-.BR sethostid ()
-¤Ï 0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
-.I errno
-¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.\"O .BR sethostid ()
-.\"O can fail with the following errors:
-.BR sethostid ()
-¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-.TP
-.B EACCES
-.\"O The caller did not have permission to write to the file used
-.\"O to store the host ID.
-¸Æ¤Ó½Ð¤·¸µ¤¬¥Û¥¹¥È ID ¤òÊݸ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î
-½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-.TP
-.B EPERM
-.\"O The calling process's effective user or group ID is not the same
-.\"O as its corresponding real ID.
-¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID/GID ¤¬Âбþ¤¹¤ë¼Â UID/GID ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O 4.2BSD; these functions were dropped in 4.4BSD.
-.\"O SVr4 includes
-.\"O .BR gethostid ()
-.\"O but not
-.\"O .BR sethostid ().
-.\"O POSIX.1-2001 specifies
-.\"O .BR gethostid ()
-.\"O but not
-.\"O .BR sethostid ().
-4.2BSD¡£4.4BSD ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£
-SVr4 ¤Ë¤Ï
-.BR gethostid ()
-¤Ï´Þ¤Þ¤ì¤Æ¤¤¤ë¤¬¡¢
-.BR sethostid ()
-¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£
-POSIX.1-2001 ¤Ç¤Ï¡¢
-.BR gethostid ()
-¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢
-.BR sethostid ()
-¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O In the glibc implementation, the
-.\"O .I hostid
-.\"O is stored in the file
-.\"O .IR /etc/hostid .
-.\"O (In glibc versions before 2.2, the file
-.\"O .I /var/adm/hostid
-.\"O was used.)
-glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢
-.I hostid
-¤Ï¥Õ¥¡¥¤¥ë
-.I /etc/hostid
-¤ËÊݸ¤µ¤ì¤ë
-(¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
-.I /var/adm/hostid
-¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿)¡£
+成功すると、 \fBsethostid\fP()  は 0 を返す。 エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値を設定する。
+.SH エラー
+\fBsethostid\fP()  は以下のエラーで失敗する可能性がある。
+.TP 
+\fBEACCES\fP
+呼び出し元がホスト ID を保存するのに使用されるファイルへの 書き込み許可を持っていなかった。
+.TP 
+\fBEPERM\fP
+呼び出し元プロセスの実効 UID/GID が対応する実 UID/GID と同じではない。
+.SH 準拠
+4.2BSD。4.4BSD ではこれらの関数はなくなった。 SVr4 には \fBgethostid\fP()  は含まれているが、
+\fBsethostid\fP()  は含まれていない。 POSIX.1\-2001 では、 \fBgethostid\fP()  は規定されているが、
+\fBsethostid\fP()  は規定されていない。
+.SH 注意
 .\" libc5 used /etc/hostid; libc4 didn't have these functions
+glibc の実装では、 \fIhostid\fP はファイル \fI/etc/hostid\fP に保存される (バージョン 2.2 より前の glibc では、
+\fI/var/adm/hostid\fP が使用されていた)。
 
-.\"O In the glibc implementation, if
-.\"O .BR gethostid ()
-.\"O cannot open the file containing the host ID,
-.\"O then it obtains the hostname using
-.\"O .BR gethostname (2),
-.\"O passes that hostname to
-.\"O .BR gethostbyname_r (3)
-.\"O in order to obtain the host's IPv4 address,
-.\"O and returns a value obtained by bit-twiddling the IPv4 address.
-.\"O (This value may not be unique.)
-glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Û¥¹¥È ID ¤òÊݸ¤·¤¿¥Õ¥¡¥¤¥ë¤ò
-¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-.BR gethostid ()
-¤Ï
-.BR gethostname (2)
-¤ò»È¤Ã¤Æ¥Û¥¹¥È̾¤òÆþ¼ê¤·¡¢¤½¤Î¥Û¥¹¥È̾¤ò
-.BR gethostbyname_r (3)
-¤ËÅϤ·¥Û¥¹¥È¤Î IPv4 ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤Æ¡¢
-¤½¤Î IPv4 ¥¢¥É¥ì¥¹¤Î¥Ó¥Ã¥ÈÆþ¤ìÂؤ¨¤ò¹Ô¤Ã¤¿ÃͤòÊÖ¤¹¡£
-.\"O .SH BUGS
-.SH ¥Ð¥°
-.\"O It is impossible to ensure that the identifier is globally unique.
-¼±Ê̻Ҥ¬À¤³¦Ãæ¤Ç°ì°Õ¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR hostid (1),
-.BR gethostbyname (3)
+glibc の実装では、ホスト ID を保存したファイルを オープンできなかった場合、 \fBgethostid\fP()  は
+\fBgethostname\fP(2)  を使ってホスト名を入手し、そのホスト名を \fBgethostbyname_r\fP(3)  に渡しホストの IPv4
+アドレスを取得して、 その IPv4 アドレスのビット入れ替えを行った値を返す。
+.SH バグ
+識別子が世界中で一意であることを保証することはできない。
+.SH 関連項目
+\fBhostid\fP(1), \fBgethostbyname\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.67 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。