Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-06-01 00:51:41 +00:00
Code Issues Projects Releases Wiki Activity
musl/src/stdio/feof.c

15 lines
201 B
C
Raw Normal View History

initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#include "stdio_impl.h"
#undef feof
int feof(FILE *f)
{
correct locking in stdio functions that tried to be lock-free these functions must behave as if they obtain the lock via flockfile to satisfy POSIX requirements. since another thread can provably hold the lock when they are called, they must wait to obtain the lock before they can return, even if the correct return value could be obtained without locking. in the case of fclose and freopen, failure to do so could cause correct (albeit obscure) programs to crash or otherwise misbehave; in the case of feof, ferror, and fwide, failure to obtain the lock could sometimes return incorrect results. in any case, having these functions proceed and return while another thread held the lock was wrong.
2012-10-24 23:16:41 -04:00
FLOCK(f);
int ret = !!(f->flags & F_EOF);
FUNLOCK(f);
return ret;
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
}
weak_alias(feof, feof_unlocked);
add some ugly aliases for LSB ABI compatibility for some nonsensical reason, glibc's headers use inline functions that redirect some of the standard functions to ugly nonstandard names (and likewise for some of their nonstandard functions).
2012-06-02 21:20:21 -04:00
weak_alias(feof, _IO_feof_unlocked);
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 330ms Template: 17ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API