X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fflockfile.c;fp=functions%2Fstdio%2Fflockfile.c;h=4e80daf589b66a2563c44b704f6ea8a5a5943e93;hb=026148e2e90368c0b23192f506e15aa6197105aa;hp=0000000000000000000000000000000000000000;hpb=e70d680319ea23460b891e14259f2f6b3a568291;p=pdclib diff --git a/functions/stdio/flockfile.c b/functions/stdio/flockfile.c new file mode 100644 index 0000000..4e80daf --- /dev/null +++ b/functions/stdio/flockfile.c @@ -0,0 +1,32 @@ +/* flockfile(FILE * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#include + +#ifndef REGTEST +#include +#include + +void flockfile( FILE * file ) +{ + if( mtx_lock( &file->lock ) != thrd_success ) { + abort(); + } +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + // Not tested here - tested by other stdio test drivers + return TEST_RESULTS; +} + +#endif