stdio.h 799 B

123456789101112131415161718192021222324252627
  1. #ifndef _NEWLIB_STDIO_H
  2. #define _NEWLIB_STDIO_H
  3. #include <sys/lock.h>
  4. #include <sys/reent.h>
  5. /* Internal locking macros, used to protect stdio functions. In the
  6. general case, expand to nothing. Use __SSTR flag in FILE _flags to
  7. detect if FILE is private to sprintf/sscanf class of functions; if
  8. set then do nothing as lock is not initialised. */
  9. #if !defined(_flockfile)
  10. #ifndef __SINGLE_THREAD__
  11. # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
  12. #else
  13. # define _flockfile(fp) ((void) 0)
  14. #endif
  15. #endif
  16. #if !defined(_funlockfile)
  17. #ifndef __SINGLE_THREAD__
  18. # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock))
  19. #else
  20. # define _funlockfile(fp) ((void) 0)
  21. #endif
  22. #endif
  23. #endif /* _NEWLIB_STDIO_H */