error:unknown field 'ioctl' specified in initializer


在linux-2.6.36內核上加載編譯驅動時,出現

 error:unknown field 'ioctl' specified in initializer

原因是:在2.6.36內核上file_operations發生了重大的改變:

原先的

  int (*ioctl)(struct inode*, struct file*, unsigned int, unsigned long);

被改為了       

   long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
        long (*compat_ioctl) (struct file *, unsigned int, unsigned long);

因而在實際驅動中,我們需要將原先的寫的ioctl函數頭給改成下面的unlocked_ioctl,在file_operations結構體的填充中也是一樣。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM