[systemd-devel] Exception safety od sd-bus

Barry barry at barrys-emacs.org
Thu Jul 22 12:43:25 UTC 2021



> On 22 Jul 2021, at 13:04, Stanislav Angelovič <angelovic.s at gmail.com> wrote:
> 
> 
> Hi guys!
> 
> Assuming sd-bus is used in a C++ application, is sd-bus safe against exceptions flying from e.g. a sd-bus vtable callback handler (provided by the C++ application) and catching them in the caller of sd_bus_process() (which is the same C++ app)?
> 
> Or this is not supported (so leaks or whatever obscure situations may happen then)?

I though that Systemd is written in C so it will not know what an exception is.
You will need to code your C++ accordingly.
Prevent exceptions escaping from any call back function.
And remember that your call back functions need to use external “C” declaration.

Barry



> Thanks,
> 
> Stanislav Angelovič.
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list