OSDN Git Service

(split) Convert contrib and obsolete pages to UTF-8.
[linuxjm/LDP_man-pages.git] / obsolete / man2 / gethostid.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 .\" Updated with additions from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
26 .\" Portions Copyright 1993 Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
27 .\"
28 .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
29 .\"
30 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
31 .\"         all rights reserved.
32 .\" Translated Fri Jun 27 10:04:58 JST 1997
33 .\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
34 .\" Modified Sun Mar 21 17:24:27 JST 1999
35 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\"
37 .TH GETHOSTID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .SH 名前
40 .\"O gethostid, sethostid \- get or set the unique identifier of the current host
41 gethostid, sethostid \- 現在使用しているホストに固有の識別子を取得する、または設定する
42 .\"O .SH SYNOPSIS
43 .SH 書式
44 .B #include <unistd.h>
45 .sp
46 .B long gethostid(void);
47 .br
48 .BI "int sethostid(long " hostid );
49 .sp
50 .in -4n
51 .\"O Feature Test Macro Requirements for glibc (see
52 .\"O .BR feature_test_macros (7)):
53 glibc 向けの機能検査マクロの要件
54 .RB ( feature_test_macros (7)
55 参照):
56 .in
57 .sp
58 .ad l
59 .BR sethostid ():
60 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
61 .ad b
62 .\"O .SH DESCRIPTION
63 .SH 説明
64 .\"O Get or set a unique 32-bit identifier for the current machine.
65 .\"O The 32-bit identifier is intended to be unique among all Unix systems in
66 .\"O existence.
67 .\"O This normally resembles the Internet address for the local
68 .\"O machine, as returned by
69 .\"O .BR gethostbyname (3),
70 .\"O and thus usually never needs to be set.
71 現在使用しているホストに固有の 32 ビットの識別子を取得/設定する。
72 この 32 ビットの識別子は現在存在している全ての Unix システム
73 の中で唯一になるように決められる。通常は
74 .BR gethostbyname (3)
75 によって返されるローカルマシンの Internet アドレスが代わりに使用され、
76 普通は識別子をあえて設定する必要はない。
77
78 .\"O The
79 .\"O .BR sethostid ()
80 .\"O call is restricted to the superuser.
81 .BR sethostid ()
82 はスーパーユーザしか使用できない。
83
84 .\"O The
85 .\"O .I hostid
86 .\"O argument is stored in the file
87 .\"O .IR /etc/hostid .
88 引き数
89 .I hostid
90
91 .I /etc/hostid
92 ファイルに格納される。
93 .\"O .SH "RETURN VALUE"
94 .SH 返り値
95 .\"O .BR gethostid ()
96 .\"O returns the 32-bit identifier for the current host as set by
97 .\"O .BR sethostid ().
98 .BR gethostid ()
99
100 .BR sethostid ()
101 によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。
102 .\"O .SH FILES
103 .SH ファイル
104 .I /etc/hostid
105 .\"O .SH "CONFORMING TO"
106 .SH 準拠
107 .\"O 4.2BSD; these functions were dropped in 4.4BSD.
108 .\"O SVr4 includes
109 .\"O .BR gethostid ()
110 .\"O but not
111 .\"O .BR sethostid ().
112 .\"O POSIX.1-2001 specifies
113 .\"O .BR gethostid ()
114 .\"O but not
115 .\"O .BR sethostid ().
116 4.2BSD。4.4BSD ではこれらの関数はなくなった。
117 SVr4 には
118 .BR gethostid ()
119 は含まれているが、
120 .BR sethostid ()
121 は含まれていない。
122 POSIX.1-2001 では、
123 .BR gethostid ()
124 は規定されているが、
125 .BR sethostid ()
126 は規定されていない。
127 .\"O .SH NOTES
128 .SH 注意
129 .\"O In the glibc implementation, if
130 .\"O .BR gethostid ()
131 .\"O cannot open
132 .\"O .IR /etc/hostid ,
133 .\"O then it obtains the hostname using
134 .\"O .BR gethostname (2),
135 .\"O passes that hostname to
136 .\"O .BR gethostbyname_r (3)
137 .\"O in order to obtain the host's IPv4 address,
138 .\"O and returns a value obtained by bit-twiddling the IPv4 address.
139 .\"O (This value may not be unique.)
140 glibc の実装では、
141 .I /etc/hostid
142 をオープンできなかった場合、
143 .BR gethostid ()
144
145 .BR gethostname (2)
146 を使ってホスト名を入手し、そのホスト名を
147 .BR gethostbyname_r (3)
148 に渡しホストの IPv4 アドレスを取得して、
149 その IPv4 アドレスのビット入れ替えを行った値を返す。
150 .\"O .SH "SEE ALSO"
151 .SH 関連項目
152 .BR hostid (1),
153 .BR gethostbyname (3)