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