1 #include "stdio_impl.h"
2 
fgetc(FILE * f)3 int fgetc(FILE* f) {
4     int c;
5     if (atomic_load(&f->lock) < 0 || !__lockfile(f))
6         return getc_unlocked(f);
7     c = getc_unlocked(f);
8     __unlockfile(f);
9     return c;
10 }
11