- 论坛徽章:
- 0
|
The module_param() macro takes 3 arguments: the name of the variable, its type and permissions for the corresponding file in sysfs.
例子
- static short int myshort = 1;
- ......
- /*
- * module_param(foo, int, 0000)
- * The first param is the parameters name
- * The second param is it's data type
- * [color=Red]The final argument is the permissions bits[/color],
- * for exposing parameters in sysfs (if non-zero) at a later stage.
- */
- module_param(myshort, short, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
- ......
复制代码 我不解的是,命令行传递的参数为什么非得跟访问许可联系起来? 而且我测试了一下,上面的代码好像并不直接影响 myshort 的值。 |
|