This is Info file g77-rtl.info, produced by Makeinfo version 1.67 from
the input file g77-rtl.texi.

   This file documents the user-callable routines in the GNU Fortran
runtime library for g77 version 0.5.18.


File: g77-rtl.info,  Node: Top,  Next: Copying,  Prev: (dir),  Up: (dir)

   This file documents the user-callable routines in the GNU Fortran
runtime library for g77 version 0.5.18.

* Menu:

* Copying::                     Copyright statement
* Introduction::
* Command line and exiting::
* Date and times::
* Numerical routines::
* Files and directories::
* Errors::
* Process Information::
* I/O::
* Miscellaneous::
* Concept index::
* Procedure index::


File: g77-rtl.info,  Node: Copying,  Next: Introduction,  Prev: Top,  Up: Top

Copying
*******

   Copyright (C) 1995, 1996 Free Software Foundation, Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "Copying" and "GNU General Public License"
are included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Free Software Foundation.


File: g77-rtl.info,  Node: Introduction,  Next: Command line and exiting,  Prev: Copying,  Up: Top

Introduction
************

   This manual provides minimal documentation for the user-callable
`internal' and `external' routines in the GNU Fortran runtime library.
Mostly these routines are just interfaces to POSIX or "traditional
Unix" ones expected to be found in the system's C library.  Thus their
semantics are explained in the C library documentation, referenced as
FOO`(N)' in `man' page style; if you are using the GNU C library,
consult the appropriate `info' nodes.  In some cases, where the C
library (or the operating system) is deficient, routines may not
actually be present in the GNU Fortran library.  Additionally, not all
the routines available in even the "traditional" collection have yet
been implemented.

   Beware that routines of these names are not implemented consistently
across Unix (and other) Fortran compilers and they are not all yet
intrinsics in GNU Fortran--the calling sequences may change when they
are, due to `g77''s conventions that functions should be
side-effect-free.  These versions mostly follow those from the SunPro
Fortran compiler for SunOS.  They are traditionally found in `libU77'
on BSD systems.  In some cases, where VMS Fortran has a different
calling sequence from the normal Unix variants, there is a version of
routine FOO called `vxt'FOO with the VMS calling sequence.  Some VMS
Fortran intrinsics are implemented here which are not normally in
libU77, such as `secnds'.  Also, a few Fortran90 intrinsics are
included.

   The routines `abort', `erf', `derf', `erfc', `derfc', `exit',
`flush', `fseek', `ftell', `getarg', `getenv', `iargc', `signal' and
`system' come from `f2c''s `libF77' library, written at ATT and
maintained by David Gay.

Layout conventions
==================

   The support in the TeXinfo package used to format this document isn't
ideal for documenting a Fortran library--it was designed for use with C
and Lisp.  The following layout is used.

   For each routine documented, there is a line with the routine name
followed by variable names representing its argument list (if any) and
then a right-justified description of the sort of routine, including its
return type (where appropriate).  Arguments enclosed in `[]' may be
omitted.  The sort may be `Subroutine', `Intrinsic integer function'
etc.  Following that, the types of the arguments are given and then a
description of the routine.  Sometimes two or more related routines are
documented together for convenience, with a line for each routine at the
start of the documentation, followed by the arguments' types.  Argument
types are given in Fortran90 style to include their `intent' (`in',
`out' or `inout').


File: g77-rtl.info,  Node: Command line and exiting,  Next: Date and times,  Prev: Introduction,  Up: Top

Command line and exiting
************************

 - Intrinsic subroutine: getarg N VALUE
          integer, intent(in):: N
          character*(*), intent(out)::  VALUE

     Sets VALUE to the N-th command-line argument (or to all blanks if
     there are fewer than N command-line arguments); `call
     getarg(0,VALUE)' sets VALUE to the name of the program (on systems
     that support this feature).  See `iargc' below.  In the `unix'
     intrinsics set.

 - Intrinsic subroutine: abort
     Prints a message and potentially causes a core dump via `abort(3)'.
     In the `unix' intrinsics set.

 - Intrinsic subroutine: exit [I]
          integer, intent(in):: I

     Exit the program with status I after closing open Fortran i/o
     units and otherwise behaving as `exit(2)'.  If I is omitted, the
     canonical `success' value will be returned to the system.  In the
     `unix' intrinsics set.

 - Intrinsic integer function: iargc ()
     Returns the number of command-line arguments.  In the `unix'
     intrinsics set.


File: g77-rtl.info,  Node: Date and times,  Next: Numerical routines,  Prev: Command line and exiting,  Up: Top

