]> pd.if.org Git - pdclib/blobdiff - functions/stdio/feof.c
PDCLIB-16: Add _unlocked variations of all I/O routines; move work into these versions
[pdclib] / functions / stdio / feof.c
index d5cf188d23811f105c4a7eb965078dfd19912086..ca43c75532bd4d06b3c83607597575faa7d25976 100644 (file)
 
 #ifndef REGTEST
 
-int feof( struct _PDCLIB_file_t * stream )
+int feof_unlocked( struct _PDCLIB_file_t * stream )
 {
     return stream->status & _PDCLIB_EOFFLAG;
 }
 
+int feof( struct _PDCLIB_file_t * stream )
+{
+    flockfile( stream );
+    int eof = feof_unlocked( stream );
+    funlockfile( stream );
+    return eof;
+}
+
 #endif
 
 #ifdef TEST