diff options
Diffstat (limited to 'crypto/dso/dso_dlfcn.c')
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c index 07bbf37456..e709c721cc 100644 --- a/crypto/dso/dso_dlfcn.c +++ b/crypto/dso/dso_dlfcn.c @@ -82,8 +82,8 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname); static int dlfcn_unbind(DSO *dso, char *symname, void *symptr); static int dlfcn_init(DSO *dso); static int dlfcn_finish(DSO *dso); -static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg); #endif +static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg); static DSO_METHOD dso_meth_dlfcn = { "OpenSSL 'dlfcn' shared library method", @@ -96,7 +96,7 @@ static DSO_METHOD dso_meth_dlfcn = { NULL, /* unbind_var */ NULL, /* unbind_func */ #endif - NULL, /* ctrl */ + dlfcn_ctrl, NULL, /* init */ NULL /* finish */ }; @@ -249,4 +249,28 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname) return(sym); } +static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg) + { + if(dso == NULL) + { + DSOerr(DSO_F_DLFCN_CTRL,ERR_R_PASSED_NULL_PARAMETER); + return(-1); + } + switch(cmd) + { + case DSO_CTRL_GET_FLAGS: + return dso->flags; + case DSO_CTRL_SET_FLAGS: + dso->flags = (int)larg; + return(0); + case DSO_CTRL_OR_FLAGS: + dso->flags |= (int)larg; + return(0); + default: + break; + } + DSOerr(DSO_F_DLFCN_CTRL,DSO_R_UNKNOWN_COMMAND); + return(-1); + } + #endif /* DSO_DLFCN */ |