clearerr.c 755 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifdef __DO_UNLOCKED
  9. void __clearerr_unlocked(register FILE *stream)
  10. {
  11. __STDIO_STREAM_VALIDATE(stream);
  12. __CLEARERR_UNLOCKED(stream);
  13. }
  14. weak_alias(__clearerr_unlocked,clearerr_unlocked);
  15. #ifndef __UCLIBC_HAS_THREADS__
  16. weak_alias(__clearerr_unlocked,clearerr);
  17. #endif
  18. #elif defined __UCLIBC_HAS_THREADS__
  19. void clearerr(register FILE *stream)
  20. {
  21. __STDIO_AUTO_THREADLOCK_VAR;
  22. __STDIO_AUTO_THREADLOCK(stream);
  23. __STDIO_STREAM_VALIDATE(stream);
  24. __CLEARERR_UNLOCKED(stream);
  25. __STDIO_AUTO_THREADUNLOCK(stream);
  26. }
  27. #endif