diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-01-14 09:44:15 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-01-14 15:05:20 +0700 |
commit | a15486ffea916f46cca822d7614a44e48393b8d7 (patch) | |
tree | f47b7437e5a3f81f9a13ef1b5be45e5e5c59cf8e /system/lib/libc/musl/src/stdio/__towrite.c | |
parent | ea5facf1ab2c769e07b4046c6ed7257c2a8caf5c (diff) |
Fix asm2 compilation where __toread was used.
Diffstat (limited to 'system/lib/libc/musl/src/stdio/__towrite.c')
-rw-r--r-- | system/lib/libc/musl/src/stdio/__towrite.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/system/lib/libc/musl/src/stdio/__towrite.c b/system/lib/libc/musl/src/stdio/__towrite.c new file mode 100644 index 00000000..3698d8b7 --- /dev/null +++ b/system/lib/libc/musl/src/stdio/__towrite.c @@ -0,0 +1,18 @@ +#include "stdio_impl.h" + +int __towrite(FILE *f) +{ + f->mode |= f->mode-1; + if (f->flags & (F_NOWR)) { + f->flags |= F_ERR; + return EOF; + } + /* Clear read buffer (easier than summoning nasal demons) */ + f->rpos = f->rend = 0; + + /* Activate write through the buffer. */ + f->wpos = f->wbase = f->buf; + f->wend = f->buf + f->buf_size; + + return 0; +} |