Sun Studio 12: Fortran ライブラリ・リファレンス

1.4.24 hostnm: 現在のホスト名の取得

関数は、次のように呼び出します。

INTEGER*4 hostnm

status = hostnm( name )

name

character*n

出力 

現在のホストの名前。n は、ホスト名が入るのに十分な大きさであることが必要

戻り値 

INTEGER*4

出力 

status=0: 正常

status>0: エラー

例: hostnm():


      INTEGER*4 hostnm, status
      character*8 name
      status = hostnm( name )
      write(*,*) 'ホスト名 = "', name, '"'
      end

参照: gethostname(2)