equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
99 |
99 |
100 /* Load transport library (directory=="" means do system search) */ |
100 /* Load transport library (directory=="" means do system search) */ |
101 static void * |
101 static void * |
102 loadTransportLibrary(const char *libdir, const char *name) |
102 loadTransportLibrary(const char *libdir, const char *name) |
103 { |
103 { |
|
104 char buf[MAXPATHLEN*2+100]; |
|
105 #ifndef STATIC_BUILD |
104 void *handle; |
106 void *handle; |
105 char libname[MAXPATHLEN+2]; |
107 char libname[MAXPATHLEN+2]; |
106 char buf[MAXPATHLEN*2+100]; |
|
107 const char *plibdir; |
108 const char *plibdir; |
108 |
109 |
109 /* Convert libdir from UTF-8 to platform encoding */ |
110 /* Convert libdir from UTF-8 to platform encoding */ |
110 plibdir = NULL; |
111 plibdir = NULL; |
111 if ( libdir != NULL ) { |
112 if ( libdir != NULL ) { |
123 } |
124 } |
124 |
125 |
125 /* dlopen (unix) / LoadLibrary (windows) the transport library */ |
126 /* dlopen (unix) / LoadLibrary (windows) the transport library */ |
126 handle = dbgsysLoadLibrary(libname, buf, sizeof(buf)); |
127 handle = dbgsysLoadLibrary(libname, buf, sizeof(buf)); |
127 return handle; |
128 return handle; |
|
129 #else |
|
130 return (dbgsysLoadLibrary(NULL, buf, sizeof(buf))); |
|
131 #endif |
128 } |
132 } |
129 |
133 |
130 /* |
134 /* |
131 * loadTransport() is adapted from loadJVMHelperLib() in |
135 * loadTransport() is adapted from loadJVMHelperLib() in |
132 * JDK 1.2 javai.c v1.61 |
136 * JDK 1.2 javai.c v1.61 |