On Thu, Jan 13, 2005 at 08:31:30AM +0200, yakoub abaya wrote: > i've been reading about driver porting to kerne2.6 > the section about block device . > > they write : > static int __init sbd_init(void); <----__init > static void __exit sbd_exit(void); <---- __exit > > module_init(sbd_init); > module_exit(sbd_exit); > Q: what is __init and __exit ? are they preprocessor directives ?
Yes. They say that this code can be discarded in some cases, to make a slightly smaller kernel. __init says that this is initialization code. Once the kernel or module has finished initializing, it can be discarded. __exit says that this is finalization code. If module unloading is disabled, it can be discarded. Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
signature.asc
Description: Digital signature
