return 0; fail0:{filp_close(file,NULL);printk("load failed/n");} return 1; } static void __exit testmod_cleanup(void) { printk("module exit.../n"); } module_init(testmod_init); module_exit(testmod_cleanup); 以上是完整的程序,直接可以编译运行。 #include "chardev.h"头文件定义如下...
mailboxes and other kinds of files which are used for synchronization between processes. If flags includes O_NONBLOCK and the file is already locked, flopen() will fail and set errno to EWOULDBLOCK. As with open(), the additional mode argument is required if flags includes O_CREAT.RETURN VA...