9 dlopen(char *path, int mode)
12 char tmp[260], *beg, *dot;
16 if ((rc = DosLoadModule(fail, sizeof fail, path, &handle)) == 0)
17 return (void *)handle;
21 /* Not found. Check for non-FAT name and try truncated name. */
22 /* Don't know if this helps though... */
23 for (beg = dot = path + strlen(path);
24 beg > path && !strchr(":/\\", *(beg-1));
30 memmove(tmp, path, n);
31 memmove(tmp+n, dot, strlen(dot)+1);
32 if (DosLoadModule(fail, sizeof fail, tmp, &handle) == 0)
33 return (void *)handle;
40 dlsym(void *handle, char *symbol)
45 rc = DosQueryProcAddr((HMODULE)handle, 0, symbol, &addr);
47 rc = DosQueryProcType((HMODULE)handle, 0, symbol, &type);
48 if (rc == 0 && type == PT_32BIT)
50 rc = ERROR_CALL_NOT_IMPLEMENTED;
64 if (DosGetMessage(NULL, 0, buf, sizeof buf - 1, retcode, "OSO001.MSG", &len))
65 sprintf(buf, "OS/2 system error code %d", retcode);