Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ERRSNS

Intrinsic Subroutine (Generic): Returns information about the most recently detected I/O system error condition. Intrinsic subroutines cannot be passed as actual arguments.

CALL ERRSNS ([io_err] [,sys_err] [,stat] [,unit] [,cond])

io_err

(Output; Optional) Is an integer variable or array element that stores the most recent Runtime Library error number that occurred during program execution. For a listing of error numbers, see Error Handling.

A zero indicates no error has occurred since the last call to ERRSNS or since the start of program execution.

sys_err

(Output; Optional) Is an integer variable or array element that stores the most recent system error number associated with io_err. This code is one of the following:

  • Linux

    It is an errno value. (See errno(2).)

  • Windows

    It is the value returned by GETLASTERROR( ) at the time of the error.

stat

(Output; Optional) Is an integer variable or array element that stores a status value that occurred during program execution. This value is always set to zero.

unit

(Output; Optional) Is an integer variable or array element that stores the logical unit number, if the last error was an I/O error.

cond

(Output; Optional) Is an integer variable or array element that stores the actual processor value. This value is always set to zero.

If you specify INTEGER(2) arguments, only the low-order 16 bits of information are returned or adjacent data can be overwritten. Because of this, it is best to use INTEGER(4) arguments.

The saved error information is set to zero after each call to ERRSNS.

Example

Any of the arguments can be omitted. For example, the following is valid:

CALL ERRSNS (SYS_ERR=I1, STAT=I2, UNIT=I4)