[Date Prev][Date Next] [Chronological] [Thread] [Top]

[rtl] C++ and global ctor/dtor




This code compile and load but didn't printk.  Any idea?


#define __KERNEL__
#define MODULE
extern "C" {
#include <linux/module.h>
#include <linux/kernel.h>
int init_module();
void cleanup_module();
__do_global_ctors_aux();
__do_global_dtors_aux();
};

class global
{
public:
        global()
        {       printk("global ctor\n");
        }
        ~global()
        {       printk("global dtor\n");
        }
};

int init_module()
{       __do_global_ctors_aux();
	return 0;
}

void cleanup_module()
{       __do_global_dtors_aux();
}


--- [rtl] ---
For more information on Real-Time Linux see:
http://rtlinux.cs.nmt.edu/