Next: , Previous: GMTime Intrinsic, Up: Table of Intrinsic Functions


8.11.9.127 HostNm Intrinsic (subroutine)

     CALL HostNm(Name, Status)

Name: CHARACTER; scalar; INTENT(OUT).

Status: INTEGER(KIND=1); OPTIONAL; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Fills Name with the system's host name returned by gethostname(2). If the Status argument is supplied, it contains 0 on success or a nonzero error code upon return (ENOSYS if the system does not provide gethostname(2)).

Some non-GNU implementations of Fortran provide this intrinsic as only a function, not as a subroutine, or do not support the (optional) Status argument.

On some systems (specifically SCO) it might be necessary to link the “socket” library if you call this routine. Typically this means adding `-lg2c -lsocket -lm' to the g77 command line when linking the program.

For information on other intrinsics with the same name: See HostNm Intrinsic (function).