getc.c 199 B

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