github.com/afumu/libc@v0.0.6/musl/src/stdio/flockfile.c (about)

     1  #include "stdio_impl.h"
     2  #include "pthread_impl.h"
     3  
     4  void flockfile(FILE *f)
     5  {
     6  	if (!ftrylockfile(f)) return;
     7  	__lockfile(f);
     8  	__register_locked_file(f, __pthread_self());
     9  }