[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
18 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 section Opening the database.), if the value of its block_size argument is incorrect.- GDBM_FILE_OPEN_ERROR
The library was not able to open a disk file. This can be set by
gdbm_open
(see section Opening the database.),gdbm_export
andgdbm_import
functions (see section Export and Import).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 section Opening the database.),gdbm_export
andgdbm_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 section Opening the database.) 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 section Opening the database.),gdbm_export
andgdbm_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 validgdbm
file: it has a wrong magic number.- GDBM_EMPTY_DATABASE
The file given as argument to
gdbm_open
function is not a validgdbm
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 section 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 section Opening the database.).- GDBM_READER_CANT_DELETE
Set by the
gdbm_delete
(see section Removing records from the database.) if it attempted to operate on a database that is open in read-only mode (see section GDBM_READER).- GDBM_READER_CANT_STORE
Set by the
gdbm_store
(see section Inserting and replacing records in the database.) if it attempted to operate on a database that is open in read-only mode (see section GDBM_READER).- GDBM_READER_CANT_REORGANIZE
Set by the
gdbm_reorganize
(see section Database reorganization.) if it attempted to operate on a database that is open in read-only mode (see section GDBM_READER).- GDBM_UNKNOWN_UPDATE
Currently unused. Reserved for future uses.
- GDBM_ITEM_NOT_FOUND
Requested item was not found. This error is set by
gdbm_delete
(see section Removing records from the database.) andgdbm_fetch
(see section Searching for records in the database.) 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 section Database 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 section Inserting and replacing records in the database., for a detailed discussion.- GDBM_ILLEGAL_DATA
Either key or content parameter was wrong in a call to to
gdbm_store
(see section Inserting and replacing records in the database.).- 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 section 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 section Setting options.- GDBM_BYTE_SWAPPED
The
gdbm_open
function (see section Opening the database.) attempts to open a database which is created on a machine with different byte ordering.- GDBM_BAD_FILE_OFFSET
The
gdbm_open
function (see section Opening the database.) 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 section Export and Import.- 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 systemerrno
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 systemerrno
variable to get a more detailed diagnostics.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on January 24, 2014 using texi2html 5.0.