summaryrefslogtreecommitdiff
path: root/src/user/lib/include
diff options
context:
space:
mode:
authordzwdz2022-08-19 15:37:42 +0200
committerdzwdz2022-08-19 15:37:42 +0200
commit05f93a814a9b5fa6b0f3223fc51566c84b92d158 (patch)
treeb430bda5fd26c3cd7e273eda31171bf94100f9f1 /src/user/lib/include
parent0ed2f796d7723af8321f35d4ef5e6781ea41e36d (diff)
user/libc: fextflags, add nonbuffering mode for fread
useful for e.g. `hexdump -r /kdev/eth` to see packets as they come in
Diffstat (limited to 'src/user/lib/include')
-rw-r--r--src/user/lib/include/stdio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h
index 4d9cf94..b0d34a7 100644
--- a/src/user/lib/include/stdio.h
+++ b/src/user/lib/include/stdio.h
@@ -9,6 +9,10 @@
#define SEEK_CUR 2
#define SEEK_END 3
+/* stop fread() from trying to fill the entire buffer before returning
+ * i.e. it will call _syscall_read() exactly once */
+#define FEXT_NOFILL 1
+
int printf(const char *restrict fmt, ...);
int fprintf(FILE *restrict f, const char *restrict fmt, ...);
@@ -24,6 +28,7 @@ FILE *fopen(const char *path, const char *mode);
FILE *freopen(const char *path, const char *mode, FILE *);
FILE *fdopen(int fd, const char *mode);
FILE *file_clone(const FILE *, const char *mode);
+int fextflags(FILE *, int extflags);
int fclose(FILE *);
int fflush(FILE *f);