Sh writes:
> int _init(void) {
> int i = modinstall(....);
> 
> _fini();
> return i;
> }

That's unusual.  Why would you want to unload yourself here?

Simply returning an error from _init() (and never doing a
mod_install() at all) should have roughly the effect it seems you
want.

> And I expect this module to unload automatically, so when I load it it should 
> be unloaded by _fini().But, I still see it in modinfo as loaded/installed.
> So,how this mechanism can be applied?I mean  I want to unload module  when 
> some event happens

You don't.  The _system_ calls the _fini(9E) entry point when it wants
to see if your module can be unloaded.  Other than modunload(1M), I
know of no way to make this happen on demand.

It might help to know what you're trying to do.

-- 
James Carlson, KISS Network                    <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to