私は単純な jiffies コードを書きましたが、rmmod を実行しようとすると、
ERROR: Removing 'jiffi_module': Device or resource busy
だから私は少し調査を行い、「永続的」の症状の下でlsmodを実行することで発見しました。これは、exit_functionが見つからないために引き起こされる問題です。
Module Size Used by
jiffi_module 1027 0 **[permanent]**
実際、私のmakeファイルには、終了機能に関連する警告が表示されます
exit 関数が次のように定義されている場合の警告
static void __exit
jif_exit(void)
{
remove_proc_entry("jif", NULL);
}
warning: data definition has no type or storage class
warning: type defaults to ‘int’ in declaration of ‘modile_exit’
warning: parameter names (without types) in function declaration
warning: ‘jif_exit’ defined but not used
__exit を削除すると、少なくとも jif_exit が識別されるように見えるため、表示される警告は次のとおりです。
warning: data definition has no type or storage class
warning: type defaults to ‘int’ in declaration of ‘modile_exit’
warning: parameter names (without types) in function declaration
以下を読んで、このカーネルモジュールが2.6.39で永続的にマークされているのはなぜですか
それは問題であるgccの不一致について話しますか?誰かがそれ以上デバッグできないのを手伝ってもらえますか? 永続的でないようにモジュールを適切にロードする方法はありますか?