X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Ffunlockfile.c;fp=functions%2Fstdio%2Ffunlockfile.c;h=0845aab1ab1d85899c27b7d0a6953280b80c3d0a;hp=0000000000000000000000000000000000000000;hb=026148e2e90368c0b23192f506e15aa6197105aa;hpb=e70d680319ea23460b891e14259f2f6b3a568291 diff --git a/functions/stdio/funlockfile.c b/functions/stdio/funlockfile.c new file mode 100644 index 0000000..0845aab --- /dev/null +++ b/functions/stdio/funlockfile.c @@ -0,0 +1,37 @@ +/* funlockfile(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 funlockfile( FILE * file ) +{ + int res = mtx_unlock( &file->lock ); + switch(res) { + case thrd_success: + return; + + default: + abort(); + } +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + // Not tested here - tested by other stdio test drivers + return TEST_RESULTS; +} + +#endif