This example demonstrates use of static and dynamic libraries in KasperskyOS.
In the example, the Client program performs the following actions:
hello_s static library.hello_d1 dynamic library that is linked together with the program and loaded into memory when the process is started.hello_d2 dynamic library that is loaded into memory when calling the dlopen() function of the POSIX interface.To ensure that dynamic libraries can be shared among different processes, the system program named BlobContainer is included in the example.
The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.
Example files
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<version>/examples/shared_libs
Building and running example
See Building and running examples section.
To ensure that the shared_libs example will correctly run in Raspberry Pi, you must do the following after building the example and preparing your bootable SD card:
/lib directory on the bootable SD card if this directory doesn't already exist.build/hdd/lib directory that was generated when building the example and copy the directory contents to the /lib directory on the bootable SD card.