Andrej Podzimek wrote: >>> 2) What if module B requires module A *optionally*, based on reaching >>> some point in the code? How can B obtain a pointer to a function in A >>> after loading it? >> >> That's where you'd need to use ddi_modopen(9F). It's sort of like >> dlopen(3C) in the kernel. > > Just FTR, I have found an interesting file: ml/modstubs.s > > This file defines function stubs that load the required implementation > on demand. This seems to be a mechanism that loads modules based *only* > on a function call, without the need to initiate module loading > explicitly. (Well, at least if I am not mistaken...)
Yes, it does, but only for things built directly into the kernel. It's an internal mechanism, not something that "ordinary" modules can use. > This has (of course) the disadvantage that all the automatically loaded > modules have to be known in advance, they can't be built and distributed > separately, and changes to their interfaces must be reflected in > modstubs.s. Exactly. If you want dynamic module loading from your own modules, use ddi_modopen. If you can post more about the details of the actual problem you're trying to solve, it's possible that someone here may have alternatives for you to try. -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ on-discuss mailing list on-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/on-discuss