summaryrefslogtreecommitdiff
path: root/libc/include/unistd.h
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
commit61ba39a23786a7ae9694705af1d146c00a319144 (patch)
treef9ad51bee751f7e878ac3e7ad4d45f993605c37d /libc/include/unistd.h
parente2d292afdb43cd7d9391128563384e1edd53c52e (diff)
Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested.
Diffstat (limited to 'libc/include/unistd.h')
-rw-r--r--libc/include/unistd.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
new file mode 100644
index 0000000..8efd838
--- /dev/null
+++ b/libc/include/unistd.h
@@ -0,0 +1,31 @@
+#ifndef __UNISTD_H__
+#define __UNISTD_H__
+
+#include <reent.h>
+#include <stddef.h>
+#include <stdint.h>
+
+typedef int32_t ssize_t;
+typedef int32_t off_t;
+
+enum open_types_t {
+ O_RDONLY = 0,
+ O_WRONLY = 1,
+ O_RDWR = 2,
+ O_CREAT = 4,
+ O_TRUNC = 8,
+ O_APPEND = 16,
+};
+
+enum seek_wheels_t {
+ SEEK_SET = 0,
+ SEEK_CUR = 1,
+ SEEK_END = 2,
+};
+
+int open(const char *pathname, int flags);
+int close(int fd);
+ssize_t read(int fd, void *buf, size_t count);
+ssize_t write(int fd, const void *buf, size_t count);
+
+#endif