Distributor ID: Ubuntu |
|
20分 |
(1)linux驱动程序中: return -ENOMEM; 表示什么意思(返回的数字是多少)?
如果返回ENOMEN表示没有memory了。查查你的系统中文件errno.h,一般是12. #define ENOMEM 12 (2)执行make命令报警告: |
(1)路径: usr/src/linux-headers-3.13.0-32/include/linux/errno.h 文件的内容是 #define ERESTARTSYS 512 #define ERESTARTNOINTR 513 #define ERESTARTNOHAND 514 /* restart if no handler.. */ #define ENOIOCTLCMD 515 /* No ioctl command */ #define ERESTART_RESTARTBLOCK 516 /* restart by calling sys_restart_syscall */ #define EPROBE_DEFER 517 /* Driver requests probe retry */ #define EOPENSTALE 518 /* open found a stale dentry */ /* Defined for the NFSv3 protocol */ #define EBADHANDLE 521 /* Illegal NFS file handle */ #define ENOTSYNC 522 /* Update synchronization mismatch */ #define EBADCOOKIE 523 /* Cookie is stale */ #define ENOTSUPP 524 /* Operation is not supported */ #define ETOOSMALL 525 /* Buffer or request is too small */ #define ESERVERFAULT 526 /* An untranslatable error occurred */ #define EBADTYPE 527 /* Type not supported by server */ #define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */ #define EIOCBQUEUED 529 /* iocb queued, will get completion event */ 文件里没有#define ENOMEM 12 。 int ramhd_open(struct block_device *bdev, fmode_t mode) //设备打开用到 { return 0; } int ramhd_release(struct gendisk *gd, fmode_t mode) //设备关闭用到 { return 0; } static struct block_device_operations ramhd_fops = { .owner = THIS_MODULE, .open = ramhd_open, .release = ramhd_release, .ioctl = ramhd_ioctl, }; 操作系统版本:Distributor ID: Ubuntu |