|
HOME > Linux Tips ( 目次 ) > Linux コマンド 一覧表 > b > byteorder - ライブラリコールの説明 byteorder - ライブラリコールの説明 - Linux コマンド集 一覧表名前htonl, htons, ntohl, ntohs - ホストバイトオーダーとネットワークバイトオーダーの間で値を変換する 書式
#include <arpa/inet.h> 説明htonl () 関数は unsigned integer hostlong を ホストバイトオーダーからネットワークバイトオーダーに変換する。 htons () 関数は unsigned short integer hostshort を ホストバイトオーダーからネットワークバイトオーダーに変換する。 ntohl () 関数は unsigned integer netlong を ネットワークバイトオーダーからホストバイトオーダーに変換する。 ntohs () 関数は unsigned short integer netshort を ネットワークバイトオーダーからホストバイトオーダーに変換する。 i80x86 のホストバイトオーダーでは最下位バイトが若いアドレスに配置されるが、 インターネットで用いられるネットワークバイトオーダーでは最上位バイト が先に配置される。 準拠
POSIX.1-2001.
関連項目
|
|