stdio.h revision 75818
11539Srgrimes/*- 21539Srgrimes * Copyright (c) 1990, 1993 31539Srgrimes * The Regents of the University of California. All rights reserved. 41539Srgrimes * 51539Srgrimes * This code is derived from software contributed to Berkeley by 61539Srgrimes * Chris Torek. 71539Srgrimes * 81539Srgrimes * Redistribution and use in source and binary forms, with or without 91539Srgrimes * modification, are permitted provided that the following conditions 101539Srgrimes * are met: 111539Srgrimes * 1. Redistributions of source code must retain the above copyright 121539Srgrimes * notice, this list of conditions and the following disclaimer. 131539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141539Srgrimes * notice, this list of conditions and the following disclaimer in the 151539Srgrimes * documentation and/or other materials provided with the distribution. 161539Srgrimes * 3. All advertising materials mentioning features or use of this software 171539Srgrimes * must display the following acknowledgement: 181539Srgrimes * This product includes software developed by the University of 191539Srgrimes * California, Berkeley and its contributors. 201539Srgrimes * 4. Neither the name of the University nor the names of its contributors 211539Srgrimes * may be used to endorse or promote products derived from this software 221539Srgrimes * without specific prior written permission. 231539Srgrimes * 241539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271539Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341539Srgrimes * SUCH DAMAGE. 351539Srgrimes * 3623655Speter * @(#)stdio.h 8.5 (Berkeley) 4/29/95 3750473Speter * $FreeBSD: head/include/stdio.h 75818 2001-04-22 01:56:09Z obrien $ 381539Srgrimes */ 391539Srgrimes 401539Srgrimes#ifndef _STDIO_H_ 411539Srgrimes#define _STDIO_H_ 421539Srgrimes 431539Srgrimes#include <sys/cdefs.h> 4424897Sbde#include <machine/ansi.h> 451539Srgrimes 461539Srgrimes#ifdef _BSD_SIZE_T_ 471539Srgrimestypedef _BSD_SIZE_T_ size_t; 481539Srgrimes#undef _BSD_SIZE_T_ 491539Srgrimes#endif 501539Srgrimes 511539Srgrimes#ifndef NULL 521539Srgrimes#define NULL 0 531539Srgrimes#endif 541539Srgrimes 5524897Sbdetypedef _BSD_OFF_T_ fpos_t; 561539Srgrimes 571539Srgrimes#define _FSTDIO /* Define for new stdio with functions. */ 581539Srgrimes 591539Srgrimes/* 601539Srgrimes * NB: to fit things in six character monocase externals, the stdio 611539Srgrimes * code uses the prefix `__s' for stdio objects, typically followed 621539Srgrimes * by a three-character attempt at a mnemonic. 631539Srgrimes */ 641539Srgrimes 651539Srgrimes/* stdio buffers */ 661539Srgrimesstruct __sbuf { 671539Srgrimes unsigned char *_base; 681539Srgrimes int _size; 691539Srgrimes}; 701539Srgrimes 7172529Simp/* hold a buncha junk that would grow the ABI */ 7273254Sdeischenstruct __sFILEX; 7372529Simp 741539Srgrimes/* 751539Srgrimes * stdio state variables. 761539Srgrimes * 771539Srgrimes * The following always hold: 781539Srgrimes * 791539Srgrimes * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), 801539Srgrimes * _lbfsize is -_bf._size, else _lbfsize is 0 811539Srgrimes * if _flags&__SRD, _w is 0 821539Srgrimes * if _flags&__SWR, _r is 0 831539Srgrimes * 841539Srgrimes * This ensures that the getc and putc macros (or inline functions) never 851539Srgrimes * try to write or read from a file that is in `read' or `write' mode. 861539Srgrimes * (Moreover, they can, and do, automatically switch from read mode to 871539Srgrimes * write mode, and back, on "r+" and "w+" files.) 881539Srgrimes * 891539Srgrimes * _lbfsize is used only to make the inline line-buffered output stream 901539Srgrimes * code as compact as possible. 911539Srgrimes * 921539Srgrimes * _ub, _up, and _ur are used when ungetc() pushes back more characters 931539Srgrimes * than fit in the current _bf, or when ungetc() pushes back a character 941539Srgrimes * that does not match the previous one in _bf. When this happens, 951539Srgrimes * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff 961539Srgrimes * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. 971539Srgrimes * 981539Srgrimes * NB: see WARNING above before changing the layout of this structure! 991539Srgrimes */ 1001539Srgrimestypedef struct __sFILE { 1011539Srgrimes unsigned char *_p; /* current position in (some) buffer */ 1021539Srgrimes int _r; /* read space left for getc() */ 1031539Srgrimes int _w; /* write space left for putc() */ 1041539Srgrimes short _flags; /* flags, below; this FILE is free if 0 */ 1051539Srgrimes short _file; /* fileno, if Unix descriptor, else -1 */ 1061539Srgrimes struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ 1071539Srgrimes int _lbfsize; /* 0 or -_bf._size, for inline putc */ 1081539Srgrimes 1091539Srgrimes /* operations */ 1101539Srgrimes void *_cookie; /* cookie passed to io functions */ 1111539Srgrimes int (*_close) __P((void *)); 1121539Srgrimes int (*_read) __P((void *, char *, int)); 1131539Srgrimes fpos_t (*_seek) __P((void *, fpos_t, int)); 1141539Srgrimes int (*_write) __P((void *, const char *, int)); 1151539Srgrimes 1161539Srgrimes /* separate buffer for long sequences of ungetc() */ 1171539Srgrimes struct __sbuf _ub; /* ungetc buffer */ 11872529Simp struct __sFILEX *_extra; /* additions to FILE to not break ABI */ 1191539Srgrimes int _ur; /* saved _r when _r is counting ungetc data */ 1201539Srgrimes 1211539Srgrimes /* tricks to meet minimum requirements even when malloc() fails */ 1221539Srgrimes unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ 1231539Srgrimes unsigned char _nbuf[1]; /* guarantee a getc() buffer */ 1241539Srgrimes 1251539Srgrimes /* separate buffer for fgetln() when line crosses buffer boundary */ 1261539Srgrimes struct __sbuf _lb; /* buffer for fgetln() */ 1271539Srgrimes 1281539Srgrimes /* Unix stdio files get aligned to block boundaries on fseek() */ 1291539Srgrimes int _blksize; /* stat.st_blksize (may be != _bf._size) */ 1301539Srgrimes fpos_t _offset; /* current lseek offset (see WARNING) */ 1311539Srgrimes} FILE; 1321539Srgrimes 1331539Srgrimes__BEGIN_DECLS 13472529Simpextern FILE __sF[]; 1351539Srgrimes__END_DECLS 1361539Srgrimes 1371539Srgrimes#define __SLBF 0x0001 /* line buffered */ 1381539Srgrimes#define __SNBF 0x0002 /* unbuffered */ 1391539Srgrimes#define __SRD 0x0004 /* OK to read */ 1401539Srgrimes#define __SWR 0x0008 /* OK to write */ 1411539Srgrimes /* RD and WR are never simultaneously asserted */ 1421539Srgrimes#define __SRW 0x0010 /* open for reading & writing */ 1431539Srgrimes#define __SEOF 0x0020 /* found EOF */ 1441539Srgrimes#define __SERR 0x0040 /* found error */ 1451539Srgrimes#define __SMBF 0x0080 /* _buf is from malloc */ 1461539Srgrimes#define __SAPP 0x0100 /* fdopen()ed in append mode */ 1471539Srgrimes#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ 14813771Smpp#define __SOPT 0x0400 /* do fseek() optimization */ 14913771Smpp#define __SNPT 0x0800 /* do not do fseek() optimization */ 1501539Srgrimes#define __SOFF 0x1000 /* set iff _offset is in fact correct */ 1511539Srgrimes#define __SMOD 0x2000 /* true => fgetln modified _p text */ 15237489Speter#define __SALC 0x4000 /* allocate string space dynamically */ 15372372Sdeischen#define __SIGN 0x8000 /* ignore this file in _fwalk */ 1541539Srgrimes 1551539Srgrimes/* 1561539Srgrimes * The following three definitions are for ANSI C, which took them 1571539Srgrimes * from System V, which brilliantly took internal interface macros and 1581539Srgrimes * made them official arguments to setvbuf(), without renaming them. 1591539Srgrimes * Hence, these ugly _IOxxx names are *supposed* to appear in user code. 1601539Srgrimes * 1611539Srgrimes * Although numbered as their counterparts above, the implementation 1621539Srgrimes * does not rely on this. 1631539Srgrimes */ 1641539Srgrimes#define _IOFBF 0 /* setvbuf should set fully buffered */ 1651539Srgrimes#define _IOLBF 1 /* setvbuf should set line buffered */ 1661539Srgrimes#define _IONBF 2 /* setvbuf should set unbuffered */ 1671539Srgrimes 1681539Srgrimes#define BUFSIZ 1024 /* size of buffer used by setbuf */ 1691539Srgrimes#define EOF (-1) 1701539Srgrimes 1711539Srgrimes/* 1721539Srgrimes * FOPEN_MAX is a minimum maximum, and is the number of streams that 1731539Srgrimes * stdio can provide without attempting to allocate further resources 1741539Srgrimes * (which could fail). Do not use this for anything. 1751539Srgrimes */ 1761539Srgrimes /* must be == _POSIX_STREAM_MAX <limits.h> */ 1771539Srgrimes#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */ 1781539Srgrimes#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */ 1791539Srgrimes 1801539Srgrimes/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ 1811539Srgrimes#ifndef _ANSI_SOURCE 1821539Srgrimes#define P_tmpdir "/var/tmp/" 1831539Srgrimes#endif 1841539Srgrimes#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ 1851539Srgrimes#define TMP_MAX 308915776 1861539Srgrimes 1871539Srgrimes#ifndef SEEK_SET 1881539Srgrimes#define SEEK_SET 0 /* set file offset to offset */ 1891539Srgrimes#endif 1901539Srgrimes#ifndef SEEK_CUR 1911539Srgrimes#define SEEK_CUR 1 /* set file offset to current plus offset */ 1921539Srgrimes#endif 1931539Srgrimes#ifndef SEEK_END 1941539Srgrimes#define SEEK_END 2 /* set file offset to EOF plus offset */ 1951539Srgrimes#endif 1961539Srgrimes 19772529Simp#define stdin (&__sF[0]) 19872529Simp#define stdout (&__sF[1]) 19972529Simp#define stderr (&__sF[2]) 2001539Srgrimes 2011539Srgrimes/* 2021539Srgrimes * Functions defined in ANSI C standard. 2031539Srgrimes */ 2041539Srgrimes__BEGIN_DECLS 2051539Srgrimesvoid clearerr __P((FILE *)); 2061539Srgrimesint fclose __P((FILE *)); 2071539Srgrimesint feof __P((FILE *)); 2081539Srgrimesint ferror __P((FILE *)); 2091539Srgrimesint fflush __P((FILE *)); 2101539Srgrimesint fgetc __P((FILE *)); 2111539Srgrimesint fgetpos __P((FILE *, fpos_t *)); 21214791Spaulchar *fgets __P((char *, int, FILE *)); 2131539SrgrimesFILE *fopen __P((const char *, const char *)); 2141539Srgrimesint fprintf __P((FILE *, const char *, ...)); 2151539Srgrimesint fputc __P((int, FILE *)); 2161539Srgrimesint fputs __P((const char *, FILE *)); 2171539Srgrimessize_t fread __P((void *, size_t, size_t, FILE *)); 2181539SrgrimesFILE *freopen __P((const char *, const char *, FILE *)); 2191539Srgrimesint fscanf __P((FILE *, const char *, ...)); 2201539Srgrimesint fseek __P((FILE *, long, int)); 2211539Srgrimesint fsetpos __P((FILE *, const fpos_t *)); 22214791Spaullong ftell __P((FILE *)); 2231539Srgrimessize_t fwrite __P((const void *, size_t, size_t, FILE *)); 2241539Srgrimesint getc __P((FILE *)); 2251539Srgrimesint getchar __P((void)); 2261539Srgrimeschar *gets __P((char *)); 2271539Srgrimes#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 2286895Sphkextern __const int sys_nerr; /* perror(3) external variables */ 2291539Srgrimesextern __const char *__const sys_errlist[]; 2301539Srgrimes#endif 2311539Srgrimesvoid perror __P((const char *)); 2321539Srgrimesint printf __P((const char *, ...)); 2331539Srgrimesint putc __P((int, FILE *)); 2341539Srgrimesint putchar __P((int)); 2351539Srgrimesint puts __P((const char *)); 2361539Srgrimesint remove __P((const char *)); 2371539Srgrimesint rename __P((const char *, const char *)); 2381539Srgrimesvoid rewind __P((FILE *)); 2391539Srgrimesint scanf __P((const char *, ...)); 2401539Srgrimesvoid setbuf __P((FILE *, char *)); 2411539Srgrimesint setvbuf __P((FILE *, char *, int, size_t)); 2421539Srgrimesint sprintf __P((char *, const char *, ...)); 2431539Srgrimesint sscanf __P((const char *, const char *, ...)); 2441539SrgrimesFILE *tmpfile __P((void)); 2451539Srgrimeschar *tmpnam __P((char *)); 2461539Srgrimesint ungetc __P((int, FILE *)); 2471539Srgrimesint vfprintf __P((FILE *, const char *, _BSD_VA_LIST_)); 2481539Srgrimesint vprintf __P((const char *, _BSD_VA_LIST_)); 2491539Srgrimesint vsprintf __P((char *, const char *, _BSD_VA_LIST_)); 2501539Srgrimes__END_DECLS 2511539Srgrimes 2521539Srgrimes/* 2531539Srgrimes * Functions defined in POSIX 1003.1. 2541539Srgrimes */ 2551539Srgrimes#ifndef _ANSI_SOURCE 25619211Swosch/* size for cuserid(3); UT_NAMESIZE + 1, see <utmp.h> */ 25723260Sache#define L_cuserid 17 2581539Srgrimes 25919211Swosch#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */ 26019211Swosch 2611539Srgrimes__BEGIN_DECLS 2621539Srgrimeschar *ctermid __P((char *)); 2631539SrgrimesFILE *fdopen __P((int, const char *)); 2641539Srgrimesint fileno __P((FILE *)); 26535163Sjbint ftrylockfile __P((FILE *)); 26635163Sjbvoid flockfile __P((FILE *)); 26735163Sjbvoid funlockfile __P((FILE *)); 2681539Srgrimes__END_DECLS 2691539Srgrimes#endif /* not ANSI */ 2701539Srgrimes 2711539Srgrimes/* 27224897Sbde * Portability hacks. See <sys/types.h>. 27324897Sbde */ 27424897Sbde#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 27524897Sbde__BEGIN_DECLS 27624897Sbde#ifndef _FTRUNCATE_DECLARED 27724897Sbde#define _FTRUNCATE_DECLARED 27824897Sbdeint ftruncate __P((int, _BSD_OFF_T_)); 27924897Sbde#endif 28024897Sbde#ifndef _LSEEK_DECLARED 28124897Sbde#define _LSEEK_DECLARED 28224897Sbde_BSD_OFF_T_ lseek __P((int, _BSD_OFF_T_, int)); 28324897Sbde#endif 28424897Sbde#ifndef _MMAP_DECLARED 28524897Sbde#define _MMAP_DECLARED 28641798Sdtvoid *mmap __P((void *, size_t, int, int, int, _BSD_OFF_T_)); 28724897Sbde#endif 28824897Sbde#ifndef _TRUNCATE_DECLARED 28924897Sbde#define _TRUNCATE_DECLARED 29024897Sbdeint truncate __P((const char *, _BSD_OFF_T_)); 29124897Sbde#endif 29224897Sbde__END_DECLS 29324897Sbde#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ 29424897Sbde 29524897Sbde/* 2961539Srgrimes * Routines that are purely local. 2971539Srgrimes */ 2981539Srgrimes#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 2991539Srgrimes__BEGIN_DECLS 30037614Sbdeint asprintf __P((char **, const char *, ...)) __printflike(2, 3); 30155036Sbdechar *ctermid_r __P((char *)); 30275621Skris__const char *fmtcheck __P((const char *, const char *)) 30375578Skris __attribute__((__format_arg__(2))); 3041539Srgrimeschar *fgetln __P((FILE *, size_t *)); 3051539Srgrimesint fpurge __P((FILE *)); 30643782Sdtint fseeko __P((FILE *, _BSD_OFF_T_, int)); 30743782Sdt_BSD_OFF_T_ ftello __P((FILE *)); 3081539Srgrimesint getw __P((FILE *)); 3091539Srgrimesint pclose __P((FILE *)); 3101539SrgrimesFILE *popen __P((const char *, const char *)); 3111539Srgrimesint putw __P((int, FILE *)); 3121539Srgrimesvoid setbuffer __P((FILE *, char *, int)); 3131539Srgrimesint setlinebuf __P((FILE *)); 3141539Srgrimeschar *tempnam __P((const char *, const char *)); 31537614Sbdeint snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4); 31637614Sbdeint vasprintf __P((char **, const char *, _BSD_VA_LIST_)) 31737614Sbde __printflike(2, 0); 31837614Sbdeint vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) 31937614Sbde __printflike(3, 0); 32037614Sbdeint vscanf __P((const char *, _BSD_VA_LIST_)) __scanflike(1, 0); 32137614Sbdeint vsscanf __P((const char *, const char *, _BSD_VA_LIST_)) 32237614Sbde __scanflike(2, 0); 3231539Srgrimes__END_DECLS 3241539Srgrimes 3251539Srgrimes/* 3261539Srgrimes * This is a #define because the function is used internally and 32771580Sdeischen * (unlike vfscanf) the name __vfscanf is guaranteed not to collide 3281539Srgrimes * with a user function when _ANSI_SOURCE or _POSIX_SOURCE is defined. 3291539Srgrimes */ 33071580Sdeischen#define vfscanf __vfscanf 3311539Srgrimes 3321539Srgrimes/* 3331539Srgrimes * Stdio function-access interface. 3341539Srgrimes */ 3351539Srgrimes__BEGIN_DECLS 3361539SrgrimesFILE *funopen __P((const void *, 33775818Sobrien int (*)(void *, char *, int), 33875818Sobrien int (*)(void *, const char *, int), 33975818Sobrien fpos_t (*)(void *, fpos_t, int), 34075818Sobrien int (*)(void *))); 3411539Srgrimes__END_DECLS 3421539Srgrimes#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) 3431539Srgrimes#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) 3441539Srgrimes#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ 3451539Srgrimes 3461539Srgrimes/* 3471539Srgrimes * Functions internal to the implementation. 3481539Srgrimes */ 3491539Srgrimes__BEGIN_DECLS 3501539Srgrimesint __srget __P((FILE *)); 35171580Sdeischenint __vfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); 3521539Srgrimesint __svfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); 3531539Srgrimesint __swbuf __P((int, FILE *)); 3541539Srgrimes__END_DECLS 3551539Srgrimes 3561539Srgrimes/* 3578858Srgrimes * The __sfoo macros are here so that we can 3581539Srgrimes * define function versions in the C library. 3591539Srgrimes */ 3601539Srgrimes#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) 3611539Srgrimes#if defined(__GNUC__) && defined(__STDC__) 3621539Srgrimesstatic __inline int __sputc(int _c, FILE *_p) { 3631539Srgrimes if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) 3641539Srgrimes return (*_p->_p++ = _c); 3651539Srgrimes else 3661539Srgrimes return (__swbuf(_c, _p)); 3671539Srgrimes} 3681539Srgrimes#else 3691539Srgrimes/* 3701539Srgrimes * This has been tuned to generate reasonable code on the vax using pcc. 3711539Srgrimes */ 3721539Srgrimes#define __sputc(c, p) \ 3731539Srgrimes (--(p)->_w < 0 ? \ 3741539Srgrimes (p)->_w >= (p)->_lbfsize ? \ 3751539Srgrimes (*(p)->_p = (c)), *(p)->_p != '\n' ? \ 3761539Srgrimes (int)*(p)->_p++ : \ 3771539Srgrimes __swbuf('\n', p) : \ 3781539Srgrimes __swbuf((int)(c), p) : \ 3791539Srgrimes (*(p)->_p = (c), (int)*(p)->_p++)) 3801539Srgrimes#endif 3811539Srgrimes 3821539Srgrimes#define __sfeof(p) (((p)->_flags & __SEOF) != 0) 3831539Srgrimes#define __sferror(p) (((p)->_flags & __SERR) != 0) 3841539Srgrimes#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) 3851539Srgrimes#define __sfileno(p) ((p)->_file) 3861539Srgrimes 38735127Sjb/* 38835127Sjb * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 38935127Sjb * B.8.2.7 for the rationale behind the *_unlocked() macros. 39035127Sjb */ 39135127Sjb#define feof_unlocked(p) __sfeof(p) 39235127Sjb#define ferror_unlocked(p) __sferror(p) 39335127Sjb#define clearerr_unlocked(p) __sclearerr(p) 3941539Srgrimes 3951539Srgrimes#ifndef _ANSI_SOURCE 39635127Sjb#define fileno_unlocked(p) __sfileno(p) 3971539Srgrimes#endif 3981539Srgrimes 39935127Sjb#define getc_unlocked(fp) __sgetc(fp) 40071580Sdeischen#define putc_unlocked(x, fp) __sputc(x, fp) 4011539Srgrimes 40235127Sjb#define getchar_unlocked() getc_unlocked(stdin) 40335127Sjb#define putchar_unlocked(x) putc_unlocked(x, stdout) 40424897Sbde 40524897Sbde#endif /* !_STDIO_H_ */ 406