projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
f00cc467ee9c4c371a874cb3943f23557976d0d0
[musl]
/
__toread.c
1
#include <stdio_impl.h>
2
3
int __toread(FILE *f)
4
{
5
f->mode |= f->mode-1;
6
if (f->wpos > f->buf) f->write(f, 0, 0);
7
f->wpos = f->wbase = f->wend = 0;
8
if (f->flags & (F_EOF|F_NORD)) {
9
if (f->flags & F_NORD) f->flags |= F_ERR;
10
return EOF;
11
}
12
f->rpos = f->rend = f->buf;
13
return 0;
14
}