summaryrefslogtreecommitdiff
path: root/src/SSL_Common.c
diff options
context:
space:
mode:
authorlishu <[email protected]>2018-11-09 15:25:28 +0800
committerlishu <[email protected]>2018-11-09 15:25:28 +0800
commit6e703c4335a6a724d36bcea4d257330d281650e7 (patch)
tree4a8413f658b60d46226ff0f0c64aa33d6ac4207b /src/SSL_Common.c
ssl update SAN
Diffstat (limited to 'src/SSL_Common.c')
-rw-r--r--src/SSL_Common.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/SSL_Common.c b/src/SSL_Common.c
new file mode 100644
index 0000000..0d9aea8
--- /dev/null
+++ b/src/SSL_Common.c
@@ -0,0 +1,60 @@
+/*
+ * SSL_Common.c
+
+ *
+ * Created on: 2013-5-8
+ * Author: lis
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SSL_Common.h"
+
+int get_so_path(void* func_addr,char* path,unsigned int size)
+
+ {
+
+ Dl_info av_dl_info;
+
+ dladdr(func_addr,&av_dl_info);
+
+ unsigned int i=0,last_slash_pos=0;
+
+ for(i=0;i<strlen(av_dl_info.dli_fname);i++)
+
+ {
+
+ if(av_dl_info.dli_fname[i]=='/')
+
+ {
+
+ last_slash_pos=i;
+
+ }
+
+ }
+
+ if(i<size)
+
+ {
+
+ memcpy(path,av_dl_info.dli_fname,last_slash_pos);
+
+ return last_slash_pos;
+
+ }
+
+ else
+
+ {
+
+ return 0;
+
+ }
+
+
+
+ }
+
+