diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-11-18 17:49:04 -0800 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-11-18 17:49:04 -0800 |
commit | 835dea0eb6333a9ef452881ea073bfe59d14096a (patch) | |
tree | 525c3b4fe8b281813d7234fcc8871c63c627cc19 /sys/linux/port/os/types.h | |
parent | 5bcc08d92ae9345d6863f555a3dd9ec960e0860f (diff) |
feat: continued filling out system layer
Diffstat (limited to 'sys/linux/port/os/types.h')
-rw-r--r-- | sys/linux/port/os/types.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/sys/linux/port/os/types.h b/sys/linux/port/os/types.h index 6e5c0c6..e772b35 100644 --- a/sys/linux/port/os/types.h +++ b/sys/linux/port/os/types.h @@ -1,4 +1,5 @@ #pragma once +#define packed __attribute__((packed)) /* * time @@ -6,6 +7,7 @@ /* timeval */ typedef struct sys·TimeStamp sys·TimeStamp; +typedef struct sys·TimeValue sys·TimeValue; struct sys·TimeStamp { @@ -14,6 +16,41 @@ struct sys·TimeStamp 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 */ @@ -40,7 +77,7 @@ struct sys·Info sys·TimeStamp access, create, status, modify; - struct{ + struct packed{ uint32 major; uint32 minor; }spdev; @@ -70,3 +107,5 @@ struct sys·DirEntry uchar type; /* filetype */ char name[]; /* filename */ }; + +#undef packed |