apply hidden visibility to sigreturn code fragments
[musl.git] / src / stdio / ungetc.c
blob180673a47663ad57b11d3e6525c35cc23858939a
1 #include "stdio_impl.h"
3 int ungetc(int c, FILE *f)
5 if (c == EOF) return c;
7 FLOCK(f);
9 if (!f->rpos) __toread(f);
10 if (!f->rpos || f->rpos <= f->buf - UNGET) {
11 FUNLOCK(f);
12 return EOF;
15 *--f->rpos = c;
16 f->flags &= ~F_EOF;
18 FUNLOCK(f);
19 return c;