#include <_PDCLIB_glue.h>
-int fgetc( struct _PDCLIB_file_t * stream )
+int fgetc_unlocked( struct _PDCLIB_file_t * stream )
{
if ( _PDCLIB_prepread( stream ) == EOF )
{
return (unsigned char)stream->buffer[stream->bufidx++];
}
+int fgetc( struct _PDCLIB_file_t * stream )
+{
+ flockfile( stream );
+ int c = fgetc_unlocked( stream );
+ funlockfile( stream );
+ return c;
+}
+
#endif
#ifdef TEST