Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Single UNIX Specification, Version 3 |
both | z/OS V1R8 |
#define _UNIX03_SOURCE
#include <stdio.h>
void funlockfile(FILE *file);
This function provides explicit application-level unlocking of stdio (FILE*) objects. The flockfile() family of functions can be used by a thread to delineate a sequence of I/O statements that are executed as a unit.
The funlockfile() function reduces the internal lock count. When the count is reduced to zero, the funlockfile() function relinquishes the ownership granted to the thread, of a (FILE *) object. If a call to funlockfile() is made by a thread which has not been granted ownership of a (FILE *) object, the call is ignored and the lock count is not reduced
The internal lock count allows matching calls to flockfile() (or successful calls to ftrylockfile()) and funlockfile() to be nested.
z/OS® consideration: The flockfile() family of functions acts upon FILE * objects. It is possible to have the same physical file represented by multiple FILE * objects that are not recognized as being equivalent. For example, fopen() opens a file and open() opens the same file, and then fdopen() creates a FILE * object. In this case, locking the first FILE * does not prevent the second FILE * from also being locked and used.
None.