,I;Berkeley DB Reference Guide: Simple Tutorial[P5

Berkeley DB Reference Guide: Simple Tutorial



#

Error returns



IThe Berkeley DB interfaces always return a value of 0 on success. If theCoperation does not succeed for any reason, the return value will be non-zero.

IIf a system error occurred (e.g., we ran out of disk space, or permissionGto access a file was denied to us, or an illegal argument was specifiedJto one of the interfaces), Berkeley DB returns an errno value. All:of the possible values of errno are greater than 0.

IIf the operation didn't fail due to a system error, but wasn't successfulMeither, Berkeley DB returns a special error value. For example, if you triedCto retrieve the data item associated with the key fruit, andIthere was no such key/data pair in the database, Berkeley DB would returnHDB_NOTFOUND, a special error value that means the requested key does notappear in the database.

QANÿÿ