Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ISAM Error Handling

All ISAM functions return an error code value. Zero return indicates success otherwise, an error has occurred. Each call to an ISAM function sets the values of two global variables, and possibly a third:

  • isam_err - contains the error code value.
  • isam_fil - contains the data or index file number involved in the error.

Since each ISAM function can work with multiple files, check the value of isam_fil to see which file caused the error.

  • sysiocod - contains the system-level error code.

The global variable sysiocod is set to the value of errno when an I/O error occurs. errno is the C Language run-time error variable automatically maintained by the C runtime library. Unlike uerr_cod, sysiocod is NOT reset by new calls to c-tree. It is only set to errno if an open, create, seek, read, write, or lock function fails. The sysiocod value can be found in the compiler documentation or compiler errno.h file. When the following error values are returned, check sysiocod for a system error.

Symbolic Constant

Value

FNOP_ERR

12

DCRAT_ERR

17

SEEK_ERR

35

READ_ERR

36

WRITE_ERR

37

DLOK_ERR

42

TOCIndex