LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2894|回复: 3

unsigned int state_in_sysfs:1;如何解释其中的:1是赋值吗?

[复制链接]
发表于 2009-6-4 10:25:00 | 显示全部楼层 |阅读模式
这是内核的kobject结构体中的定义。
struct kobject {
        const char              *name;
        struct list_head        entry;
        struct kobject          *parent;
        struct kset             *kset;
        struct kobj_type        *ktype;
        struct sysfs_dirent     *sd;
        struct kref             kref;
        unsigned int state_initialized:1;
        unsigned int state_in_sysfs:1;
        unsigned int state_add_uevent_sent:1;
        unsigned int state_remove_uevent_sent:1;
};
发表于 2009-6-4 15:26:09 | 显示全部楼层
占用1个字节.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-6-19 10:37:07 | 显示全部楼层
好像不对!
应该是bit,不是byte
回复 支持 反对

使用道具 举报

发表于 2009-6-24 21:15:41 | 显示全部楼层
查一下位段的用法吧。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表