summaryrefslogtreecommitdiff
path: root/libc/stdio/stdio_ext.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-02-14 15:21:45 -0800
committerElliott Hughes <enh@google.com>2018-02-14 15:25:21 -0800
commit457852666cb870a844df016962fac487cb5e7559 (patch)
treeb6d5ea190fca3841b956dc1cbe714fdef8982655 /libc/stdio/stdio_ext.cpp
parent38a78728c343f6398763ae8d7e3e8202b927a056 (diff)
Add __fseterr.
Trivial, obvious counterpart to the standard ferror(3) and clearerr(3), and lets us build bison out of the box. Bug: http://b/64273806 Test: ran tests Change-Id: I20affabddb71210051165c41e86adfe5ae04f77f
Diffstat (limited to 'libc/stdio/stdio_ext.cpp')
-rw-r--r--libc/stdio/stdio_ext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/stdio/stdio_ext.cpp b/libc/stdio/stdio_ext.cpp
index 8cf4f4b3d..e17b62a05 100644
--- a/libc/stdio/stdio_ext.cpp
+++ b/libc/stdio/stdio_ext.cpp
@@ -72,6 +72,10 @@ void _flushlbf() {
fflush(NULL);
}
+void __fseterr(FILE* fp) {
+ fp->_flags |= __SERR;
+}
+
int __fsetlocking(FILE* fp, int type) {
int old_state = _EXT(fp)->_caller_handles_locking ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL;
if (type == FSETLOCKING_QUERY) {