uClibc_stdio.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. /* Copyright (C) 2002 Manuel Novoa III
  2. * Header for my stdio library for linux and (soon) elks.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the Free
  16. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. /* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
  19. *
  20. * This code is currently under development. Also, I plan to port
  21. * it to elks which is a 16-bit environment with a fairly limited
  22. * compiler. Therefore, please refrain from modifying this code
  23. * and, instead, pass any bug-fixes, etc. to me. Thanks. Manuel
  24. *
  25. * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */
  26. #ifndef _STDIO_H
  27. #error Always include <stdio.h> rather than <bits/uClibc_stdio.h>
  28. #endif
  29. /**********************************************************************/
  30. #define __STDIO_BUFFERS
  31. /* ANSI/ISO mandate at least 256. */
  32. #if defined(__UCLIBC_HAS_STDIO_BUFSIZ_NONE__)
  33. /* Fake this because some apps use stdio.h BUFSIZ. */
  34. #define __STDIO_BUFSIZ 256
  35. #undef __STDIO_BUFFERS
  36. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_256__)
  37. #define __STDIO_BUFSIZ 256
  38. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_512__)
  39. #define __STDIO_BUFSIZ 512
  40. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_1024__)
  41. #define __STDIO_BUFSIZ 1024
  42. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_2048__)
  43. #define __STDIO_BUFSIZ 2048
  44. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_4096__)
  45. #define __STDIO_BUFSIZ 4096
  46. #elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_8192__)
  47. #define __STDIO_BUFSIZ 8192
  48. #else
  49. #error config seems to be out of sync regarding bufsiz options
  50. #endif
  51. #ifdef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
  52. #define __STDIO_BUILTIN_BUF_SIZE 0
  53. #else /* __UCLIBC_HAS_STDIO_BUFSIZ_NONE__ */
  54. #if defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__)
  55. #define __STDIO_BUILTIN_BUF_SIZE 0
  56. #elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__)
  57. #define __STDIO_BUILTIN_BUF_SIZE 4
  58. #elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__)
  59. #define __STDIO_BUILTIN_BUF_SIZE 8
  60. #else
  61. #error config seems to be out of sync regarding builtin buffer size
  62. #endif
  63. #endif
  64. #if defined(__STDIO_BUFFERS) || defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__) || defined(__UCLIBC_HAS_THREADS__)
  65. #define __STDIO_HAS_OPENLIST 1
  66. #else
  67. #undef __STDIO_HAS_OPENLIST
  68. #endif
  69. /**********************************************************************/
  70. /* Make sure defines related to large files are consistent. */
  71. #ifdef _LIBC
  72. #ifdef __UCLIBC_HAS_LFS__
  73. #undef __USE_LARGEFILE
  74. #undef __USE_LARGEFILE64
  75. #undef __USE_FILE_OFFSET64
  76. /* If we're actually building uClibc with large file support, only define... */
  77. #define __USE_LARGEFILE64 1
  78. #endif /* __UCLIBC_HAS_LFS__ */
  79. #else /* not _LIBC */
  80. #ifndef __UCLIBC_HAS_LFS__
  81. #if defined(__LARGEFILE64_SOURCE) || defined(__USE_LARGEFILE64) || defined(__USE_FILE_OFFSET64)
  82. #error Sorry... uClibc was built without large file support!
  83. #endif
  84. #endif /* __UCLIBC_HAS_LFS__ */
  85. #endif /* _LIBC */
  86. /**********************************************************************/
  87. #ifdef __UCLIBC_HAS_WCHAR__
  88. #define __need_wchar_t
  89. #include <stddef.h>
  90. /* Note: we don't really need mbstate for 8-bit locales. We do for UTF-8.
  91. * For now, always use it. */
  92. #define __STDIO_MBSTATE
  93. #define __need_mbstate_t
  94. #include <wchar.h>
  95. #endif
  96. /**********************************************************************/
  97. /* Currently unimplemented/untested */
  98. /* #define __STDIO_FLEXIBLE_SETVBUF */
  99. #ifdef __UCLIBC_HAS_STDIO_GETC_MACRO__
  100. #define __STDIO_GETC_MACRO
  101. #endif
  102. #ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
  103. #define __STDIO_PUTC_MACRO
  104. #endif
  105. /* These are consistency checks on the different options */
  106. #ifndef __STDIO_BUFFERS
  107. #undef __STDIO_GETC_MACRO
  108. #undef __STDIO_PUTC_MACRO
  109. #endif
  110. #ifdef __BCC__
  111. #undef __UCLIBC_HAS_LFS__
  112. #endif
  113. #ifndef __UCLIBC_HAS_LFS__
  114. #undef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
  115. #endif
  116. /**********************************************************************/
  117. #ifdef __UCLIBC_HAS_THREADS__
  118. /* Need this for pthread_mutex_t. */
  119. #include <bits/pthreadtypes.h>
  120. /* user_locking
  121. * 0 : do auto locking/unlocking
  122. * 1 : user does locking/unlocking
  123. * 2 : initial state prior to thread initialization
  124. * with no auto locking/unlocking
  125. *
  126. * When threading is initialized, walk the stdio open stream list
  127. * and do "if (user_locking == 2) user_locking = 0;".
  128. *
  129. * This way, we avoid calling the weak lock/unlock functions.
  130. */
  131. #define __STDIO_AUTO_THREADLOCK_VAR int __infunc_user_locking
  132. #define __STDIO_AUTO_THREADLOCK(__stream) \
  133. if ((__infunc_user_locking = (__stream)->__user_locking) == 0) { \
  134. __pthread_mutex_lock(&(__stream)->__lock); \
  135. }
  136. #define __STDIO_AUTO_THREADUNLOCK(__stream) \
  137. if (__infunc_user_locking == 0) { \
  138. __pthread_mutex_unlock(&(__stream)->__lock); \
  139. }
  140. #define __STDIO_SET_USER_LOCKING(__stream) ((__stream)->__user_locking = 1)
  141. #define __STDIO_ALWAYS_THREADLOCK(__stream) \
  142. __pthread_mutex_lock(&(__stream)->__lock)
  143. #define __STDIO_ALWAYS_THREADTRYLOCK(__stream) \
  144. __pthread_mutex_trylock(&(__stream)->__lock)
  145. #define __STDIO_ALWAYS_THREADUNLOCK(__stream) \
  146. __pthread_mutex_unlock(&(__stream)->__lock)
  147. #else /* __UCLIBC_HAS_THREADS__ */
  148. #define __STDIO_AUTO_THREADLOCK_VAR ((void)0)
  149. #define __STDIO_AUTO_THREADLOCK(__stream) ((void)0)
  150. #define __STDIO_AUTO_THREADUNLOCK(__stream) ((void)0)
  151. #define __STDIO_SET_USER_LOCKING(__stream) ((void)0)
  152. #define __STDIO_ALWAYS_THREADLOCK(__stream) ((void)0)
  153. #define __STDIO_ALWAYS_THREADTRYLOCK(__stream) (0) /* Always succeed. */
  154. #define __STDIO_ALWAYS_THREADUNLOCK(__stream) ((void)0)
  155. #endif /* __UCLIBC_HAS_THREADS__ */
  156. /**********************************************************************/
  157. #define __STDIO_IOFBF 0 /* Fully buffered. */
  158. #define __STDIO_IOLBF 1 /* Line buffered. */
  159. #define __STDIO_IONBF 2 /* No buffering. */
  160. typedef struct {
  161. __off_t __pos;
  162. #ifdef __STDIO_MBSTATE
  163. __mbstate_t __mbstate;
  164. #endif
  165. #ifdef __UCLIBC_HAS_WCHAR__
  166. int __mblen_pending;
  167. #endif
  168. } __STDIO_fpos_t;
  169. #ifdef __UCLIBC_HAS_LFS__
  170. typedef struct {
  171. __off64_t __pos;
  172. #ifdef __STDIO_MBSTATE
  173. __mbstate_t __mbstate;
  174. #endif
  175. #ifdef __UCLIBC_HAS_WCHAR__
  176. int __mblen_pending;
  177. #endif
  178. } __STDIO_fpos64_t;
  179. #endif
  180. /**********************************************************************/
  181. #ifdef __UCLIBC_HAS_LFS__
  182. typedef __off64_t __offmax_t; /* TODO -- rename this? */
  183. #else
  184. typedef __off_t __offmax_t; /* TODO -- rename this? */
  185. #endif
  186. /**********************************************************************/
  187. #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
  188. typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __bufsize);
  189. typedef __ssize_t __io_write_fn(void *__cookie,
  190. __const char *__buf, size_t __bufsize);
  191. /* NOTE: GLIBC difference!!! -- fopencookie seek function
  192. * For glibc, the type of pos is always (__off64_t *) but in our case
  193. * it is type (__off_t *) when the lib is built without large file support.
  194. */
  195. typedef int __io_seek_fn(void *__cookie, __offmax_t *__pos, int __whence);
  196. typedef int __io_close_fn(void *__cookie);
  197. typedef struct {
  198. __io_read_fn *read;
  199. __io_write_fn *write;
  200. __io_seek_fn *seek;
  201. __io_close_fn *close;
  202. } _IO_cookie_io_functions_t;
  203. #if defined(_LIBC) || defined(_GNU_SOURCE)
  204. typedef __io_read_fn cookie_read_function_t;
  205. typedef __io_write_fn cookie_write_function_t;
  206. typedef __io_seek_fn cookie_seek_function_t;
  207. typedef __io_close_fn cookie_close_function_t;
  208. typedef _IO_cookie_io_functions_t cookie_io_functions_t;
  209. #endif
  210. #endif
  211. /**********************************************************************/
  212. struct __STDIO_FILE_STRUCT {
  213. unsigned short __modeflags;
  214. /* There could be a hole here, but modeflags is used most.*/
  215. #ifdef __UCLIBC_HAS_WCHAR__
  216. unsigned char __ungot_width[2]; /* 0: current (building) char; 1: scanf */
  217. /* Move the following futher down to avoid problems with getc/putc
  218. * macros breaking shared apps when wchar config support is changed. */
  219. /* wchar_t ungot[2]; */
  220. #else /* __UCLIBC_HAS_WCHAR__ */
  221. unsigned char __ungot[2];
  222. #endif /* __UCLIBC_HAS_WCHAR__ */
  223. int __filedes;
  224. #ifdef __STDIO_BUFFERS
  225. unsigned char *__bufstart; /* pointer to buffer */
  226. unsigned char *__bufend; /* pointer to 1 past end of buffer */
  227. unsigned char *__bufpos;
  228. unsigned char *__bufread; /* pointer to 1 past last buffered read char */
  229. #ifdef __STDIO_GETC_MACRO
  230. unsigned char *__bufgetc_u; /* 1 past last readable by getc_unlocked */
  231. #endif /* __STDIO_GETC_MACRO */
  232. #ifdef __STDIO_PUTC_MACRO
  233. unsigned char *__bufputc_u; /* 1 past last writeable by putc_unlocked */
  234. #endif /* __STDIO_PUTC_MACRO */
  235. #endif /* __STDIO_BUFFERS */
  236. #ifdef __STDIO_HAS_OPENLIST
  237. struct __STDIO_FILE_STRUCT *__nextopen;
  238. #endif
  239. #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
  240. void *__cookie;
  241. _IO_cookie_io_functions_t __gcs;
  242. #endif
  243. #ifdef __UCLIBC_HAS_WCHAR__
  244. wchar_t __ungot[2];
  245. #endif
  246. #ifdef __STDIO_MBSTATE
  247. __mbstate_t __state;
  248. #endif
  249. #ifdef __UCLIBC_HAS_XLOCALE__
  250. void *__unused; /* Placeholder for codeset binding. */
  251. #endif
  252. #ifdef __UCLIBC_HAS_THREADS__
  253. int __user_locking;
  254. pthread_mutex_t __lock;
  255. #endif
  256. /* Everything after this is unimplemented... and may be trashed. */
  257. #if __STDIO_BUILTIN_BUF_SIZE > 0
  258. unsigned char __builtinbuf[__STDIO_BUILTIN_BUF_SIZE];
  259. #endif /* __STDIO_BUILTIN_BUF_SIZE > 0 */
  260. };
  261. /***********************************************************************/
  262. /* Having ungotten characters implies the stream is reading.
  263. * The scheme used here treats the least significant 2 bits of
  264. * the stream's modeflags member as follows:
  265. * 0 0 Not currently reading.
  266. * 0 1 Reading, but no ungetc() or scanf() push back chars.
  267. * 1 0 Reading with one ungetc() char (ungot[1] is 1)
  268. * or one scanf() pushed back char (ungot[1] is 0).
  269. * 1 1 Reading with both an ungetc() char and a scanf()
  270. * pushed back char. Note that this must be the result
  271. * of a scanf() push back (in ungot[0]) _followed_ by
  272. * an ungetc() call (in ungot[1]).
  273. *
  274. * Notes:
  275. * scanf() can NOT use ungetc() to push back characters.
  276. * (See section 7.19.6.2 of the C9X rationale -- WG14/N897.)
  277. */
  278. #define __MASK_READING 0x0003U /* (0x0001 | 0x0002) */
  279. #define __FLAG_READING 0x0001U
  280. #define __FLAG_UNGOT 0x0002U
  281. #define __FLAG_EOF 0x0004U
  282. #define __FLAG_ERROR 0x0008U
  283. #define __FLAG_WRITEONLY 0x0010U
  284. #define __FLAG_READONLY 0x0020U /* (__FLAG_WRITEONLY << 1) */
  285. #define __FLAG_WRITING 0x0040U
  286. #define __FLAG_NARROW 0x0080U
  287. #define __FLAG_FBF 0x0000U /* must be 0 */
  288. #define __FLAG_LBF 0x0100U
  289. #define __FLAG_NBF 0x0200U /* (__FLAG_LBF << 1) */
  290. #define __MASK_BUFMODE 0x0300U /* (__FLAG_LBF|__FLAG_NBF) */
  291. #define __FLAG_APPEND 0x0400U /* fixed! == O_APPEND for linux */
  292. #define __FLAG_WIDE 0x0800U
  293. /* available slot 0x1000U */
  294. #define __FLAG_FREEFILE 0x2000U
  295. #define __FLAG_FREEBUF 0x4000U
  296. #define __FLAG_LARGEFILE 0x8000U /* fixed! == 0_LARGEFILE for linux */
  297. /* Note: In no-buffer mode, it would be possible to pack the necessary
  298. * flags into one byte. Since we wouldn't be buffering and there would
  299. * be no support for wchar, the only flags we would need would be:
  300. * 2 bits : ungot count
  301. * 2 bits : eof + error
  302. * 2 bits : readonly + writeonly
  303. * 1 bit : freefile
  304. * 1 bit : appending
  305. * So, for a very small system (< 128 files) we might have a
  306. * 4-byte FILE struct of:
  307. * unsigned char flags;
  308. * signed char filedes;
  309. * unsigned char ungot[2];
  310. */
  311. /**********************************************************************
  312. * PROTOTYPES OF INTERNAL FUNCTIONS
  313. **********************************************************************/
  314. #ifdef _LIBC
  315. extern void _stdio_init(void);
  316. extern void _stdio_term(void);
  317. #ifdef __STDIO_HAS_OPENLIST
  318. extern struct __STDIO_FILE_STRUCT *_stdio_openlist;
  319. #ifdef __UCLIBC_HAS_THREADS__
  320. extern pthread_mutex_t _stdio_openlist_lock;
  321. extern int _stdio_openlist_delflag;
  322. extern int _stdio_user_locking;
  323. extern void __stdio_init_mutex(pthread_mutex_t *m);
  324. #endif
  325. #endif
  326. #endif
  327. /**********************************************************************/
  328. #define __CLEARERR_UNLOCKED(__stream) \
  329. ((void)((__stream)->__modeflags &= ~(__FLAG_EOF|__FLAG_ERROR)))
  330. #define __FEOF_UNLOCKED(__stream) ((__stream)->__modeflags & __FLAG_EOF)
  331. #define __FERROR_UNLOCKED(__stream) ((__stream)->__modeflags & __FLAG_ERROR)
  332. #ifdef __UCLIBC_HAS_THREADS__
  333. # define __CLEARERR(__stream) (clearerr)(__stream)
  334. # define __FERROR(__stream) (ferror)(__stream)
  335. # define __FEOF(__stream) (feof)(__stream)
  336. #else
  337. # define __CLEARERR(__stream) __CLEARERR_UNLOCKED(__stream)
  338. # define __FERROR(__stream) __FERROR_UNLOCKED(__stream)
  339. # define __FEOF(__stream) __FEOF_UNLOCKED(__stream)
  340. #endif
  341. extern int __fgetc_unlocked(FILE *__stream);
  342. extern int __fputc_unlocked(int __c, FILE *__stream);
  343. /* First define the default definitions. They overriden below as necessary. */
  344. #define __FGETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
  345. #define __FGETC(__stream) (fgetc)((__stream))
  346. #define __GETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
  347. #define __GETC(__stream) (fgetc)((__stream))
  348. #define __FPUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
  349. #define __FPUTC(__c, __stream) (fputc)((__c),(__stream))
  350. #define __PUTC_UNLOCKED(__c, __stream) (__fputc_unlocked)((__c),(__stream))
  351. #define __PUTC(__c, __stream) (fputc)((__c),(__stream))
  352. #ifdef __STDIO_GETC_MACRO
  353. extern FILE *__stdin; /* For getchar() macro. */
  354. # define __GETC_UNLOCKED_MACRO(__stream) \
  355. ( ((__stream)->__bufpos < (__stream)->__bufgetc_u) \
  356. ? (*(__stream)->__bufpos++) \
  357. : __fgetc_unlocked(__stream) )
  358. # if 0
  359. /* Classic macro approach. getc{_unlocked} can have side effects. */
  360. # undef __GETC_UNLOCKED
  361. # define __GETC_UNLOCKED(__stream) __GETC_UNLOCKED_MACRO((__stream))
  362. # ifndef __UCLIBC_HAS_THREADS__
  363. # undef __GETC
  364. # define __GETC(__stream) __GETC_UNLOCKED_MACRO((__stream))
  365. # endif
  366. # else
  367. /* Using gcc extension for safety and additional inlining. */
  368. # undef __FGETC_UNLOCKED
  369. # define __FGETC_UNLOCKED(__stream) \
  370. (__extension__ ({ \
  371. FILE *__S = (__stream); \
  372. __GETC_UNLOCKED_MACRO(__S); \
  373. }) )
  374. # undef __GETC_UNLOCKED
  375. # define __GETC_UNLOCKED(__stream) __FGETC_UNLOCKED((__stream))
  376. # ifdef __UCLIBC_HAS_THREADS__
  377. # undef __FGETC
  378. # define __FGETC(__stream) \
  379. (__extension__ ({ \
  380. FILE *__S = (__stream); \
  381. ((__S->__user_locking ) \
  382. ? __GETC_UNLOCKED_MACRO(__S) \
  383. : (fgetc)(__S)); \
  384. }) )
  385. # undef __GETC
  386. # define __GETC(__stream) __FGETC((__stream))
  387. # else
  388. # undef __FGETC
  389. # define __FGETC(__stream) __FGETC_UNLOCKED((__stream))
  390. # undef __GETC
  391. # define __GETC(__stream) __FGETC_UNLOCKED((__stream))
  392. # endif
  393. # endif
  394. #else
  395. #endif /* __STDIO_GETC_MACRO */
  396. #ifdef __STDIO_PUTC_MACRO
  397. extern FILE *__stdout; /* For putchar() macro. */
  398. # define __PUTC_UNLOCKED_MACRO(__c, __stream) \
  399. ( ((__stream)->__bufpos < (__stream)->__bufputc_u) \
  400. ? (*(__stream)->__bufpos++) = (__c) \
  401. : __fputc_unlocked((__c),(__stream)) )
  402. # if 0
  403. /* Classic macro approach. putc{_unlocked} can have side effects.*/
  404. # undef __PUTC_UNLOCKED
  405. # define __PUTC_UNLOCKED(__c, __stream) \
  406. __PUTC_UNLOCKED_MACRO((__c), (__stream))
  407. # ifndef __UCLIBC_HAS_THREADS__
  408. # undef __PUTC
  409. # define __PUTC(__c, __stream) __PUTC_UNLOCKED_MACRO((__c), (__stream))
  410. # endif
  411. # else
  412. /* Using gcc extension for safety and additional inlining. */
  413. # undef __FPUTC_UNLOCKED
  414. # define __FPUTC_UNLOCKED(__c, __stream) \
  415. (__extension__ ({ \
  416. FILE *__S = (__stream); \
  417. __PUTC_UNLOCKED_MACRO((__c),__S); \
  418. }) )
  419. # undef __PUTC_UNLOCKED
  420. # define __PUTC_UNLOCKED(__c, __stream) __FPUTC_UNLOCKED((__c), (__stream))
  421. # ifdef __UCLIBC_HAS_THREADS__
  422. # undef __FPUTC
  423. # define __FPUTC(__c, __stream) \
  424. (__extension__ ({ \
  425. FILE *__S = (__stream); \
  426. ((__S->__user_locking) \
  427. ? __PUTC_UNLOCKED_MACRO((__c),__S) \
  428. : (fputc)((__c),__S)); \
  429. }) )
  430. # undef __PUTC
  431. # define __PUTC(__c, __stream) __FPUTC((__c), (__stream))
  432. # else
  433. # undef __FUTC
  434. # define __FPUTC(__c, __stream) __FPUTC_UNLOCKED((__c),(__stream))
  435. # undef __PUTC
  436. # define __PUTC(__c, __stream) __FPUTC_UNLOCKED((__c),(__stream))
  437. # endif
  438. # endif
  439. #endif /* __STDIO_PUTC_MACRO */