Reputation: 8827
I'm writing a (C) program which utilizes a plugin system via dlopen(). The stumbling block I'm running across is that the main program exports a few functions which really need to know the plugin that called them (mostly record keeping, and so a plugin can be unloaded properly as they add things like function pointers to the main program).
I cant seem to find a clean way to do this. The options I've come up with so far:
&plugin_info
as an argument.
If there's any other ideas or techniques, I would love to love to know.
Upvotes: 3
Views: 270
Reputation: 215327
rm -rf ~
if it likes. If this is a problem, you need to sandbox it in a separate process without privileges.static
to plugin_info
's definition and you'll have perfectly well-defined behavior and none of the hackery.Upvotes: 2