summaryrefslogtreecommitdiff
path: root/src/unistd
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-14 19:52:29 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-14 19:52:29 -0400
commitfed8d9b70d23675323a54d40ed600fe8f73dfaa3 (patch)
treeb89da9e8a9dbde34d82765cd9bc4ac4603ecc64b /src/unistd
parent103cddc545885b35ad1240d5fbf1e3c2b2ae7811 (diff)
add internal state for <unistd.h>
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/__unistd.c7
-rw-r--r--src/unistd/_unistd.h18
2 files changed, 25 insertions, 0 deletions
diff --git a/src/unistd/__unistd.c b/src/unistd/__unistd.c
new file mode 100644
index 00000000..eaed9522
--- /dev/null
+++ b/src/unistd/__unistd.c
@@ -0,0 +1,7 @@
+#include "_unistd.h"
+
+struct __unistd __unistd;
+
+/*
+POSIX(1)
+*/
diff --git a/src/unistd/_unistd.h b/src/unistd/_unistd.h
new file mode 100644
index 00000000..87cdd8f1
--- /dev/null
+++ b/src/unistd/_unistd.h
@@ -0,0 +1,18 @@
+#ifndef ___UNISTD_H__
+#define ___UNISTD_H__
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <limits.h>
+
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+struct __unistd {
+ char ttyname[PATH_MAX + 1];
+};
+
+extern struct __unistd __unistd;
+
+#endif