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 .\" (Previously this file is gethostid.2)
31 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
32 .\" all rights reserved.
33 .\" Translated 1997-06-27, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
34 .\" Modified 1999-05-21, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" (Move to section 3 in LDP v3.16 since the interfaces are purely glibc)
37 .\" Updated 2009-01-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.16
39 .TH GETHOSTID 3 2010-09-20 "Linux" "Linux Programmer's Manual"
41 gethostid, sethostid \- 現在のホストの固有の識別子を取得/設定する
43 .B #include <unistd.h>
45 .B long gethostid(void);
47 .BI "int sethostid(long " hostid );
51 .RB ( feature_test_macros (7)
59 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
60 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
64 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
71 は、それぞれ、現在使用しているホストに固有の 32 ビットの識別子の
73 この 32 ビットの識別子は、現在存在している全ての UNIX システム
76 により返されるローカルマシンの Internet アドレスが代わりに使用され、
85 によって設定された、現在使用しているホストの 32 ビットの識別子の値を返す。
98 呼び出し元がホスト ID を保存するのに使用されるファイルへの
102 呼び出し元プロセスの実効 UID/GID が対応する実 UID/GID と同じではない。
104 4.2BSD。4.4BSD ではこれらの関数はなくなった。
121 (バージョン 2.2 より前の glibc では、
124 .\" libc5 used /etc/hostid; libc4 didn't have these functions
126 glibc の実装では、ホスト ID を保存したファイルを
132 .BR gethostbyname_r (3)
133 に渡しホストの IPv4 アドレスを取得して、
134 その IPv4 アドレスのビット入れ替えを行った値を返す。
136 識別子が世界中で一意であることを保証することはできない。
139 .BR gethostbyname (3)