diff options
Diffstat (limited to '05/musl-0.6.0/src/stdio/fputc.c')
-rw-r--r-- | 05/musl-0.6.0/src/stdio/fputc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/05/musl-0.6.0/src/stdio/fputc.c b/05/musl-0.6.0/src/stdio/fputc.c index ec85938..3e0f738 100644 --- a/05/musl-0.6.0/src/stdio/fputc.c +++ b/05/musl-0.6.0/src/stdio/fputc.c @@ -8,3 +8,12 @@ int fputc(int c, FILE *f) FUNLOCK(f); return c; } + +int fputc_unlocked(int c, FILE *f) +{ + FLOCK(f); + if (c != f->lbf && f->wpos + 1 < f->wend) *f->wpos++ = c; + else c = __overflow(f, c); + FUNLOCK(f); + return c; +} |