pxfctermid

Date:

10-20-2011

NAME

PXFCTERMID - Generates terminal pathname

SYNOPSIS

SUBROUTINE PXFCTERMID(s, ilen, ierror)
CHARACTER*n s
INTEGER ilen, ierror

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE standard interface for FORTRAN 77

DESCRIPTION

The PXFCTERMID subroutine uses the ctermid function to generate a string which is the pathname for the current process’ controlling terminal. If the pathname for the controlling terminal cannot be determined, the ilen variable is set to zero.

When using the Cray Fortran compiler, all arguments must be of default kind unless documented otherwise. The default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this subroutine:

s

An output character array or character element variable for the pathname for the current process’ controlling terminal. The maximum length of s is defined by the L_ctermid constant found in <stdio.h>.

ilen

An output interger variable for the length of s.

ierror

An output integer variable for the completion status of PXFCTERMID. ierror may contain zero if PXFCTERMID was successful or nonzero if PXFCTERMID was not successful.

PXFCTERMID may return the ETRUNC error value if the output variable s cannot contain the pathname for the current process’ controlling terminal, causing the pathname to be truncated.

EXAMPLES

program pxftest
integer ilen, ierror
character*20 s
CALL PXFCTERMID(s,ilen,ierror)
print *,'controlling terminal is ',s
end

SEE ALSO

ctermid(3c)