dt, BT_CHARACTER, dc, REQUIRED);
add_sym_1s ("gerror", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
- gfc_check_gerror, NULL, gfc_resolve_gerror, c, BT_CHARACTER,
+ gfc_check_gerror, NULL, gfc_resolve_gerror, res, BT_CHARACTER,
dc, REQUIRED);
add_sym_2s ("getcwd", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
add_sym_2s ("ttynam", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ttynam_sub, NULL, gfc_resolve_ttynam_sub,
- ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED);
+ ut, BT_INTEGER, di, REQUIRED, name, BT_CHARACTER, dc, REQUIRED);
add_sym_2s ("umask", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_umask_sub, NULL, gfc_resolve_umask_sub,
* @code{FSEEK}: FSEEK, Low level file positioning subroutine
* @code{FSTAT}: FSTAT, Get file status
* @code{FTELL}: FTELL, Current stream position
+* @code{GERROR}: GERROR, Get last system error message
* @code{GETARG}: GETARG, Get command line arguments
* @code{GET_COMMAND}: GET_COMMAND, Get the entire command line
* @code{GET_COMMAND_ARGUMENT}: GET_COMMAND_ARGUMENT, Get command line arguments
* @code{INT}: INT, Convert to integer type
* @code{IOR}: IOR, Bitwise logical or
* @code{IRAND}: IRAND, Integer pseudo-random number
+* @code{ISATTY}: ISATTY, Whether a unit is a terminal device
* @code{ISHFT}: ISHFT, Shift bits
* @code{ISHFTC}: ISHFTC, Shift bits circularly
* @code{ITIME}: ITIME, Current local time (hour/minutes/seconds)
* @code{TRANSFER}: TRANSFER, Transfer bit patterns
* @code{TRANSPOSE}: TRANSPOSE, Transpose an array of rank two
* @code{TRIM}: TRIM, Function to remove trailing blank characters of a string
+* @code{TTYNAM}: TTYNAM, Get the name of a terminal device.
* @code{UBOUND}: UBOUND, Upper dimension bounds of an array
* @code{UMASK}: UMASK, Set the file creation mask
* @code{UNLINK}: UNLINK, Remove a file from the file system
GNU extension
@item @emph{Class}:
-non-elemental subroutine
+Non-elemental subroutine
@item @emph{Syntax}:
@code{CALL ABORT}
GNU extension
@item @emph{Class}:
-non-elemental subroutine
+Non-elemental subroutine
@item @emph{Syntax}:
@code{CALL FLUSH(UNIT)}
GNU extension
@item @emph{Class}:
-non-elemental function
+Non-elemental function
@item @emph{Syntax}:
@code{RESULT = FNUM(UNIT)}
+@node GERROR
+@section @code{GERROR} --- Get last system error message
+@cindex @code{GERROR} intrinsic
+
+@table @asis
+@item @emph{Description}:
+Returns the system error message corresponding to the last system error.
+This resembles the functionality of @code{strerror(3)} in C.
+
+@item @emph{Standard}:
+GNU extension
+
+@item @emph{Class}:
+Subroutine
+
+@item @emph{Syntax}:
+@code{CALL GERROR(RESULT)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{RESULT} @tab Shall of type @code{CHARACTER(*)}.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+PROGRAM test_gerror
+ CHARACTER(len=100) :: msg
+ CALL gerror(msg)
+ WRITE(*,*) msg
+END PROGRAM
+@end smallexample
+
+@item @emph{See also}:
+@ref{IERRNO}, @ref{PERROR}
+@end table
+
+
+
@node GETARG
@section @code{GETARG} --- Get command line arguments
@cindex @code{GETARG} intrinsic
GNU extension
@item @emph{Class}:
-non-elemental function
+Non-elemental function
@item @emph{Syntax}:
@code{RESULT = IRAND(FLAG)}
+@node ISATTY
+@section @code{ISATTY} --- Whether a unit is a terminal device.
+@cindex @code{ISATTY} intrinsic
+
+@table @asis
+@item @emph{Description}:
+Determine whether a unit is connected to a terminal device.
+
+@item @emph{Standard}:
+GNU extension.
+
+@item @emph{Class}:
+Non-elemental function.
+
+@item @emph{Syntax}:
+@code{RESULT = ISATTY(UNIT)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{UNIT} @tab Shall be a scalar @code{INTEGER(*)}.
+@end multitable
+
+@item @emph{Return value}:
+Returns @code{.TRUE.} if the @var{UNIT} is connected to a terminal
+device, @code{.FALSE.} otherwise.
+
+@item @emph{Example}:
+@smallexample
+PROGRAM test_isatty
+ INTEGER(kind=1) :: unit
+ DO unit = 1, 10
+ write(*,*) isatty(unit=unit)
+ END DO
+END PROGRAM
+@end smallexample
+@item @emph{See also}:
+@ref{TTYNAM}
+@end table
+
+
+
+
@node ISHFT
@section @code{ISHFT} --- Shift bits
@cindex @code{ISHFT} intrinsic
GNU extension
@item @emph{Class}:
-non-elemental function
+Non-elemental function
@item @emph{Syntax}:
@code{PTR = MALLOC(SIZE)}
GNU extension
@item @emph{Class}:
-subroutine, non-elemental function
+Subroutine, non-elemental function
@item @emph{Syntax}:
@multitable @columnfractions .80
GNU extension
@item @emph{Class}:
-non-elemental subroutine
+Non-elemental subroutine
@item @emph{Syntax}:
@code{CALL SRAND(SEED)}
+@node TTYNAM
+@section @code{TTYNAM} --- Get the name of a terminal device.
+@cindex @code{TTYNAM} intrinsic
+
+@table @asis
+@item @emph{Description}:
+Get the name of a terminal device. For more information,
+see @code{ttyname(3)}.
+
+This intrinsic is provided in both subroutine and function forms;
+however, only one form can be used in any given program unit.
+
+@item @emph{Standard}:
+GNU extension
+
+@item @emph{Class}:
+Subroutine, non-elemental function
+
+@item @emph{Syntax}:
+@multitable @columnfractions .80
+@item @code{CALL TTYNAM(UNIT, NAME)}
+@item @code{NAME = TTYNAM(UNIT)}
+@end multitable
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{UNIT} @tab Shall be a scalar @code{INTEGER(*)}.
+@item @var{NAME} @tab Shall be of type @code{CHARACTER(*)}.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+PROGRAM test_ttynam
+ INTEGER :: unit
+ DO unit = 1, 10
+ IF (isatty(unit=unit)) write(*,*) ttynam(unit)
+ END DO
+END PROGRAM
+@end smallexample
+
+@item @emph{See also}:
+@ref{ISATTY}
+@end table
+
+
+
@node UBOUND
@section @code{UBOUND} --- Upper dimension bounds of an array
@cindex @code{UBOUND} intrinsic