
Roman Bogorodskiy wrote:
Michal Privoznik wrote:
On 21.03.2016 06:21, Roman Bogorodskiy wrote: While this would fix the build, it would disable the whole feature on freebsd. The problem is with the structure that is needed just for _nss_libvirt_gethostbyname4_r(). Should we change the code in that way that the function is built conditionally when the structure is present? That way we still could have _gethostbyname3_r() on systems providing the header file but not having the structure.
To tell the truth, I didn't look close at the nss implementation and wasn't sure if interfaces are compatible on Linux and FreeBSD for such type of things.
I'll take a look if I can use this plugin on FreeBSD if I just disable _nss_libvirt_gethostbyname4_r() related stuff.
Quick follow up on this: I tried the patch you posted on IRC (http://fpaste.org/343763/58660075/). As ALIGN is defined by system headers on FreeBSD, I just renamed it to LIBVIRT_ALIGN and got it compiled. However, trying to use it spawned an error like this: NSSWITCH(nss_load_module): libvirt, Undefined symbol "nss_module_register" Apparently, FreeBSD's nss layout requires some additional steps: defining an array of the methods provided and registering it with nss_module_register (at least that's what I understood after playing with that briefly). I hope I can bring this together before the next release. Roman Bogorodskiy