This reference section lists all libkavclient error codes with their descriptions (as returned by kav_strerror), explains meanings of the errors and suggests possible steps you can take to correct the situation once an error occurred.
Failed to create a socket to connect to kavdaemon
Applies to kav_check_file, kav_check_files, kav_check_mem, kav_shmem_check
The system failed to create a socket. Examine the system errno value to find out why. This is a rare error, and if you see it, something is wrong with your system.
Failed to connect to kavdaemon
Applies to kav_check_file, kav_check_files, kav_check_mem, kav_shmem_check.
Connection to KAVDaemon failed. Examine the system errno value to find out why. The most likely reason for this error is that KAVDaemon is not running, or the path to KAVDaemon socket (as set by kav_set_socketpath) is incorrect (in that case errno will be set to ENOENT).
Check is already in progress
Applies to kav_check_file, kav_check_files, kav_check_mem, kav_shmem_check.
A check is already in progress in the given session context. This can only happen in a multi-threaded application when two threads call one of the checking functions in the same context concurrently.
Failed to write to kavdaemon
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
An error occured while sending the request ro KAVDaemon. Check the system errno value to find out what kind of error.
Error waiting for kavdaemon to respond
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
The request to KAVDaemon was succesfully sent, but some error occurred while waiting for reply. Check the system errno value to find out what kind of error. Note that libkavclient waits for reply using the system select function.
Timeout waiting for kavdaemon to respond
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
The request to KAVDaemon was succesfully sent, but no response was received from KAVDaemon. The amount of time that libkavclient waits before returning this error can be set by the kav_set_timeout function, and by default is 5 seconds.
Failed to read from kavdaemon
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
libkavclient started reading the reply from KAVDaemon, but some error occurred while reading. Check the system errno value to find out what kind of error.
Key file not found or expired
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
KAVDaemon was successfully contacted, but it failed to perform the requested check because it didn't find a valid key file. This means that you don't have a valid license to use KAVDaemon (remember, KAVDaemon is commercial software!). You should contact Kaspersky Lab.
Antivirus descriptions not found
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
KAVDaemon was successfully contacted, but it failed to perform the requested check because it couldn't find its virus definition bases. Either something is wrong with your KAVDaemon configuration, or you need to run kavupdater to download the virus definition bases.
Internal integrity was compromised
Applies to kav_check_file, kav_check_files, kav_shmem_check, kav_check_mem.
KAVDaemon was successfully contacted, but it failed to perform the requested check because it detected internal integrity violation. Most probably this means that your KAVDaemon binary is corrupt. You need to reinstall it.
Failed to get a key for shared memory
Applies kav_shmem_init, kav_check_mem.
This error means that the system function ftok failed. Most probably you passed an invalid keyfile parameter to kav_shmem_init, such as a non-existen or non-accessible file. If you encounter this error when calling kav_check_mem or when passing NULL for keyfile to kav_shmem_init, you have either run into a bug in libkavclient or your system is severely out of memory. Check the system errno value for additional information on why ftok failed.
Failed to create a keyfile for shared memory
Applies kav_shmem_init, kav_check_mem.
For some reason, libkavclient failed to create a temporary file, which is necessary to check memory regions. Examine the system errno value to find out why. If you encounter this error, you probably have run into a bug in libkavclient, or something is wrong with your system, such as /tmp directory is not writable.
Failed to allocate shared memory
Applies kav_shmem_init, kav_check_mem.
This error means that libkavclient failed to allocate a necessary amount of shared memory, which it needs to pass memory regions to KAVDaemon for checking. More technically, the system function shmget failed. Examine system errno value to find out why.
Failed to attach to shared memory segment
Applies kav_shmem_init, kav_check_mem.
This error means that libkavclient failed to attach to the shared memory segment it allocated in order to pass it to KAVDaemon for checking. More technically, the system function shmat failed. Examine system errno value to find out why. It must be either a bug in libkavclient, or your system is severely out of memory.
Shared memory operations were not initialized
Applies to kav_shmem_check
This error means that kav_shmem_check is called in a session context, in which kav_shmem_init wasn't called (or the call failed). You may only call kav_shmem_check after kav_shmem_init.
Request to check a shared memory segment larger then allocated size
Applies to kav_shmem_check.
This error means that kav_shmem_check was called with size larger than the size of the shared memory block previously created by kav_shmem_init. Check the size arguments of corresponding kav_shmem_init and kav_shmem_check calls - the latter must be less then or equal to the former.
Memory allocation failed
Applies to kav_check_file, kav_check_files, kav_shmem_init, kav_shmem_check, kav_check_mem.
Your system failed to allocate memory for libkavclient. Most probably you are out of memory.