Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2001 20:18:14 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Sansonetti Laurent <lorenzo@linuxbe.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Reading files within the kernel (was Re: allocating userland space...) 
Message-ID:   <200108142018.aa65178@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Tue, 14 Aug 2001 01:10:19 %2B0200." <003401c1244d$1fa6ee80$0201a8c0@teledisnet.be> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <003401c1244d$1fa6ee80$0201a8c0@teledisnet.be>, Sansonetti Laurent w
rites:
>A another stupid question, how can I do to stop the loading process in
>MOD_LOAD event handler (in my case, if the cfg file doesn't exist, it should
>be better to interrupt..) ?

Someone else might a have better idea of how this works, but it
seems to me that the best you can do is printf a descriptive error
message and return a non-zero value from the module event handler
function. The return code from the event handler will be printed
on the console by the kernel, and the event handler will then
immediately be called with MOD_UNLOAD.

It seems that the KLD is not actually unloaded in this case, and
no error is returned to the kldload process, but the user can
then manually unload the KLD, correct the problem and try again.

That's just from a quick read of the code so it may be wrong. Try
adding printf's to the MOD_LOAD and MOD_UNLOAD cases in the event
handler, and see what happens when MOD_LOAD returns non-zero.

Ian

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200108142018.aa65178>