On 12/12/05 15:04, Sh wrote:
This is a module:

#include

.....
int _fini(void) {
int i =mod_remove(...);
return i;
}

int _init(void) {
int i = modinstall(....);

_fini();
return i;
}

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
This message posted from opensolaris.org

See the section 9e manpages for _init, _fini etc.  You are calling the _fini 
function
from your _init function - that is not how module remove is supposed to be 
performed.
_fini is called by the kernel when *it* wants to unload your module - the _fini
function is not supposed to be called directly.  I would guess that
in your case mod_remove is failing since the module is currently busy - you're
executing in it _init function.

Gavin
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to