#include <linux/module.h>
{
char a;
int b;
short c;
long d;
double e;
printk("sizeof(a) =%d\n",sizeof(a) );
printk("sizeof(b) =%d \n",sizeof(b) );
printk("sizeof(c) = %d\n",sizeof(c) );
printk("sizeof(d) = %d\n",sizeof(d) );
printk("sizeof(e) = %d\n",sizeof(e) );
return 1;
}
static void __exit dev_exit(void)
{
printk("exet");
}
module_init(dev_init);
module_exit(dev_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("zl");
输出结果:
sizeof(a) =1
sizeof(b) =4
sizeof(c) = 2
sizeof(d) = 4
sizeof(e) = 8
#include <linux/init.h>
{
char a;
int b;
short c;
long d;
double e;
printk("sizeof(a) =%d\n",sizeof(a) );
printk("sizeof(b) =%d \n",sizeof(b) );
printk("sizeof(c) = %d\n",sizeof(c) );
printk("sizeof(d) = %d\n",sizeof(d) );
printk("sizeof(e) = %d\n",sizeof(e) );
return 1;
}
static void __exit dev_exit(void)
{
printk("exet");
}
module_init(dev_init);
module_exit(dev_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("zl");
输出结果:
sizeof(a) =1
sizeof(b) =4
sizeof(c) = 2
sizeof(d) = 4
sizeof(e) = 8