From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/stdio/ferror.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/stdio/ferror.c (limited to 'src/stdio/ferror.c') diff --git a/src/stdio/ferror.c b/src/stdio/ferror.c new file mode 100644 index 0000000..d692eed --- /dev/null +++ b/src/stdio/ferror.c @@ -0,0 +1,14 @@ +#include "stdio_impl.h" + +#undef ferror + +int ferror(FILE *f) +{ + FLOCK(f); + int ret = !!(f->flags & F_ERR); + FUNLOCK(f); + return ret; +} + +weak_alias(ferror, ferror_unlocked); +weak_alias(ferror, _IO_ferror_unlocked); -- cgit v1.2.3