#pragma once #define packed __attribute__((packed)) /* * time */ /* timeval */ typedef struct sys·TimeStamp sys·TimeStamp; typedef struct sys·TimeValue sys·TimeValue; struct sys·TimeStamp { int64 sec; uint32 nano; int32 femto; }; struct sys·TimeValue { int64 sec; int64 micro; }; /* resource */ typedef struct sys·UsageInfo sys·UsageInfo; /* rusage */ struct sys·UsageInfo { sys·TimeValue cpu; sys·TimeValue sys; /* linux extensions */ long maxrss; /* maximum resident set size */ long ixrss; /* integral shared memory size */ long idrss; /* integral unshared data size */ long isrss; /* integral unshared stack size */ struct packed { long minor; /* page reclaims (soft page faults) */ long major; /* page faults (hard page faults) */ }fault; long nswap; /* swaps */ long iblk; /* block input operations */ long oblk; /* block output operations */ long msgsent; /* IPC messages sent */ long msgrcvd; /* IPC messages received */ long nsignal; /* signals received */ long nvctxsw; /* voluntary context switches */ long nictxsw; /* involuntary context switches */ /* room for more... */ long __reserved[16]; }; /* * files */ typedef struct sys·Info sys·Info; typedef struct sys·Directory sys·Directory; typedef struct sys·DirEntry sys·DirEntry; /* statx */ struct sys·Info { uint32 mask; uint32 blksize; uint64 attr; uint32 nlink; uint32 uid; uint32 gid; uint16 mode; uint16 _pad; uint64 inode; uint64 size; uint64 nblk; uint64 attrmask; sys·TimeStamp access, create, status, modify; struct packed{ uint32 major; uint32 minor; }spdev; struct{ uint32 major; uint32 minor; }device; uint64 spare[14]; }; struct sys·Directory { intptr off; int fd; int pad; int pos, end; /* buf needs fall on (off_t) 8 byte alignment */ char buf[2048]; }; struct sys·DirEntry { ulong ino; /* inode number */ ulong off; /* offset to next entry (from start of directory */ ushort len; /* length of entry (in bytes) */ uchar type; /* filetype */ char name[]; /* filename */ }; #undef packed