模塊插入時init()返回非0值的現象

負值:

static int h_init()
{
      printk(KERN_INFO "hello/n");
      return -3;
}

 

insmod: error inserting 'h.ko': -1 Module has wrong symbol version

 

正值:

static int h_init()
{
      printk(KERN_INFO "hello/n");
      return 5;
}

 

sys_init_module: 'h'->init suspiciously returned 5, it should follow 0/-E convention
sys_init_module: loading module anyway...
[<c002e4d4>] (unwind_backtrace+0x0/0xd4) from [<c00758e0>] (sys_init_module+0x144/0x1d8)
[<c00758e0>] (sys_init_module+0x144/0x1d8) from [<c0029ec0>] (ret_fast_syscall+0x0/0x2c)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章