kaveSetAutoReloadSignal

This function is only available on a Linux platform.

By default, KAV SDK registers a handler to intercept user-defined POSIX signals. These signals serve to KAV SDK as a request to reload malware definition database. Every time the KAV SDK receives a user-defined POSIX signal, it starts reloading malware definition database. Thus, sending either SIGUSR1 or SIGUSR2 to KAV SDK makes it to reload antivirus database.

Sometimes, you might need to leave one of the signals for your personal use and stick to its default behavior, terminate, when you work with KAV SDK. The kaveSetAutoReloadSignal allows you to redefine default behavior and specify what user-defined signal should be handled by KAV SDK as a reload request. when working in in-process or out-of-process integration modes. When KAV SDK works as a service, this signal is specified in the kavehost.xml configuration file.

To free a signal for your own use, you invoke kaveSetAutoReloadSignal and specify what user-defined signal will be allocated for use by KAV SDK. The constant passed to the kaveSetAutReloadSignal function will define the user signal to be handled by KAV SDK. Only this signal being sent to kavehost (or other hosting process depending on chosen hosting implementation, which is defined by dwScanningType parameter of KAV SDK initialization function) will be handled by KAV SDK. The other user-defined signal will be left over to your personal use.

Please make sure to include the signal.h header file (which is typically located at /usr/include/) into your project file prior to using the kaveSetAutoReloadSignal function. This is necessary to properly translate signal constant names specified at the function’s input into their values. The SIGUSR1 and SIGUSR2 signal constants are defined within the signum.h header file included in the signal.h and typically located at /usr/include/bits.

The recommended frequency for sending user defined signals: less than once per minute.

When KAV Engine runs in service mode (the dwScannerHostType parameter of an initialization function such as kaveInitializeEx is set to KAV_SHT_SERVICE), you can make KAV Engine to reload malware definitions database by using the kavehost.sh init script for kavehost service. To reload the definitions, run kavehost.sh reloaddb in the terminal. After that you can proceed with updated definitions within the same scanning session.

If the engine is running in the in-process (dwScannerHostType set to KAV_SHT_INPROC) or out-of-process mode (dwScannerHostType set to KAV_SHT_OUTPROC), to load updated malware definition you can either call kaveReloadDatabases function or send any of the two user signals, SIGUSR1 or SIGUSR2, whatever approach matches your needs best. When you choose the latter option, make sure to turn on automatic database reloading by calling the kaveEnableAutoReload function and turning the bEnable boolean parameter to TRUE.

You can check if autoreloading is turned on in KAV SDK by invoking kaveIsEnabledAutoreload function and checking value passed by pbEnabled reference.

Syntax

HRESULT kaveSetAutoReloadSignal (

int nBasesReloadSignal);

Parameters

The kaveSetAutoReloadSignal function has the following parameters.

kaveSetAutoReloadSignal function parameters

Name

Type

Description

nBasesReloadSignal

in

A user-defined signal to be handled by KAV SDK as a request to reload malware definition database.

You must specify the user-defined signal as defined in the signum.h header file.

Make sure to include the signal.h file into your project.

Return value

If the kaveSetAutoReloadSignal function succeeds, its return value is S_OK.

For other return codes, see section "Return codes".

Page top