summaryrefslogtreecommitdiff
path: root/src/user/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/include')
-rw-r--r--src/user/lib/include/bits/file.h1
-rw-r--r--src/user/lib/include/stdio.h12
2 files changed, 8 insertions, 5 deletions
diff --git a/src/user/lib/include/bits/file.h b/src/user/lib/include/bits/file.h
index 74a8c17..e50d402 100644
--- a/src/user/lib/include/bits/file.h
+++ b/src/user/lib/include/bits/file.h
@@ -5,5 +5,6 @@ struct FILE {
int fd;
int pos;
bool eof;
+ bool error;
};
typedef struct FILE FILE;
diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h
index 9d6921a..2f0746f 100644
--- a/src/user/lib/include/stdio.h
+++ b/src/user/lib/include/stdio.h
@@ -2,6 +2,8 @@
#include <bits/file.h>
#include <stddef.h>
+#define EOF (-1)
+
int printf(const char *fmt, ...);
int snprintf(char *str, size_t len, const char *fmt, ...);
@@ -11,9 +13,9 @@ int _klogf(const char *fmt, ...); // for kernel debugging only
extern FILE *const stdin, *const stdout;
FILE *fopen(const char *path, const char *mode);
-FILE *freopen(const char *path, const char *mode, FILE*);
+FILE *freopen(const char *path, const char *mode, FILE *);
FILE *fdopen(int fd, const char *mode);
-FILE *file_clone(const FILE*);
-int file_read(FILE*, char *buf, size_t len);
-int file_write(FILE*, const char *buf, size_t len);
-void file_close(FILE*);
+FILE *file_clone(const FILE *);
+size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict);
+size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict);
+int fclose(FILE *);