diff options
author | maximilian attems <max@stro.at> | 2011-08-31 01:40:27 +0200 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2011-08-31 01:53:09 +0200 |
commit | ef573f1aed7bba670b3b519b5b61d93cde7e2957 (patch) | |
tree | 6435741c8731f998bdff4528d24dbcb31a1089cf | |
parent | 03f82fe5b7e3f39464a0fa499a315dc74837b63c (diff) | |
download | klibc-ef573f1aed7bba670b3b519b5b61d93cde7e2957.tar.gz |
[klibc] stdio: Add feof()
Initial implementation.
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/include/stdio.h | 1 | ||||
-rw-r--r-- | usr/klibc/Kbuild | 2 | ||||
-rw-r--r-- | usr/klibc/stdio/feof.c | 6 |
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; +} |