Unix-system-calls-gethostid

提供:Dev Guides
移動先:案内検索

[top]#

|http://www.google.com/[Google] | a|

Web This Site
  • 初心者向けのUnix *
  • 高度なUnix *

選択した読書

Copyright©2014 by finddevguides

[cols=",,,,,,,",]

| |  Home   | |  References   | |  Discussion Forums   | |  About TP  

[width="100%",cols="100%",]

a| == gethostid()-Unix、Linuxシステムコール

[[File:]] image :http://www.finddevguides.com/images/next.gif [next] image:http://www.finddevguides.com/add- this.gif [AddThisソーシャルブックマークボタン]

広告

NAME

gethostid、sethostid-現在のホストの一意の識別子を取得または設定します

概要

  • #include <unistd.h> *
*long gethostid(void);*  *int sethostid(long* __hostid __ **); **

説明

現在のマシンの一意の32ビット識別子を取得または設定します。 32ビットの識別子は、存在するすべてのUNIXシステムの中で一意であることを意図しています。 これは通常、 gethostbyname (3)によって返されるローカルマシンのインターネットアドレスに似ているため、通常は設定する必要はありません。

*sethostid* ()呼び出しはスーパーユーザーに制限されています。

hostid_引数は、ファイル/etc/hostid_に保存されます。

返り値

*gethostid* ()は、 *sethostid* (2)で設定された現在のホストの32ビット識別子を返します。

準拠

4.2BSD;これらの関数は4.4BSDで削除されました。 SVr4には gethostid ()が含まれますが、 sethostid ()は含まれません。 POSIX.1-2001は gethostid ()を指定しますが、 sethostid ()は指定しません。

ファイル

/etc/hostid

id = gethostid (); /*This is a no-op unless unsigned int is wider than 32 bits. */ id &= 0xffffffff;

関連項目

[[File:]] image :http://www.finddevguides.com/images/next.gif [next] [[File:]]

広告

|  

[cols="^",]

|Advertisements