"Patrick Luby" <[EMAIL PROTECTED]> wrote: > Pier, > > Pier Fumagalli wrote: >> >> "unique process"??? It's a DYLD "NSAddModule" call to the JVM library, and >> CreateJavaVM is called CreateJavaVMImpl... Doesn't look that "unique"... > > It is unique if you want Java code to invoke a C function via JNI. On Mac OS > X, > you need to name the shared library *.jnilib instead of *.dylib if you want to > invoke a "public native" Java method so that System.loadLibrary() will work. > The > use of NSAddModule works fine but is only accessible via C code with exists > only > in the parent process. Once you are with Tomcat (i.e. binding ports as root), > you are limited to accessing C functions via System.loadLibrary() and invoking > the "public native" Java method.
Patrick... System.loadlibrary (or however is called), does the exact opposite of what we need... We ship a binary that will load the JVM library, we don't rely on the JVM binary to load a library... Also, if you need to do some callbacks from Java into our native C code, the easiest thing is to register those right after invoking CreateJavaVM in JNI (and it works), rather than relying on an external library... The "Uniqueness" you're describing is just because of the fundamental difference between "libraries" and "modules" on any Mach-O based operating system: A "library" (DYLIB), is loaded in the scope of the whole process and all its symbols table is merged indefinitely to the process, exactly as if a binary linked against the same library was being launched (there's no difference on symbols relocation on whether you "link" your binary to a library, or you load it with NSAddModule after its invocation, in fact that's all dyld does when spawning processes). A "module" instead, can be loaded and unloaded at run time (more like a "dso" does under ELF, or a "dll" in Windows)... The main problem is that people tend to forget a basic intrinsic difference between a DYLIB and a module (in words "MH_BUNDLE")... But wouldn't want to go in deep on how the baby works (look at my recent post on patching Apache 2.0 behavior on Mach-O/DYLD based Oses). Pier -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>