]> pd.if.org Git - pdclib/blobdiff - functions/stdio/puts.c
PDCLIB-16: Add _unlocked variations of all I/O routines; move work into these versions
[pdclib] / functions / stdio / puts.c
index ec67478ddace2d36a2d303c8e3943d71b4955891..4e5522695d76dafcaef018ca6ab409144921f127 100644 (file)
@@ -13,7 +13,7 @@
 
 extern char * _PDCLIB_eol;
 
-int puts( const char * s )
+int puts_unlocked( const char * s )
 {
     if ( _PDCLIB_prepwrite( stdout ) == EOF )
     {
@@ -42,6 +42,14 @@ int puts( const char * s )
     }
 }
 
+int puts( const char * s )
+{
+    flockfile( stdout );
+    int r = puts_unlocked( s );
+    funlockfile( stdout );
+    return r;
+}
+
 #endif
 
 #ifdef TEST