加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
Aurora 提交于 2023-12-07 03:26 . update lwip to 2.1.3-39.oe2203sp1
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化