aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2011-08-31 01:40:27 +0200
committermaximilian attems <max@stro.at>2011-08-31 01:53:09 +0200
commitef573f1aed7bba670b3b519b5b61d93cde7e2957 (patch)
tree6435741c8731f998bdff4528d24dbcb31a1089cf
parent03f82fe5b7e3f39464a0fa499a315dc74837b63c (diff)
downloadklibc-ef573f1aed7bba670b3b519b5b61d93cde7e2957.tar.gz
[klibc] stdio: Add feof()
Initial implementation. Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/include/stdio.h1
-rw-r--r--usr/klibc/Kbuild2
-rw-r--r--usr/klibc/stdio/feof.c6
3 files changed, 8 insertions, 1 deletions
diff --git a/usr/include/stdio.h b/usr/include/stdio.h
index 332254669e11a..eac9a09463d0e 100644
--- a/usr/include/stdio.h
+++ b/usr/include/stdio.h
@@ -115,6 +115,7 @@ __static_inline int ferror(FILE * __f)
(void)__f;
return 0;
}
+__extern int feof(FILE *);
__extern int fflush(FILE *);
__extern int sscanf(const char *, const char *, ...);
diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
index e655d67b442c7..f67ba1c16c43e 100644
--- a/usr/klibc/Kbuild
+++ b/usr/klibc/Kbuild
@@ -60,7 +60,7 @@ klib-y := vsnprintf.o snprintf.o vsprintf.o sprintf.o \
setmntent.o endmntent.o getmntent.o \
stdio/fclose.o stdio/fopen.o stdio/fdopen.o stdio/fxopen.o \
stdio/fread.o stdio/fwrite.o stdio/fflush.o \
- stdio/fseek.o stdio/ungetc.o
+ stdio/fseek.o stdio/ungetc.o stdio/feof.o
klib-$(CONFIG_KLIBC_ERRLIST) += errlist.o
diff --git a/usr/klibc/stdio/feof.c b/usr/klibc/stdio/feof.c
new file mode 100644
index 0000000000000..01c26e162ef8a
--- /dev/null
+++ b/usr/klibc/stdio/feof.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int feof(FILE *f)
+{
+ return f->flags & _IO_FILE_FLAG_EOF;
+}