summaryrefslogtreecommitdiff
path: root/src/user/lib/stdio/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/stdio/misc.c')
-rw-r--r--src/user/lib/stdio/misc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/user/lib/stdio/misc.c b/src/user/lib/stdio/misc.c
new file mode 100644
index 0000000..8f872ec
--- /dev/null
+++ b/src/user/lib/stdio/misc.c
@@ -0,0 +1,25 @@
+#include <errno.h>
+#include <stdio.h>
+
+void perror(const char *s) {
+ if (s) fprintf(stderr, "%s: ", s);
+ fprintf(stderr, "errno %d\n", errno);
+}
+
+int puts(const char *s) {
+ return printf("%s\n", s);
+}
+
+int getchar(void) {
+ return fgetc(stdin);
+}
+
+int putchar(int c) {
+ return fputc(c, stdout);
+}
+
+off_t lseek(int fd, off_t off, int whence) {
+ (void)fd; (void)off; (void)whence;
+ errno = ENOSYS;
+ return -1;
+}