]> pd.if.org Git - zos/commitdiff
system include headers
authorNathan Wagner <nw@hydaspes.if.org>
Tue, 25 Oct 2016 01:29:49 +0000 (20:29 -0500)
committerNathan Wagner <nw@hydaspes.if.org>
Tue, 25 Oct 2016 01:40:31 +0000 (20:40 -0500)
include/stdlib.h [new file with mode: 0644]
include/sys/types.h [new file with mode: 0644]
include/time.h [new file with mode: 0644]

diff --git a/include/stdlib.h b/include/stdlib.h
new file mode 100644 (file)
index 0000000..46fb129
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef STDLIB_H_
+#define STDLIB_H_ 1
+
+#include "mem.h"
+
+#define malloc(s) koalloc(s)
+
+#endif
diff --git a/include/sys/types.h b/include/sys/types.h
new file mode 100644 (file)
index 0000000..bd08122
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef SYS_TYPES_H_
+#define SYS_TYPES_H_ 1
+
+#include <stdint.h>
+
+/* mode_t shall be an integer type. */
+typedef uint64_t mode_t;
+
+/* nlink_t, uid_t, gid_t, and id_t shall be integer types. */
+typedef uint64_t nlink_t;
+typedef uint64_t uid_t;
+typedef uint64_t gid_t;
+typedef uint64_t id_t;
+
+/* blkcnt_t and off_t shall be signed integer types. */
+typedef int64_t blkcnt_t;
+typedef int64_t off_t;
+
+/* [XSI] [Option Start] fsblkcnt_t, fsfilcnt_t, [Option End]  and ino_t shall
+ * be defined as unsigned integer types.
+ */
+typedef uint64_t fsblkcnt_t;
+typedef uint64_t fsfilcnt_t;
+typedef uint64_t ino_t;
+
+/* size_t shall be an unsigned integer type. */
+typedef uint64_t size_t;
+
+/* blksize_t, pid_t, and ssize_t shall be signed integer types. */
+typedef int64_t blksize_t;
+typedef int64_t pid_t;
+typedef int64_t ssize_t;
+
+/* time_t and clock_t shall be integer or real-floating types. */
+typedef uint64_t clock_t;
+typedef uint64_t time_t;
+
+typedef uint64_t dev_t;
+
+#endif
diff --git a/include/time.h b/include/time.h
new file mode 100644 (file)
index 0000000..672e2a3
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _SYS_TIME_H_
+#define _SYS_TIME_H_ 1
+
+/* we get to use the _ because we *are* the system header */
+
+#include <sys/types.h>
+
+struct tm {
+       int tm_sec;    /* seconds (0-60) */
+       int tm_min;    /* minutes (0-59) */
+       int tm_hour;   /* hours (0-23) */
+       int tm_mday;   /* day of the month (1-31) */
+       int tm_mon;    /* month (0-11) */
+       int tm_year;   /* year - 1900 */
+       int tm_wday;   /* day of the week (0-6, Sunday = 0) */
+       int tm_yday;   /* day in the year (0-365, 1 Jan = 0) */
+       int tm_isdst;  /* daylight saving time */
+};
+
+struct timespec {
+       time_t  tv_sec;
+       long    tv_nsec;
+};
+
+struct itimerspec {
+       struct timespec it_interval;
+       struct timespec it_value;
+};
+
+#endif