X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvfprintf.c;h=ffb4bbe6e49794509ccf20d018e924e22d0ac22c;hb=84d648157e22cecc65902ecfdd4e3a1b88d5e53f;hp=cc6e7a6e40388f9c65a187c3df3bea8e7e3dff8c;hpb=fce9a8538009ea5c113b03c608cedf036ce4a364;p=pdclib.old diff --git a/functions/stdio/vfprintf.c b/functions/stdio/vfprintf.c index cc6e7a6..ffb4bbe 100644 --- a/functions/stdio/vfprintf.c +++ b/functions/stdio/vfprintf.c @@ -12,7 +12,9 @@ #ifndef REGTEST -int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, va_list arg ) +int vfprintf_unlocked( struct _PDCLIB_file_t * _PDCLIB_restrict stream, + const char * _PDCLIB_restrict format, + va_list arg ) { /* TODO: This function should interpret format as multibyte characters. */ struct _PDCLIB_status_t status; @@ -46,6 +48,16 @@ int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDC return status.i; } +int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, + const char * _PDCLIB_restrict format, + va_list arg ) +{ + flockfile( stream ); + int r = vfprintf_unlocked( stream, format, arg ); + funlockfile( stream ); + return r; +} + #endif #ifdef TEST