Date and times
**************

 - Character*24 function: ctime STIME
          integer, intent(in):: STIME

     Converts STIME, a system time value, such as returned by `time' to
     a character string of the form `Sat Aug 19 18:13:14 1995'.  See
     `ctime(3)'.

 - Subroutine:
          character, intent(out):: BUF

     Returns a string of the form `DD-MMM-YY', representing the numeric
     day of the month DD, a three-character abbreviation of the month
     name MMM and the last two digits of the year YY, e.g. `25-Nov-96'.

 - Real function: dtime TARRAY
 - Real function: etime TARRAY
          real, intent(out):: TARRAY(2)

     Return the runtime in seconds of the calling process as the
     function value and the user and system components of this in
     `tarray(1)' and `tarray(2)' respectively.  The functions' value is
     equal to `tarray(1) + tarray(2)'.  `etime' and the first call of
     `dtime' return times since the start of the process' execution;
     subsequent calls of `dtime' return values since the last time it
     was called.

 - Character*24 function: fdate
     Returns the date in the same format as `ctime', i.e.
            ftime () == ctime (time ())

 - Subroutine: gmtime STIME TARRAY
 - Subroutine: ltime STIME TARRAY
          integer, intent(in):: STIME
          integer, intent(out):: TARRAY(9)

     Given a system time value STIME, fills TARRAY with values
     extracted from it, either for local time (`ltime') or the GMT
     timezone (`gmtime') using `ltime(3)' and `gmtime(3)' respectively.
     The array elements are as follows:
       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
          seconds;

       2. Minutes after the hour, range 0-59;

       3. Hours past midnight, range 0-23;

       4. Day of month, range 0-31;

       5. Number of months since January, range 0-12;

       6. Number of days since Sunday, range 0-6;

       7. Years since 1900;

       8. Days since January 1;

       9. Daylight savings indicator: positive if daylight saving is in
          effect, zero if not, and negative if the informtion isn't
          available.
          See `gmtime(3)', `localtime(1)'.

 - Subroutine: idate TARRAY
          integer, intent(out):: TARRAY(3)

     Fills TARRAY with the numerical values of the current local time
     day, month (in the range 1-12) and year.  The year has four
     significant digits.

 - Subroutine: itime TARRAY
          integer, intent(out):: TARRAY(3)

     Returns the current local time hour, minute and second in elements
     of TARRAY in that order.

 - Integer function: mclock
     Returns the number of clock ticks since the start of the process.
     Only defined on systems with `clock(3)' (q.v.).

 - Real function: secnds T
          real, intent(in):: T

     Returns (as a real number) the local time in seconds since midnight
     minus the value T.  This is a VMS Fortran intrinsic.

 - Real function: second
     Returns the process' runtime in seconds--the same as `etime'
     returns.  This routine is known from Cray Fortran.

 - Subroutine: system_clock COUNT COUNT_RATE COUNT_MAX
          integer, intent(out):: COUNT, COUNT_RATE, COUNT_MAX

     Implements a version of the Fortran90 intrinsic (not normally in
     libU77).  COUNT returns the current value of the system clock;
     this is the value returned by `times(2)' here, but isn't in
     general.  COUNT_RATE is the number of clock ticks per second and
     COUNT_MAX is the maximum value this can take, which isn't very
     useful in this implementation since it's just the maximum C
     `unsigned int' value.

 - Integer function: time
     Returns the current time encoded as an integer in the manner of
     `time(3)'.  This value is suitable for passing to `ctime',
     `gmtime' and `ltime'.


File: g77-rtl.info,  Node: Numerical routines,  Next: Files and directories,  Prev: Date and times,  Up: Top

Numerical routines
******************

 - Real function: besj0 X
 - Real function: besj1 X
 - Real function: besjn N X
          real, intent(in):: X
          integer, intent(in):: n

     `besj0' and `besj1' return the Bessel function of X of the first
     kind of orders 0 and 1 respectively.  `besjn' is similar, for
     order N.  See `bessel(3m)', on whose implementation Bessel
     functions and the ones described below depend.  In the `unix'
     intrinsics set.

 - Real function: besy0 X
 - Real function: besy1 X
 - Real function: besyn N X
          real, intent(in):: X
          integer, intent(in):: n

     `besy0' and `besy1' return the Bessel function of X of the second
     kind of orders 0 and 1 respectively.  `besyn' is similar, for
     order N.  X must be positive.  In the `unix' intrinsics set.

 - Double Precision function: besj0 X
 - Double Precision function: besj1 X
 - Double Precision function: besjn N X
 - Double Precision function: besy0 X
 - Double Precision function: besy1 X
 - Double Precision function: besyn N X
          double precision, intent(in):: X
          integer, intent(in):: N

     These are double precision versions of their real counterparts
     described above.  In the `unix' intrinsics set.

 - Intrinsic real function: erf R
 - Intrinsic double precision function: derf D
          real, intent(in):: R
          double precision, intent(in):: D

     The real and double precision error functions respectively.  See
     `erf(3m)', on which these depend.  In the `unix' intrinsics set.

 - Intrinsic real function: erfc R
 - Intrinsic double precision function: derfc D
          real, intent(in):: R
          double precision, intent(in):: D

     The real and double precision complementary error functions
     respectively: `erfc(r) = 1 - erf(r)' and `derfc(d) = 1.d0 -
     derfc(d)' (except that their results may be more accurate than
     explicitly evaluating the above formulae would give). See
     `erfc(3M)', on which these depend.  In the `unix' intrinsics set.

 - Integer function: irand FLAG
 - Real function: rand FLAG
 - Subroutine: srand SEED
          integer, intent(in):: FLAG, SEED

     `irand' returns a uniform quasi-random number up to a
     system-dependent limit.  If FLAG is 0, the next number in sequence
     is returned; if FLAG is 1 the generator is restarted by calling
     `srand(0)'; if FLAG has any other value it is used as a new seed
     with `srand'.  `rand' is similar, but returns a real number
     between 0 and 1.  `srand' reinitialises the generator with the
     given SEED.  See `rand(3)', `srand(3)'.

     *Note that as typically implemented, this random number generator
     is a very poor one.*  You almost certainly want to use something
     better.


