OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / gethostid.3
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 .\" (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>
35 .\"
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
38 .\"
39 .TH GETHOSTID 3 2009-01-13 "Linux" "Linux Programmer's Manual"
40 .\"O .SH NAME
41 .SH Ì¾Á°
42 .\"O gethostid, sethostid \- get or set the unique identifier of the current host
43 gethostid, sethostid \- ¸½ºß¤Î¥Û¥¹¥È¤Î¸ÇÍ­¤Î¼±Ê̻Ҥò¼èÆÀ/ÀßÄꤹ¤ë
44 .\"O .SH SYNOPSIS
45 .SH ½ñ¼°
46 .B #include <unistd.h>
47 .sp
48 .B long gethostid(void);
49 .br
50 .BI "int sethostid(long " hostid );
51 .sp
52 .in -4n
53 .\"O Feature Test Macro Requirements for glibc (see
54 .\"O .BR feature_test_macros (7)):
55 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
56 .RB ( feature_test_macros (7)
57 »²¾È):
58 .in
59 .sp
60 .ad l
61 .BR sethostid ():
62 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
63 .ad b
64 .\"O .SH DESCRIPTION
65 .SH ÀâÌÀ
66 .\"O .BR gethostid ()
67 .\"O and
68 .\"O .BR sethostid ()
69 .\"O respectively get or set a unique 32-bit identifier for the current machine.
70 .\"O The 32-bit identifier is intended to be unique among all Unix systems in
71 .\"O existence.
72 .\"O This normally resembles the Internet address for the local
73 .\"O machine, as returned by
74 .\"O .BR gethostbyname (3),
75 .\"O and thus usually never needs to be set.
76 .BR gethostid ()
77 ¤È
78 .BR sethostid ()
79 ¤Ï¡¢¤½¤ì¤¾¤ì¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¸ÇÍ­¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎ
80 ¼èÆÀ/ÀßÄê¤ò¹Ô¤¦¡£
81 ¤³¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻Ҥϡ¢¸½ºß¸ºß¤·¤Æ¤¤¤ëÁ´¤Æ¤Î Unix ¥·¥¹¥Æ¥à
82 ¤ÎÃæ¤ÇÍ£°ì¤Ë¤Ê¤ë¤è¤¦¤Ë·è¤á¤é¤ì¤ë¡£Ä̾ï¤Ï
83 .BR gethostbyname (3)
84 ¤Ë¤è¤êÊÖ¤µ¤ì¤ë¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î Internet ¥¢¥É¥ì¥¹¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¡¢
85 ÉáÄ̤ϼ±Ê̻Ҥò¤¢¤¨¤ÆÀßÄꤹ¤ëɬÍפϤʤ¤¡£
86
87 .\"O The
88 .\"O .BR sethostid ()
89 .\"O call is restricted to the superuser.
90 .BR sethostid ()
91 ¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¤·¤«»ÈÍѤǤ­¤Ê¤¤¡£
92 .\"O .SH "RETURN VALUE"
93 .SH ÊÖ¤êÃÍ
94 .\"O .BR gethostid ()
95 .\"O returns the 32-bit identifier for the current host as set by
96 .\"O .BR sethostid ().
97 .BR gethostid ()
98 ¤Ï¡¢
99 .BR sethostid ()
100 ¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤¿¡¢¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Û¥¹¥È¤Î 32 ¥Ó¥Ã¥È¤Î¼±Ê̻ҤÎÃͤòÊÖ¤¹¡£
101
102 .\"O On success,
103 .\"O .BR sethostid ()
104 .\"O returns 0; on error, \-1 is returned, and
105 .\"O .I errno
106 .\"O is set to indicate the error.
107 À®¸ù¤¹¤ë¤È¡¢
108 .BR sethostid ()
109 ¤Ï 0 ¤òÊÖ¤¹¡£
110 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
111 .I errno
112 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
113 .\"O .SH ERRORS
114 .SH ¥¨¥é¡¼
115 .\"O .BR sethostid ()
116 .\"O can fail with the following errors:
117 .BR sethostid ()
118 ¤Ï°Ê²¼¤Î¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
119 .TP
120 .B EACCES
121 .\"O The caller did not have permission to write to the file used
122 .\"O to store the host ID.
123 ¸Æ¤Ó½Ð¤·¸µ¤¬¥Û¥¹¥È ID ¤òÊݸ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î
124 ½ñ¤­¹þ¤ßµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
125 .TP
126 .B EPERM
127 .\"O The calling process's effective user or group ID is not the same
128 .\"O as its corresponding real ID.
129 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¸ú UID/GID ¤¬Âбþ¤¹¤ë¼Â UID/GID ¤ÈƱ¤¸¤Ç¤Ï¤Ê¤¤¡£
130 .\"O .SH "CONFORMING TO"
131 .SH ½àµò
132 .\"O 4.2BSD; these functions were dropped in 4.4BSD.
133 .\"O SVr4 includes
134 .\"O .BR gethostid ()
135 .\"O but not
136 .\"O .BR sethostid ().
137 .\"O POSIX.1-2001 specifies
138 .\"O .BR gethostid ()
139 .\"O but not
140 .\"O .BR sethostid ().
141 4.2BSD¡£4.4BSD ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£
142 SVr4 ¤Ë¤Ï
143 .BR gethostid ()
144 ¤Ï´Þ¤Þ¤ì¤Æ¤¤¤ë¤¬¡¢
145 .BR sethostid ()
146 ¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£
147 POSIX.1-2001 ¤Ç¤Ï¡¢
148 .BR gethostid ()
149 ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢
150 .BR sethostid ()
151 ¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
152 .\"O .SH NOTES
153 .SH Ãí°Õ
154 .\"O In the glibc implementation, the
155 .\"O .I hostid
156 .\"O is stored in the file
157 .\"O .IR /etc/hostid .
158 .\"O (In glibc versions before 2.2, the file
159 .\"O .I /var/adm/hostid
160 .\"O was used.)
161 glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢
162 .I hostid
163 ¤Ï¥Õ¥¡¥¤¥ë
164 .I /etc/hostid
165 ¤ËÊݸ¤µ¤ì¤ë
166 (¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
167 .I /var/adm/hostid
168 ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤¿)¡£
169 .\" libc5 used /etc/hostid; libc4 didn't have these functions
170
171 .\"O In the glibc implementation, if
172 .\"O .BR gethostid ()
173 .\"O cannot open the file containing the host ID,
174 .\"O then it obtains the hostname using
175 .\"O .BR gethostname (2),
176 .\"O passes that hostname to
177 .\"O .BR gethostbyname_r (3)
178 .\"O in order to obtain the host's IPv4 address,
179 .\"O and returns a value obtained by bit-twiddling the IPv4 address.
180 .\"O (This value may not be unique.)
181 glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢¥Û¥¹¥È ID ¤òÊݸ¤·¤¿¥Õ¥¡¥¤¥ë¤ò
182 ¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
183 .BR gethostid ()
184 ¤Ï
185 .BR gethostname (2)
186 ¤ò»È¤Ã¤Æ¥Û¥¹¥È̾¤òÆþ¼ê¤·¡¢¤½¤Î¥Û¥¹¥È̾¤ò
187 .BR gethostbyname_r (3)
188 ¤ËÅϤ·¥Û¥¹¥È¤Î IPv4 ¥¢¥É¥ì¥¹¤ò¼èÆÀ¤·¤Æ¡¢
189 ¤½¤Î IPv4 ¥¢¥É¥ì¥¹¤Î¥Ó¥Ã¥ÈÆþ¤ìÂؤ¨¤ò¹Ô¤Ã¤¿ÃͤòÊÖ¤¹¡£
190 .\"O .SH BUGS
191 .SH ¥Ð¥°
192 .\"O It is impossible to ensure that the identifier is globally unique.
193 ¼±Ê̻Ҥ¬À¤³¦Ãæ¤Ç°ì°Õ¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
194 .\"O .SH "SEE ALSO"
195 .SH ´ØÏ¢¹àÌÜ
196 .BR hostid (1),
197 .BR gethostbyname (3)