1
Fork 0
turbonss/lib/cgroup.zig

16 lines
605 B
Zig

const meta = @import("std").meta;
// Name type should be 0-terminated, members should be null-terminated, but
// sentinel is not part of the type (but is always there). Adding sentinel
// crashes zig compiler in pre-0.10. https://github.com/ziglang/zig/issues/7517
pub const CGroup = extern struct {
gid: u32,
// should be [*:0]const u8
name: [*]const u8,
// Should be [*:null]align(1) const ?[*:0]const u8
members: [*]align(1) const ?[*:0]const u8,
};
// size of the pointer to a single member.
pub const ptr_size = @sizeOf(meta.Child(meta.fieldInfo(CGroup, .members).field_type));