代码拉取完成,页面将自动刷新
From 970d9d6fd15c433af20bbbd7418c5e9773d58471 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
Date: Mon, 7 Mar 2022 21:08:13 +0800
Subject: [PATCH] remove chose_dlsym_handle function, set handle to RTLD_NEXT
---
src/api/posix_api.c | 33 +--------------------------------
1 file changed, 1 insertion(+), 32 deletions(-)
diff --git a/src/api/posix_api.c b/src/api/posix_api.c
index eff9f46..bce07f5 100644
--- a/src/api/posix_api.c
+++ b/src/api/posix_api.c
@@ -64,33 +64,6 @@ void posix_api_fork(void)
posix_api->get_socket = chld_get_socket;
}
-static int chose_dlsym_handle(void *__restrict* khandle)
-{
- void *dlhandle;
- int (*gazelle_epoll_create)(int size);
- dlhandle = dlopen ("liblstack.so", RTLD_LAZY);
- if (dlhandle == NULL) {
- return ERR_IF;
- }
-
- gazelle_epoll_create = dlsym(dlhandle, "epoll_create");
- if (gazelle_epoll_create == NULL) {
- return ERR_MEM;
- }
-
- dlclose(dlhandle);
-
- *khandle = RTLD_NEXT;
- if (dlsym(*khandle, "epoll_create") == gazelle_epoll_create) {
- RTE_LOG(ERR, EAL, "posix api use RTLD_DEFAULT\n");
- *khandle = RTLD_DEFAULT;
- } else {
- RTE_LOG(ERR, EAL, "posix api use RTLD_NEXT\n");
- }
-
- return ERR_OK;
-}
-
int posix_api_init(void)
{
/* the symbol we use here won't be NULL, so we don't need dlerror()
@@ -102,11 +75,7 @@ int posix_api_init(void)
posix_api = &posix_api_val;
- void *__restrict handle;
- int ret = chose_dlsym_handle(&handle);
- if (ret != ERR_OK) {
- return ret;
- }
+ void *__restrict handle = RTLD_NEXT;
/* glibc standard api */
CHECK_DLSYM_RET_RETURN(posix_api->socket_fn = dlsym(handle, "socket"));
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。