X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffflush.c;h=3f1a4118a4d9a9ff7dc300b303e3e08badfbb4f3;hb=HEAD;hp=b8d32ec307d45b389d3a0fa37fb79263998e9f16;hpb=0d54a75af25ca44411e7c4190cc2a93a390e61a2;p=pdclib.old diff --git a/functions/stdio/fflush.c b/functions/stdio/fflush.c index b8d32ec..3f1a411 100644 --- a/functions/stdio/fflush.c +++ b/functions/stdio/fflush.c @@ -9,11 +9,11 @@ #include #ifndef REGTEST -#include <_PDCLIB_glue.h> +#include <_PDCLIB_io.h> -extern struct _PDCLIB_file_t * _PDCLIB_filelist; +extern FILE * _PDCLIB_filelist; -int fflush( struct _PDCLIB_file_t * stream ) +int _PDCLIB_fflush_unlocked( FILE * stream ) { if ( stream == NULL ) { @@ -38,6 +38,14 @@ int fflush( struct _PDCLIB_file_t * stream ) return _PDCLIB_flushbuffer( stream ); } } + +int fflush( FILE * stream ) +{ + _PDCLIB_flockfile( stream ); + int res = _PDCLIB_fflush_unlocked(stream); + _PDCLIB_funlockfile( stream ); + return res; +} #endif