[klibc] [klibc:master] stdio: Add extern definition of clearerr()

klibc-bot for Ben Hutchings ben at decadent.org.uk
Sat Jul 25 13:57:07 PDT 2020


Commit-ID:  1aacafeba630135c2d8377887486f5e369b598f9
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=1aacafeba630135c2d8377887486f5e369b598f9
Author:     Ben Hutchings <ben at decadent.org.uk>
AuthorDate: Sat, 25 Jul 2020 18:14:41 +0100
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 25 Jul 2020 21:43:01 +0100

[klibc] stdio: Add extern definition of clearerr()

We have an inline definition, but need an extern definition too.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 usr/klibc/Kbuild           | 2 +-
 usr/klibc/stdio/clearerr.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
index ae5eb6dc..7929dee5 100644
--- a/usr/klibc/Kbuild
+++ b/usr/klibc/Kbuild
@@ -75,7 +75,7 @@ klib-y += vsnprintf.o snprintf.o vsprintf.o sprintf.o \
 	  stdio/fread.o stdio/fwrite.o stdio/fflush.o \
 	  stdio/ungetc.o stdio/fgetc.o \
 	  stdio/fseek.o stdio/ftell.o stdio/rewind.o \
-	  stdio/fileno.o stdio/feof.o stdio/ferror.o
+	  stdio/fileno.o stdio/feof.o stdio/ferror.o stdio/clearerr.o
 
 klib-$(CONFIG_KLIBC_ERRLIST) += errlist.o
 
diff --git a/usr/klibc/stdio/clearerr.c b/usr/klibc/stdio/clearerr.c
new file mode 100644
index 00000000..fb565144
--- /dev/null
+++ b/usr/klibc/stdio/clearerr.c
@@ -0,0 +1,8 @@
+#define __NO_STDIO_INLINES
+#include "stdioint.h"
+
+void clearerr(FILE *__f)
+{
+	__f->_IO_error = 0;
+	__f->_IO_eof = 0;
+}


More information about the klibc mailing list