What happens if __init & __exit attributes are used in intialization and exit modules & what happens if i don't use them. Example as shown below.
Using Attributes
static __init int myinit(void)
{}
static __exit void myexit(void)
{}
Witout attributes
static int myinit(void)
{}
static void myexit(void)
{}
@Sandy, The __init macro causes the init function to be discarded and its memory(vmalloc) freed once the init function finishes for built-in drivers. The __exit macro causes the omission of the function when the module is built into the kernel. Both __init and __exit will not hold good for the LKM. Also go through these links What does __init mean in the Linux kernel code? http://amar-techbits.blogspot.in/2012/08/understanding-macro-init-and-exit-in.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With