]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/dlfcn-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include "dlfcn-util.h"
5 int dlsym_many_and_warn(void *dl
, int level
, ...) {
9 /* Tries to resolve a bunch of function symbols, and logs errors about the ones it cannot
10 * resolve. Note that this function possibly modifies the supplied function pointers if the whole
20 fn
= va_arg(ap
, typeof(fn
));
24 symbol
= va_arg(ap
, typeof(symbol
));
26 tfn
= (typeof(tfn
)) dlsym(dl
, symbol
);
28 r
= log_full_errno(level
,
29 SYNTHETIC_ERRNO(ELIBBAD
),
30 "Can't find symbol %s: %s", symbol
, dlerror());