What events can cause ferror to return a nonzero value?

What events can lead to the fact that it ferror()will return a nonzero value and after which events should be checked ferror()?

http://www.cplusplus.com/reference/cstdio/ferror/

Opening, reading, closing?

Will the return value ferror()change spontaneously? For example, if a program checks ferror(stream), enters rotation without interacting with the object FILEassociated with stream, and then checks again ferror(stream), will the return value ever be different?

Are any of these requirements standards?

+4
source share
1

, (, read, write, lseek, close), .

f___() stdio.h , , ferror() feof() , . fscanf, :

EOF ,         , .         EOF , ,         (. ferror(3)) , errno         .

stdio.h - , , ( ferror()) . libc .


GLibc Git (git://sourceware.org/git/glibc.git) .

ferror() _IO_ERR_SEEN _flags. grep ing , /.

+4

Source: https://habr.com/ru/post/1569515/


All Articles