]> pd.if.org Git - pdclib/blob - functions/stdio/flockfile.c
PDCLIB-15 PDCLIB-16:
[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 <threads.h>\r
12 #include <stdlib.h>\r
13 \r
14 void flockfile( FILE * file )\r
15 {\r
16     if( mtx_lock( &file->lock ) != thrd_success ) {\r
17         abort();\r
18     }\r
19 }\r
20 \r
21 #endif\r
22 \r
23 #ifdef TEST\r
24 #include <_PDCLIB_test.h>\r
25 \r
26 int main( void )\r
27 {\r
28     // Not tested here - tested by other stdio test drivers\r
29     return TEST_RESULTS;\r
30 }\r
31 \r
32 #endif\r