[UP]


Manual Reference Pages  - system_gethostname (3)

NAME

system_gethostname(3f) - [M_system:QUERY] get name of current host (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine system_gethostname(string,ierr)

       character(len=:),allocatable,intent(out) :: NAME
       integer,intent(out)                      :: IERR

DESCRIPTION

The system_gethostname(3f) procedure returns the standard host name for the current machine.

OPTIONS

string returns the hostname. Must be an allocatable CHARACTER variable.
ierr Upon successful completion, 0 shall be returned; otherwise, -1 shall be returned.

EXAMPLE

Sample program:

   program demo_system_gethostname
   use M_system, only : system_gethostname
   implicit none
   character(len=:),allocatable :: name
   integer                      :: ierr
      call system_gethostname(name,ierr)
      if(ierr.eq.0)then
         write(*,’("hostname[",a,"]")’)name
      else
         write(*,’(a)’)’ERROR: could not get hostname’
      endif
   end program demo_system_gethostname

AUTHOR

John S. Urban

LICENSE

Public Domain


system_gethostname (3) March 11, 2021
Generated by manServer 1.08 from a789c3a7-5e1b-44d0-8c6c-757bf2b44b6f using man macros.