Same as ferror, except used only within a scope protected by flockfile and funlockfile. This function is supported on OpenVMS Integrity servers and Alpha only. Format #include <stdio.h> int ferror_unlocked (FILE *file_ptr);
1 – Argument
file_ptr A file pointer.
2 – Description
The reentrant version of the ferror function is locked against multiple threads calling it simultaneously. This incurs overhead to ensure integrity of the stream. The unlocked version of this call, ferror_unlocked can be used to avoid the overhead. The ferror_unlocked function is functionally identical to the ferror function, except that it is not required to be implemented in a thread-safe manner. The ferror_unlocked function can be safely used only within a scope that is protected by the flockfile and funlockfile functions used as a pair. The caller must ensure that the stream is locked before ferror_unlocked is used. See also flockfile, ftrylockfile, and funlockfile.
3 – Return Values
0 Indicates success. nonzero integer Indicates that an error has occurred.