Updating shared libraries

I want to add functionality to PackageKit to detect when a new version of a shared library is installed, and there are applications still using the old version that no longer exists. We can then inform the user if they need to restart the computer or log off and back on if the library was updated for a security vulnerability.

Does anyone have any example code (preferably written in C, although I’m not that bothered) that I could use? I think this would be quite nice functionality in future versions of PackageKit.

Thanks.