1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
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>
28 .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
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>
37 .TH GETHOSTID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
40 .\"O gethostid, sethostid \- get or set the unique identifier of the current host
41 gethostid, sethostid \- 現在使用しているホストに固有の識別子を取得する、または設定する
44 .B #include <unistd.h>
46 .B long gethostid(void);
48 .BI "int sethostid(long " hostid );
51 .\"O Feature Test Macro Requirements for glibc (see
52 .\"O .BR feature_test_macros (7)):
54 .RB ( feature_test_macros (7)
60 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
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
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 システム
75 によって返されるローカルマシンの Internet アドレスが代わりに使用され、
80 .\"O call is restricted to the superuser.
86 .\"O argument is stored in the file
87 .\"O .IR /etc/hostid .
93 .\"O .SH "RETURN VALUE"
96 .\"O returns the 32-bit identifier for the current host as set by
97 .\"O .BR sethostid ().
101 によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。
105 .\"O .SH "CONFORMING TO"
107 .\"O 4.2BSD; these functions were dropped in 4.4BSD.
109 .\"O .BR gethostid ()
111 .\"O .BR sethostid ().
112 .\"O POSIX.1-2001 specifies
113 .\"O .BR gethostid ()
115 .\"O .BR sethostid ().
116 4.2BSD。4.4BSD ではこれらの関数はなくなった。
129 .\"O In the glibc implementation, if
130 .\"O .BR gethostid ()
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.)
147 .BR gethostbyname_r (3)
148 に渡しホストの IPv4 アドレスを取得して、
149 その IPv4 アドレスのビット入れ替えを行った値を返す。
153 .BR gethostbyname (3)