GDBM manual (split by section):   Section:   Chapter:FastBack: Variables   Up: Top   FastForward: Compatibility   Contents: Table of ContentsIndex: Index

19 Error codes

This chapter summarizes error codes which can be set by the functions in gdbm library.

GDBM_NO_ERROR

No error occurred.

GDBM_MALLOC_ERROR

Memory allocation failed. Not enough memory.

GDBM_BLOCK_SIZE_ERROR

This error is set by the gdbm_open function (see Open), if the value of its block_size argument is incorrect and the ‘GDBM_BSEXACT’ flag is set.

GDBM_FILE_OPEN_ERROR

The library was not able to open a disk file. This can be set by gdbm_open (see Open), gdbm_export and gdbm_import functions (see Flat files).

Inspect the value of the system errno variable to get more detailed diagnostics.

GDBM_FILE_WRITE_ERROR

Writing to a disk file failed. This can be set by gdbm_open (see Open), gdbm_export and gdbm_import functions.

Inspect the value of the system errno variable to get more detailed diagnostics.

GDBM_FILE_SEEK_ERROR

Positioning in a disk file failed. This can be set by gdbm_open (see Open) function.

Inspect the value of the system errno variable to get a more detailed diagnostics.

GDBM_FILE_READ_ERROR

Reading from a disk file failed. This can be set by gdbm_open (see Open), gdbm_export and gdbm_import functions.

Inspect the value of the system errno variable to get a more detailed diagnostics.

GDBM_BAD_MAGIC_NUMBER

The file given as argument to gdbm_open function is not a valid gdbm file: it has a wrong magic number.

GDBM_EMPTY_DATABASE

The file given as argument to gdbm_open function is not a valid gdbm file: it has zero length.

GDBM_CANT_BE_READER

This error code is set by the gdbm_open function if it is not able to lock file when called in ‘GDBM_READER’ mode (see GDBM_READER).

GDBM_CANT_BE_WRITER

This error code is set by the gdbm_open function if it is not able to lock file when called in writer mode (see Open).

GDBM_READER_CANT_DELETE

Set by the gdbm_delete (see Delete) if it attempted to operate on a database that is open in read-only mode (see GDBM_READER).

GDBM_READER_CANT_STORE

Set by the gdbm_store (see Store) if it attempted to operate on a database that is open in read-only mode (see GDBM_READER).

GDBM_READER_CANT_REORGANIZE

Set by the gdbm_reorganize (see Reorganization) if it attempted to operate on a database that is open in read-only mode (see GDBM_READER).

GDBM_ITEM_NOT_FOUND

Requested item was not found. This error is set by gdbm_delete (see Delete) and gdbm_fetch (see Fetch) when the requested key value is not found in the database.

GDBM_REORGANIZE_FAILED

The gdbm_reorganize function is not able to create a temporary database. See Reorganization.

GDBM_CANNOT_REPLACE

Cannot replace existing item. This error is set by the gdbm_store if the requested key value is found in the database and the flag parameter is not ‘GDBM_REPLACE’. See Store, for a detailed discussion.

GDBM_ILLEGAL_DATA

Either key or content parameter was wrong in a call to to gdbm_store (see Store).

GDBM_OPT_ALREADY_SET

Requested option can be set only once and was already set. This error is returned by the gdbm_setopt function. See GDBM_CACHESIZE.

GDBM_OPT_ILLEGAL

The option argument is not valid or the value argument points to an invalid value in a call to gdbm_setopt function. See Options.

GDBM_BYTE_SWAPPED

The gdbm_open function (see Open) attempts to open a database which is created on a machine with different byte ordering.

GDBM_BAD_FILE_OFFSET

The gdbm_open function (see Open) sets this error code if the file it tries to open has a wrong magic number.

GDBM_BAD_OPEN_FLAGS

Set by the gdbm_export function if supplied an invalid flags argument. See Flat files.

GDBM_FILE_STAT_ERROR

Getting information about a disk file failed. The system errno will give more details about the error.

This error can be set by the following functions: gdbm_open, gdbm_reorganize.

GDBM_FILE_EOF

End of file was encountered where more data was expected to be present. This error can occur when fetching data from the database and usually means that the database is truncated or otherwise corrupted.

This error can be set by any GDBM function that does I/O. Some of these functions are: gdbm_delete, gdbm_exists, gdbm_fetch, gdbm_export, gdbm_import, gdbm_reorganize, gdbm_firstkey, gdbm_nextkey, gdbm_store.

GDBM_NO_DBNAME

Output database name is not specified. This error code is set by gdbm_load (see gdbm_load) if the first argument points to ‘NULL’ and the input file does not specify the database name.

GDBM_ERR_FILE_OWNER

This error code is set by gdbm_load if it is unable to restore database file owner. It is a mild error condition, meaning that the data have been restored successfully, only changing the target file owner failed. Inspect the system errno variable to get a more detailed diagnostics.

GDBM_ERR_FILE_MODE

This error code is set by gdbm_load if it is unable to restore database file mode. It is a mild error condition, meaning that the data have been restored successfully, only changing the target file owner failed. Inspect the system errno variable to get a more detailed diagnostics.

GDBM_NEED_RECOVERY

Database is in inconsistent state and needs recovery. Call gdbm_recover if you get this error. See Recovery, for a detailed description of recovery functions.

GDBM_BACKUP_FAILED

The GDBM engine is unable to create backup copy of the file.

GDBM_DIR_OVERFLOW

Bucket directory would overflow the size limit during an attempt to split hash bucket. This error can occur while storing a new key.

GDBM manual (split by section):   Section:   Chapter:FastBack: Variables   Up: Top   FastForward: Compatibility   Contents: Table of ContentsIndex: Index