1 Star 0 Fork 49

shafeipaozi/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-07 21:24 . remove chose_dlsym_handle function
From 970d9d6fd15c433af20bbbd7418c5e9773d58471 Mon Sep 17 00:00:00 2001
From: jiangheng <[email protected]>
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/lwip.git
[email protected]:shafeipaozi/lwip.git
shafeipaozi
lwip
lwip
master

搜索帮助