]> pd.if.org Git - pdclib/blob - functions/stdio/flockfile.c
33b2e1440d830f8e3871064a931659a329c1727b
[pdclib] / functions / stdio / flockfile.c
1 /* flockfile(FILE * )\r
2 \r
3    This file is part of the Public Domain C Library (PDCLib).\r
4    Permission is granted to use, modify, and / or redistribute at will.\r
5 */\r
6 \r
7 #include <stdio.h>\r
8 #include <stdarg.h>\r
9 \r
10 #ifndef REGTEST\r
11 #include <_PDCLIB_io.h>\r
12 #include <threads.h>\r
13 #include <stdlib.h>\r
14 \r
15 void _PDCLIB_flockfile( FILE * file )\r
16 {\r
17     if( mtx_lock( &file->lock ) != thrd_success ) {\r
18         abort();\r
19     }\r
20 }\r
21 \r
22 #endif\r
23 \r
24 #ifdef TEST\r
25 #include <_PDCLIB_test.h>\r
26 \r
27 int main( void )\r
28 {\r
29     // Not tested here - tested by other stdio test drivers\r
30     return TEST_RESULTS;\r
31 }\r
32 \r
33 #endif\r