diff options
Diffstat (limited to 'erts/emulator/sys/unix/erl_unix_sys_ddll.c')
-rw-r--r-- | erts/emulator/sys/unix/erl_unix_sys_ddll.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/erts/emulator/sys/unix/erl_unix_sys_ddll.c b/erts/emulator/sys/unix/erl_unix_sys_ddll.c index 71a26fc7ef..d8d8fc13a8 100644 --- a/erts/emulator/sys/unix/erl_unix_sys_ddll.c +++ b/erts/emulator/sys/unix/erl_unix_sys_ddll.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2021. All Rights Reserved. + * Copyright Ericsson AB 2006-2022. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,6 +180,31 @@ int erts_sys_ddll_sym2(void *handle, const char *func_name, void **function, #endif } +/* + * Find a symbol in the shared object + */ +int erts_sys_ddll_vsym2(void *handle, const char *func_name, const char *vers, + void **function, ErtsSysDdllError* err) +{ +#if defined(HAVE_DLVSYM) + void *sym; + char *e; + int ret; + dlerror(); + sym = dlvsym(handle, func_name, vers); + if ((e = dlerror()) != NULL) { + ret = ERL_DE_DYNAMIC_ERROR_OFFSET - find_errcode(e, err); + ASSERT(ret != ERL_DE_NO_ERROR); + } else { + *function = sym; + ret = ERL_DE_NO_ERROR; + } + return ret; +#else + return ERL_DE_ERROR_NO_DDLL_FUNCTIONALITY; +#endif +} + /* XXX:PaN These two will be changed with new driver interface! */ /* |