#include "file.h" #include #include int __fgetc(struct __opaque_file *stream) { if (stream->f_flags & (FILE_EOF | FILE_ERR)) { return EOF; } char c = 0; int ret = __libc_file_read(stream, &c, 1); if (ret < 1) { return EOF; } return c; } int fgetc(struct __opaque_file *stream) { __libc_file_lock(stream); int ret = __fgetc(stream); __libc_file_unlock(stream); return ret; }