summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/libc/stdio.h18
-rw-r--r--api/posix/fcntl.h4
-rw-r--r--api/posix/sys/types.h1
-rw-r--r--api/posix/unistd.h5
4 files changed, 28 insertions, 0 deletions
diff --git a/api/libc/stdio.h b/api/libc/stdio.h
new file mode 100644
index 0000000..1edec4a
--- /dev/null
+++ b/api/libc/stdio.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <libc/string.h>
+
+#include <stdarg.h>
+
+typedef struct FILE FILE;
+
+extern FILE *stdout;
+extern FILE *stderr;
+
+extern int fputc(int c, FILE *f);
+
+int vfprintf(FILE *f, const char *restrict format, va_list arguments);
+int fprintf(FILE *f, const char *restrict format, ...);
+int vprintf(const char *restrict format, va_list arguments);
+int printf(const char *restrict format, ...);
+
diff --git a/api/posix/fcntl.h b/api/posix/fcntl.h
index 7e55e02..8a6ee7a 100644
--- a/api/posix/fcntl.h
+++ b/api/posix/fcntl.h
@@ -1,4 +1,8 @@
#pragma once
+#include "sys/types.h"
+
#define O_RDONLY 0
+int open(const char *path, int flags, mode_t mode);
+
diff --git a/api/posix/sys/types.h b/api/posix/sys/types.h
index 2be0ef8..81a5f13 100644
--- a/api/posix/sys/types.h
+++ b/api/posix/sys/types.h
@@ -4,4 +4,5 @@
typedef int64_t ssize_t;
typedef int64_t off_t;
+typedef int mode_t;
diff --git a/api/posix/unistd.h b/api/posix/unistd.h
index e440a4a..7487001 100644
--- a/api/posix/unistd.h
+++ b/api/posix/unistd.h
@@ -1,5 +1,8 @@
#pragma once
+#include <stddef.h>
+#include "sys/types.h"
+
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
@@ -11,3 +14,5 @@ enum seek_whence
SEEK_END
};
+ssize_t write(int fd, const void *buf, size_t length);
+