#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include "misc/auxiliary.h"
#include "reporter/reporter.h"
#include "resources/feResource.h"
#include "omalloc/omalloc.h"
#include "mod_raw.h"
#include <dlfcn.h>
Go to the source code of this file.
◆ DL_IMPLEMENTED
◆ DL_TAIL
◆ dynl_check_opened()
int dynl_check_opened |
( |
char * |
filename | ) |
|
Definition at line 138 of file mod_raw.cc.
142 return dlopen(filename,RTLD_NOW|RTLD_NOLOAD) !=
NULL;
◆ dynl_close()
int dynl_close |
( |
void * |
handle | ) |
|
Definition at line 173 of file mod_raw.cc.
175 return(dlclose (handle));
◆ dynl_error()
const char* dynl_error |
( |
| ) |
|
◆ dynl_open()
void* dynl_open |
( |
char * |
filename | ) |
|
Definition at line 145 of file mod_raw.cc.
149 return dlopen(filename, RTLD_NOW|RTLD_GLOBAL);
152 if ((filename==
NULL) || (dlopen(filename,RTLD_NOW|RTLD_NOLOAD)==
NULL))
153 return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
155 Werror(
"module %s already loaded",filename);
void Werror(const char *fmt,...)
◆ dynl_open_binary_warn()
void* dynl_open_binary_warn |
( |
const char * |
binary_name, |
|
|
const char * |
msg |
|
) |
| |
Definition at line 48 of file mod_raw.cc.
51 char* binary_name_so=
NULL;
56 if (proc_path !=
NULL)
61 int binary_name_so_length = 3 + strlen(
DL_TAIL) + strlen(binary_name) + strlen(
DIR_SEPP) + strlen(proc_path);
62 binary_name_so = (
char *)
omAlloc0( binary_name_so_length *
sizeof(
char) );
63 while((p!=
NULL)&&(*p!=
'\0'))
67 strcpy(binary_name_so,p);
70 strcat(binary_name_so,binary_name);
72 if(!access(binary_name_so, R_OK)) { found=
TRUE;
break; }
75 if (found) handle =
dynl_open(binary_name_so);
80 Warn(
"Could not find dynamic library: %s%s (path %s)",
81 binary_name,
DL_TAIL,proc_path);
84 WarnS(
"See the INSTALL section in the Singular manual for details.");
STATIC_VAR BOOLEAN warn_handle
void * dynl_open(char *filename)
char * feGetResource(const char id, int warn)
const char * dynl_error()
◆ dynl_sym()
void* dynl_sym |
( |
void * |
handle, |
|
|
const char * |
symbol |
|
) |
| |
Definition at line 162 of file mod_raw.cc.
170 return(dlsym(handle, symbol));
void * dynl_open(char *filename)
STATIC_VAR void * kernel_handle
#define DYNL_KERNEL_HANDLE
◆ dynl_sym_warn()
void* dynl_sym_warn |
( |
void * |
handle, |
|
|
const char * |
proc, |
|
|
const char * |
msg |
|
) |
| |
Definition at line 92 of file mod_raw.cc.
94 void *proc_ptr =
NULL;
100 WarnS(
"Could load a procedure from a dynamic library");
103 WarnS(
"See the INSTALL section in the Singular manual for details.");
unsigned char * proc[NUM_PROC]
void * dynl_sym(void *handle, const char *symbol)
STATIC_VAR BOOLEAN warn_proc
const char * dynl_error()
◆ kernel_handle
◆ warn_handle
◆ warn_proc