File: g77-rtl.info,  Node: Files and directories,  Next: Errors,  Prev: Numerical routines,  Up: Top

Files and directories
*********************

 - Integer function: access NAME MODE
          character*(*), intent(in):: NAME, MODE

     Checks file NAME for accessibility in the given MODE and returns 0
     if the file is accessible in that mode, otherwise an error code if
     the file is inaccessible or MODE is invalid.  See `access(2)'.
     MODE may be a concatenation of the characters
    `r'
          read permission

    `w'
          Write permission

    `x'
          executability

    `BLANK'
          existence

 - Integer function: chdir NAME
          character*(*), intent(in):: NAME

     Sets the current working directory to be NAME.  Returns 0 on
     success or an error code otherwise.  See `chdir(3)'.

 - Integer function: chmod NAME MODE
          character*(*), intent(in):: NAME, MODE

     Changes the access mode of file NAME according to the
     specification MODE, which is given in the format of `chmod(1)'.
     Returns 0 on success, and error code otherwise.  Note that this
     currently works by actually invoking `/bin/chmod' (or the `chmod'
     found when the library was configured) and so may fail in some
     circumstances.

 - Integer function: getcwd NAME
          character*(*), intent(out):: NAME

     Places the current working directory in NAME.  Returns 0 on
     success, otherwise an error number.

 - Integer function: fstat UNIT SARRAY
 - Integer function: sstat FILE SARRAY
 - Integer function: lstat FILE SARRAY
          integer, intent(in):: UNIT
          integer, intent(out):: SARRAY(13)
          character*(*), intent(in):: FILE

     `fstat' obtains data about the file open on Fortran i/o unit UNIT
     and places them in the array SARRAY.  The values in this array are
     extracted from the `stat' structure as returned by `fstat(2)'
     q.v., as follows:
       1. File mode;

       2. Inode number;

       3. ID of device containing directory entry for file;

       4. Device id (if relevant);

       5. Number of links;

       6. Owner's uid;

       7. Owner's gid;

       8. File size (bytes);

       9. Last access time;

      10. Last modification time;

      11. Last file status change time;

      12. Preferred i/o block size;

      13. Number of blocks allocated.
          Not all these elements are relevant on some systems, in which
     case they are returned as 0.

     `stat' is similar, except that it returns data on the named FILE.
     `lstat' is like `stat' except that if FILE is a symbolic link it
     returns data on the link itself; it is only available on systems
     which support symbolic links.

     The routines return 0 on success, otherwise an error number.

 - Integer function: link PATH1 PATH2
 - Integer function: symlnk PATH1 PATH2
          character*(*), intent(in):: PATH1, PATH2

     `link' makes a (hard) link from PATH1 to PATH2.  Returns 0 on
     success, an error code otherwise.  See `link(2)'.  `symlnk' is
     similar, but makes a symbolic link; it is only available on
     systems which support symbolic links (see `symlink(2)').

 - Integer function: rename PATH1 PATH2
          character*(*), intent(in):: PATH1, PATH2

     Renames the file PATH1 to PATH2.  See `rename(2)'.

 - Integer function: umask MASK
          integer, intent(in):: MASK

     Sets the file creation mask to MASK and returns the old value.
     See `umask(2)'.

 - Integer function: unlink PATH
          character*(*), intent(in):: PATH

     Unlink the file PATH.  See `unlink(2)'.


File: g77-rtl.info,  Node: Errors,  Next: Process Information,  Prev: Files and directories,  Up: Top

Errors
******

 - Subroutine: gerror MESSAGE
          character(*), intent(out):: MESSAGE

     Returns the system error message corresponding to the last system
     error (C `errno').

 - Integer function: ierrno
     Returns the last system error number (corresponding to the C
     `errno').

 - Subroutine: perror STR
          character*(*), intent(in):: STR

     Prints (on the C `stderr' stream) a newline-terminated error
     message corresponding to the last system error.  This is prefixed
     by STR, a colon and a space.  See `perror(3)'.


File: g77-rtl.info,  Node: Process Information,  Next: I/O,  Prev: Errors,  Up: Top

Process Information
*******************

 - Integer function: getgid
 - Integer function: getuid
 - Integer function: getpid
     `getgid', `getuid' and `getpid' return the group, user and process
     ids for the current process.

 - Intrinsic subroutine: getenv NAME VALUE
          character*(*), intent(in):: NAME
          character*(*), intent(out):: VALUE

     Sets VALUE to the value of environment variable NAME (`$name' in
     shell terms), or to blanks if `$name' has not been set.  In the
     `unix' intrinsics set.

 - Subroutine: getlog NAME
          character*(*), intent(out):: NAME

     Returns the login name for the process in NAME.

 - Integer function: hostnm NAME
          character*(*), intent(out):: NAME

     Fills NAME with the system's host name returned by
     `gethostname(2)'.  This function is not be available on all
     systems.


File: g77-rtl.info,  Node: I/O,  Next: Miscellaneous,  Prev: Process Information,  Up: Top

I/O
***

 - Integer function: fgetc UNIT C
 - Integer function: fget C
 - Integer function: fputc UNIT C
 - Integer function: fput C
          integer, intent(in):: UNIT
          character, intent(out):: C

     `fgetc' reads into C the next character from the file (stream)
     connected to the open Fortran i/o UNIT using `fgetc(3)', bypassing
     normal i/o processing.  Newline characters will be returned
     literally.  `fget' is similar except that it always uses unit 5.

     `fputc' writes C to the file (stream) connected to the open
     Fortran i/o UNIT using `fputc(3)', bypassing normal i/o
     processing.  `fput' is similar except that it always uses unit 6.
     A somewhat less efficient version of `fputc' can be written using
     normal i/o and the `$' format specifier.

     These routines return zero on success, otherwise a system error
     number or -1 for end-of-file.

     It is probably unwise to mix such stream-based i/o with normal
     record-based i/o on the same unit.  Anyway, you must obey the C
     rules concerning standard i/o, not switching between reading and
     writing without an intervening seek etc.  In fact it seems to be
     necessary actually to `close' and re-`open' the unit if you `fputc'
     to it and subsequently want to `fgetc'; this shouldn't be the case.

 - Intrinsic subroutine: flush [UNIT]
          integer, intent(in):: UNIT

     Flushes all the units currently open for output.  The optional
     argument is ignored since the runtime library currently contains
     no facility for flushing individual units.  In the `unix'
     intrinsics set.

 - Integer function: fnum UNIT
          integer, intent(in):: UNIT

     Returns the Unix file descriptor number corresponding to the open
     Fortran i/o UNIT.  This could be passed to an interface to C i/o
     routines.

 - Intrinsic subroutine: fseek UNIT OFFSET WHENCE *ERRLAB
          integer, intent(in):: UNIT, OFFSET, WHENCE

     Attempts to move Fortran unit UNIT to the specified OFFSET:
     absolute offset if WHENCE=0; relative to the current offset if
     WHENCE=1; relative to the end of the file if WHENCE=2.  It
     branches to label ERRLAB if UNIT is not open or if the call
     otherwise fails.  In the `unix' intrinsics set.

 - Integer function: ftell UNIT
          integer, intent(in):: UNIT

     Returns the current offset of Fortran unit UNIT (or -1 if UNIT is
     not open).  In the `unix' intrinsics set.

 - Logical function: isatty UNIT
          integer, intent(in):: UNIT

     Returns `.true.' iff the Fortran i/o unit is connected to a
     terminal device.  See `isatty(3)'.

 - Character*(*) function: ttynam UNIT
          integer, intent(in):: UNIT

     Returns the name of the terminal device open on logical unit UNIT
     or a blank string if UNIT is not connected to a terminal.


File: g77-rtl.info,  Node: Miscellaneous,  Next: Concept index,  Prev: I/O,  Up: Top

Miscellaneous
*************

 - Intrinsic subroutine: signal N FUNC
          integer, intent(in):: N
          external FUNC

     Arranges for FUNC to be invoked when signal N occurs.  This is of
     limited use since FUNC is called with C conventions.  In the
     `unix' intrinsics set.

 - Integer function: kill PID SIGNAL
          integer, intent(in):: PID, SIGNAL

     Sends the given SIGNAL to the process PID.  Returns zero on
     success, otherwise an error number.  See `kill(2)'.

 - Integer function: lnblnk STR
 - Integer function: len_trim STR
          character*(*), intent(in):: STR

     Returns the index of the last non-blank character in STR.
     `len_trim' is the name of the Fortran90 intrinsic with is function.

 - Subroutine: sleep T
          integer, intent(in):: T

     Causes the process to pause for T seconds.  See `sleep(2)'.

 - Intrinsic subroutine: system CMD [RET]
          character, intent(in):: CMD
          integer, intent(out):: RET

     Passes CMD to a shell (see `system(3').  If argument RET is
     present, it contains the value returned by `system(3)'.  In the
     `unix' intrinsics set.


File: g77-rtl.info,  Node: Concept index,  Next: Procedure index,  Prev: Miscellaneous,  Up: Top

Concept index
*************

* Menu:

* Bessel functions:                      Numerical routines.
* command line arguments:                Command line and exiting.
* conventions for layout:                Introduction.
* error function:                        Numerical routines.
* layout conventions:                    Introduction.
* random numbers:                        Numerical routines.
* stream i/o:                            I/O.


File: g77-rtl.info,  Node: Procedure index,  Prev: Concept index,  Up: Top

Procedure index
***************

* Menu:

* :                                      Date and times.
* abort:                                 Command line and exiting.
* access:                                Files and directories.
* besj0:                                 Numerical routines.
* besj1:                                 Numerical routines.
* besjn:                                 Numerical routines.
* besy0:                                 Numerical routines.
* besy1:                                 Numerical routines.
* besyn:                                 Numerical routines.
* chdir:                                 Files and directories.
* chmod:                                 Files and directories.
* ctime:                                 Date and times.
* derf:                                  Numerical routines.
* derfc:                                 Numerical routines.
* dtime:                                 Date and times.
* erf:                                   Numerical routines.
* erfc:                                  Numerical routines.
* etime:                                 Date and times.
* exit:                                  Command line and exiting.
* fdate:                                 Date and times.
* fget:                                  I/O.
* fgetc:                                 I/O.
* flush:                                 I/O.
* fnum:                                  I/O.
* fput:                                  I/O.
* fputc:                                 I/O.
* fseek:                                 I/O.
* fstat:                                 Files and directories.
* ftell:                                 I/O.
* gerror:                                Errors.
* getarg:                                Command line and exiting.
* getcwd:                                Files and directories.
* getenv:                                Process Information.
* getgid:                                Process Information.
* getlog:                                Process Information.
* getpid:                                Process Information.
* getuid:                                Process Information.
* gmtime:                                Date and times.
* hostnm:                                Process Information.
* iargc:                                 Command line and exiting.
* idate:                                 Date and times.
* ierrno:                                Errors.
* irand:                                 Numerical routines.
* isatty:                                I/O.
* itime:                                 Date and times.
* kill:                                  Miscellaneous.
* len_trim:                              Miscellaneous.
* link:                                  Files and directories.
* lnblnk:                                Miscellaneous.
* lstat:                                 Files and directories.
* ltime:                                 Date and times.
* mclock:                                Date and times.
* perror:                                Errors.
* rand:                                  Numerical routines.
* rename:                                Files and directories.
* secnds:                                Date and times.
* second:                                Date and times.
* signal:                                Miscellaneous.
* sleep:                                 Miscellaneous.
* srand:                                 Numerical routines.
* sstat:                                 Files and directories.
* symlnk:                                Files and directories.
* system:                                Miscellaneous.
* system_clock:                          Date and times.
* time:                                  Date and times.
* ttynam:                                I/O.
* umask:                                 Files and directories.
* unlink:                                Files and directories.



Tag Table:
Node: Top211
Node: Copying672
Node: Introduction1633
Node: Command line and exiting4393
Node: Date and times5540
Node: Numerical routines9482
Node: Files and directories12374
Node: Errors15992
Node: Process Information16654
Node: I/O17613
Node: Miscellaneous20566
Node: Concept index21803
Node: Procedure index22348

End Tag Table
