feof.c 754 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
  2. *
  3. * GNU Library General Public License (LGPL) version 2 or later.
  4. *
  5. * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
  6. */
  7. #include "_stdio.h"
  8. #undef feof
  9. #ifdef __DO_UNLOCKED
  10. #undef feof_unlocked
  11. int feof_unlocked(register FILE *stream)
  12. {
  13. __STDIO_STREAM_VALIDATE(stream);
  14. return __FEOF_UNLOCKED(stream);
  15. }
  16. #ifndef __UCLIBC_HAS_THREADS__
  17. strong_alias(feof_unlocked,feof)
  18. #endif
  19. #elif defined __UCLIBC_HAS_THREADS__
  20. int feof(register FILE *stream)
  21. {
  22. int retval;
  23. __STDIO_AUTO_THREADLOCK_VAR;
  24. __STDIO_AUTO_THREADLOCK(stream);
  25. __STDIO_STREAM_VALIDATE(stream);
  26. retval = __FEOF_UNLOCKED(stream);
  27. __STDIO_AUTO_THREADUNLOCK(stream);
  28. return retval;
  29. }
  30. #endif