aboutsummaryrefslogtreecommitdiff
path: root/sys/linux
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-11-18 17:49:04 -0800
committerNicholas Noll <nbnoll@eml.cc>2021-11-18 17:49:04 -0800
commit835dea0eb6333a9ef452881ea073bfe59d14096a (patch)
tree525c3b4fe8b281813d7234fcc8871c63c627cc19 /sys/linux
parent5bcc08d92ae9345d6863f555a3dd9ec960e0860f (diff)
feat: continued filling out system layer
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/port/os/constants.h2
-rw-r--r--sys/linux/port/os/types.h41
2 files changed, 42 insertions, 1 deletions
diff --git a/sys/linux/port/os/constants.h b/sys/linux/port/os/constants.h
index 8abf1fa..8fb913f 100644
--- a/sys/linux/port/os/constants.h
+++ b/sys/linux/port/os/constants.h
@@ -23,6 +23,8 @@
#define sys·ModeLink 0120000
#define sys·ModeSocket 0140000
+/* ioctl values */
+
/* mmap */
#define sys·ProtNone 0
#define sys·ProtRead 1
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