aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-01-30 18:47:52 +0100
committerLukas Larsson <[email protected]>2014-02-24 15:16:05 +0100
commite48c536be1b21711e6e4b16bd8a9b74cf2aa019b (patch)
tree0922103822919cacfd0583f0a5d38964764b2299
parentff463a10f37ca74c0b6a8c0e24ce919e56b12bb8 (diff)
downloadotp-e48c536be1b21711e6e4b16bd8a9b74cf2aa019b.tar.gz
otp-e48c536be1b21711e6e4b16bd8a9b74cf2aa019b.tar.bz2
otp-e48c536be1b21711e6e4b16bd8a9b74cf2aa019b.zip
ose: Update ddll interface after rebase to 17.0-rc1
Also deleted all the copy-paste stuff
-rw-r--r--erts/emulator/sys/ose/erl_ose_sys_ddll.c77
1 files changed, 3 insertions, 74 deletions
diff --git a/erts/emulator/sys/ose/erl_ose_sys_ddll.c b/erts/emulator/sys/ose/erl_ose_sys_ddll.c
index 4121199096..ebd80deeaf 100644
--- a/erts/emulator/sys/ose/erl_ose_sys_ddll.c
+++ b/erts/emulator/sys/ose/erl_ose_sys_ddll.c
@@ -19,7 +19,7 @@
/*
* Interface functions to the dynamic linker using dl* functions.
- * (As far as I know it works on SunOS 4, 5, Linux and FreeBSD. /Seb)
+ * (No support in OSE, we use static linkage instead)
*/
#ifdef HAVE_CONFIG_H
@@ -29,68 +29,15 @@
#include "sys.h"
#include "erl_vm.h"
#include "global.h"
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-
-/* some systems do not have RTLD_NOW defined, and require the "mode"
- * argument to dload() always be 1.
- */
-#ifndef RTLD_NOW
-# define RTLD_NOW 1
-#endif
-
-#define MAX_NAME_LEN 255 /* XXX should we get the system path size? */
-#define EXT_LEN 3
-#define FILE_EXT ".so" /* extension appended to the filename */
-
-static char **errcodes = NULL;
-static int num_errcodes = 0;
-static int num_errcodes_allocated = 0;
-
-#define my_strdup(WHAT) my_strdup_in(ERTS_ALC_T_DDLL_ERRCODES, WHAT);
-
-static char *my_strdup_in(ErtsAlcType_t type, char *what)
-{
- char *res = erts_alloc(type, strlen(what) + 1);
- strcpy(res, what);
- return res;
-}
-static int find_errcode(char *string, ErtsSysDdllError* err)
-{
- int i;
-
- if (err != NULL) {
- erts_sys_ddll_free_error(err); /* in case we ignored an earlier error */
- err->str = my_strdup_in(ERTS_ALC_T_DDLL_TMP_BUF, string);
- return 0;
- }
- for(i=0;i<num_errcodes;++i) {
- if (!strcmp(string, errcodes[i])) {
- return i;
- }
- }
- if (num_errcodes_allocated == num_errcodes) {
- errcodes = (num_errcodes_allocated == 0)
- ? erts_alloc(ERTS_ALC_T_DDLL_ERRCODES,
- (num_errcodes_allocated = 10) * sizeof(char *))
- : erts_realloc(ERTS_ALC_T_DDLL_ERRCODES, errcodes,
- (num_errcodes_allocated += 10) * sizeof(char *));
- }
- errcodes[num_errcodes++] = my_strdup(string);
- return (num_errcodes - 1);
-}
-
void erl_sys_ddll_init(void) {
}
/*
* Open a shared object
*/
-int erts_sys_ddll_open2(const char *full_name, void **handle, ErtsSysDdllError* err)
+int erts_sys_ddll_open(const char *full_name, void **handle, ErtsSysDdllError* err)
{
return ERL_DE_ERROR_NO_DDLL_FUNCTIONALITY;
}
@@ -168,25 +115,7 @@ int erts_sys_ddll_close2(void *handle, ErtsSysDdllError* err)
*/
char *erts_sys_ddll_error(int code)
{
- int actual_code;
-
- if (code > ERL_DE_DYNAMIC_ERROR_OFFSET) {
- return "Unspecified error";
- }
- actual_code = -1*(code - ERL_DE_DYNAMIC_ERROR_OFFSET);
-#if defined(HAVE_DLOPEN)
- {
- char *msg;
-
- if (actual_code >= num_errcodes) {
- msg = "Unknown dlload error";
- } else {
- msg = errcodes[actual_code];
- }
- return msg;
- }
-#endif
- return "no error";
+ return "Unspecified error";
}
void erts_sys_ddll_free_error(ErtsSysDdllError* err)