最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

fixed -> error: ‘S_IRGUO’ undeclared here (not in a function)

工作和技术 crifan 2874浏览 0评论

when I practice according to LLD3, meet an error:
error: ‘S_IRGUO’ undeclared here (not in a function)

for these lines:

static char *whom = "world ~~~";
static int howmany = 1;

module_param(howmany, int, S_IRGUO);
module_param(whom, charp, S_IRGUO)
;

so google and baidu, both not find the answer,
but in the end to deep into source code /linux/stat.h
find it is:

#define S_IRWXUGO    (S_IRWXU|S_IRWXG|S_IRWXO)
#define S_IALLUGO    (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
#define S_IRUGO        (S_IRUSR|S_IRGRP|S_IROTH)
#define S_IWUGO        (S_IWUSR|S_IWGRP|S_IWOTH)
#define S_IXUGO        (S_IXUSR|S_IXGRP|S_IXOTH)

so, this error is also my mis-type !!!
it should be:

module_param(howmany, int, S_IRUGO);
module_param(whom, charp, S_IRUGO);

转载请注明:在路上 » fixed -> error: ‘S_IRGUO’ undeclared here (not in a function)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. 齐鲁圈子16年前 (2009-03-22)回复
82 queries in 0.176 seconds, using 22.09MB memory