Back to index

glibc  2.9
Functions
__fsetlocking.c File Reference
#include <stdio_ext.h>

Go to the source code of this file.

Functions

int __fsetlocking (FILE *fp, int type)

Function Documentation

int __fsetlocking ( FILE fp,
int  type 
)

Definition at line 24 of file __fsetlocking.c.

{
  int result = ((fp->_flags & _IO_USER_LOCK)
              ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL);

  if (type != FSETLOCKING_QUERY)
    {
      fp->_flags &= ~_IO_USER_LOCK;
      if (type == FSETLOCKING_BYCALLER)
        fp->_flags |= _IO_USER_LOCK;
    }

  return result;
}