bsdci / libioc

A Python library to manage jails with ioc{age,ell}
https://bsd.ci/libioc
Other
38 stars 11 forks source link

use ctypes.CDLL() directly instead of find_library #752

Closed igalic closed 4 years ago

igalic commented 4 years ago

This should be more efficient, as it doesn't need to call ldconfig, gcc, objdump or ld to determine its existence. ctypes.CDDL() will use dlopen() directly.

Note that we're hard-coding the current version (libc.so.7). This will need changing when FreeBSD changes their ABI.

At that point we might have to rethink our strategy, or fix ctypes.util.find_library() to be less awful. Until then, this should give us a minimal performance boost.