On Thu, Feb 28, 2013 at 04:24:17PM +0000, Daniel P. Berrange wrote:
On Thu, Feb 28, 2013 at 04:16:37PM +0000, Daniel P. Berrange wrote:
[...]
Oh joy, it is worse than you could possibly imagine.
On libnl1 the return value is a valid -errno, while in libnl3
the return value is an error code of its own invention.
Further in libnl1 we can';t rely on the global errno, because
other calls libnl does may have overritten it with garbage.
We must use the return value from the function.
For yet more fun, libnl1's error handling is not threadsafe.
Whenever it hits an error with a syscall, it internally
runs __nl_error() which mallocs/frees a static global
variable containing the contents of strerror() which is
itself also not threadsafe :-(
Did I mention we should just throw out all versions of libnl
entirely and talk to the kernel ourselves..... It has caused
us no end of pain in all its versions.
No chance of educating them instead ? We can't rewrite everything :)
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | virtualization library
http://libvirt.org/