10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance
70Sstevel@tonic-gate * with the License.
80Sstevel@tonic-gate *
90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate * See the License for the specific language governing permissions
120Sstevel@tonic-gate * and limitations under the License.
130Sstevel@tonic-gate *
140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate *
200Sstevel@tonic-gate * CDDL HEADER END
210Sstevel@tonic-gate */
22*11Smuffin /*
23*11Smuffin * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24*11Smuffin * Use is subject to license terms.
25*11Smuffin */
26*11Smuffin
270Sstevel@tonic-gate /* Copyright (c) 1988 AT&T */
280Sstevel@tonic-gate /* All Rights Reserved */
290Sstevel@tonic-gate
300Sstevel@tonic-gate /*
310Sstevel@tonic-gate * An application should not include this header directly. Instead it
320Sstevel@tonic-gate * should be included only through the inclusion of other Sun headers.
330Sstevel@tonic-gate *
340Sstevel@tonic-gate * The contents of this header is limited to identifiers specified in the
350Sstevel@tonic-gate * C Standard. Any new identifiers specified in future amendments to the
360Sstevel@tonic-gate * C Standard must be placed in this header. If these new identifiers
370Sstevel@tonic-gate * are required to also be in the C++ Standard "std" namespace, then for
380Sstevel@tonic-gate * anything other than macro definitions, corresponding "using" directives
390Sstevel@tonic-gate * must also be added to <stdio.h>.
400Sstevel@tonic-gate */
410Sstevel@tonic-gate
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate * User-visible pieces of the ANSI C standard I/O package.
440Sstevel@tonic-gate */
450Sstevel@tonic-gate
460Sstevel@tonic-gate #ifndef _ISO_STDIO_ISO_H
470Sstevel@tonic-gate #define _ISO_STDIO_ISO_H
480Sstevel@tonic-gate
490Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
500Sstevel@tonic-gate
510Sstevel@tonic-gate #include <sys/feature_tests.h>
520Sstevel@tonic-gate #include <sys/va_list.h>
530Sstevel@tonic-gate #include <stdio_tag.h>
540Sstevel@tonic-gate #include <stdio_impl.h>
550Sstevel@tonic-gate
560Sstevel@tonic-gate /*
570Sstevel@tonic-gate * If feature test macros are set that enable interfaces that use types
580Sstevel@tonic-gate * defined in <sys/types.h>, get those types by doing the include.
590Sstevel@tonic-gate *
600Sstevel@tonic-gate * Note that in asking for the interfaces associated with this feature test
610Sstevel@tonic-gate * macro one also asks for definitions of the POSIX types.
620Sstevel@tonic-gate */
630Sstevel@tonic-gate
640Sstevel@tonic-gate #ifdef __cplusplus
650Sstevel@tonic-gate extern "C" {
660Sstevel@tonic-gate #endif
670Sstevel@tonic-gate
680Sstevel@tonic-gate #if !defined(_LP64) && (_FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE))
690Sstevel@tonic-gate /*
700Sstevel@tonic-gate * The following typedefs are adopted from ones in <sys/types.h> (with leading
710Sstevel@tonic-gate * underscores added to avoid polluting the ANSI C name space). See the
720Sstevel@tonic-gate * commentary there for further explanation.
730Sstevel@tonic-gate */
740Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
750Sstevel@tonic-gate typedef long long __longlong_t;
760Sstevel@tonic-gate #else
770Sstevel@tonic-gate /* used to reserve space and generate alignment */
780Sstevel@tonic-gate typedef union {
790Sstevel@tonic-gate double _d;
800Sstevel@tonic-gate int _l[2];
810Sstevel@tonic-gate } __longlong_t;
820Sstevel@tonic-gate #endif
830Sstevel@tonic-gate #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE) */
840Sstevel@tonic-gate
850Sstevel@tonic-gate #if __cplusplus >= 199711L
860Sstevel@tonic-gate namespace std {
870Sstevel@tonic-gate #endif
880Sstevel@tonic-gate
890Sstevel@tonic-gate #if !defined(_FILEDEFED) || __cplusplus >= 199711L
900Sstevel@tonic-gate #define _FILEDEFED
910Sstevel@tonic-gate typedef __FILE FILE;
920Sstevel@tonic-gate #endif
930Sstevel@tonic-gate
940Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
950Sstevel@tonic-gate #define _SIZE_T
960Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
970Sstevel@tonic-gate typedef unsigned long size_t; /* size of something in bytes */
980Sstevel@tonic-gate #else
990Sstevel@tonic-gate typedef unsigned int size_t; /* (historical version) */
1000Sstevel@tonic-gate #endif
1010Sstevel@tonic-gate #endif /* !_SIZE_T */
1020Sstevel@tonic-gate
1030Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
1040Sstevel@tonic-gate typedef long fpos_t;
1050Sstevel@tonic-gate #else
1060Sstevel@tonic-gate typedef __longlong_t fpos_t;
1070Sstevel@tonic-gate #endif
1080Sstevel@tonic-gate
1090Sstevel@tonic-gate #if __cplusplus >= 199711L
1100Sstevel@tonic-gate }
1110Sstevel@tonic-gate #endif /* end of namespace std */
1120Sstevel@tonic-gate
1130Sstevel@tonic-gate #ifndef NULL
1140Sstevel@tonic-gate #if defined(_LP64)
1150Sstevel@tonic-gate #define NULL 0L
1160Sstevel@tonic-gate #else
1170Sstevel@tonic-gate #define NULL 0
1180Sstevel@tonic-gate #endif
1190Sstevel@tonic-gate #endif
1200Sstevel@tonic-gate
1210Sstevel@tonic-gate #define BUFSIZ 1024
1220Sstevel@tonic-gate
1230Sstevel@tonic-gate /*
1240Sstevel@tonic-gate * The value of _NFILE is defined in the Processor Specific ABI. The value
1250Sstevel@tonic-gate * is chosen for historical reasons rather than for truly processor related
1260Sstevel@tonic-gate * attribute. Note that the SPARC Processor Specific ABI uses the common
1270Sstevel@tonic-gate * UNIX historical value of 20 so it is allowed to fall through.
1280Sstevel@tonic-gate */
1290Sstevel@tonic-gate #if defined(__i386)
1300Sstevel@tonic-gate #define _NFILE 60 /* initial number of streams: Intel x86 ABI */
1310Sstevel@tonic-gate #else
1320Sstevel@tonic-gate #define _NFILE 20 /* initial number of streams: SPARC ABI and default */
1330Sstevel@tonic-gate #endif
1340Sstevel@tonic-gate
1350Sstevel@tonic-gate #define _SBFSIZ 8 /* compatibility with shared libs */
1360Sstevel@tonic-gate
1370Sstevel@tonic-gate #define _IOFBF 0000 /* full buffered */
1380Sstevel@tonic-gate #define _IOLBF 0100 /* line buffered */
1390Sstevel@tonic-gate #define _IONBF 0004 /* not buffered */
1400Sstevel@tonic-gate #define _IOEOF 0020 /* EOF reached on read */
1410Sstevel@tonic-gate #define _IOERR 0040 /* I/O error from system */
1420Sstevel@tonic-gate
1430Sstevel@tonic-gate #define _IOREAD 0001 /* currently reading */
1440Sstevel@tonic-gate #define _IOWRT 0002 /* currently writing */
1450Sstevel@tonic-gate #define _IORW 0200 /* opened for reading and writing */
1460Sstevel@tonic-gate #define _IOMYBUF 0010 /* stdio malloc()'d buffer */
1470Sstevel@tonic-gate
1480Sstevel@tonic-gate #ifndef EOF
1490Sstevel@tonic-gate #define EOF (-1)
1500Sstevel@tonic-gate #endif
1510Sstevel@tonic-gate
1520Sstevel@tonic-gate #define FOPEN_MAX _NFILE
1530Sstevel@tonic-gate #define FILENAME_MAX 1024 /* max # of characters in a path name */
1540Sstevel@tonic-gate
1550Sstevel@tonic-gate #define SEEK_SET 0
1560Sstevel@tonic-gate #define SEEK_CUR 1
1570Sstevel@tonic-gate #define SEEK_END 2
1580Sstevel@tonic-gate #define TMP_MAX 17576 /* 26 * 26 * 26 */
1590Sstevel@tonic-gate
1600Sstevel@tonic-gate #define L_tmpnam 25 /* (sizeof(P_tmpdir) + 15) */
1610Sstevel@tonic-gate
1620Sstevel@tonic-gate #if defined(__STDC__)
1630Sstevel@tonic-gate extern __FILE __iob[_NFILE];
1640Sstevel@tonic-gate #define stdin (&__iob[0])
1650Sstevel@tonic-gate #define stdout (&__iob[1])
1660Sstevel@tonic-gate #define stderr (&__iob[2])
1670Sstevel@tonic-gate #else
1680Sstevel@tonic-gate extern __FILE _iob[_NFILE];
1690Sstevel@tonic-gate #define stdin (&_iob[0])
1700Sstevel@tonic-gate #define stdout (&_iob[1])
1710Sstevel@tonic-gate #define stderr (&_iob[2])
1720Sstevel@tonic-gate #endif /* __STDC__ */
1730Sstevel@tonic-gate
1740Sstevel@tonic-gate #if __cplusplus >= 199711L
1750Sstevel@tonic-gate namespace std {
1760Sstevel@tonic-gate #endif
1770Sstevel@tonic-gate
1780Sstevel@tonic-gate #if !defined(_LP64) && !defined(_LONGLONG_TYPE)
1790Sstevel@tonic-gate
1800Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
1810Sstevel@tonic-gate #pragma redefine_extname fprintf _fprintf_c89
1820Sstevel@tonic-gate #pragma redefine_extname printf _printf_c89
1830Sstevel@tonic-gate #pragma redefine_extname sprintf _sprintf_c89
1840Sstevel@tonic-gate #pragma redefine_extname vfprintf _vfprintf_c89
1850Sstevel@tonic-gate #pragma redefine_extname vprintf _vprintf_c89
1860Sstevel@tonic-gate #pragma redefine_extname vsprintf _vsprintf_c89
1870Sstevel@tonic-gate #pragma redefine_extname fscanf _fscanf_c89
1880Sstevel@tonic-gate #pragma redefine_extname scanf _scanf_c89
1890Sstevel@tonic-gate #pragma redefine_extname sscanf _sscanf_c89
1900Sstevel@tonic-gate #else
1910Sstevel@tonic-gate #define fprintf _fprintf_c89
1920Sstevel@tonic-gate #define printf _printf_c89
1930Sstevel@tonic-gate #define sprintf _sprintf_c89
1940Sstevel@tonic-gate #define vfprintf _vfprintf_c89
1950Sstevel@tonic-gate #define vprintf _vprintf_c89
1960Sstevel@tonic-gate #define vsprintf _vsprintf_c89
1970Sstevel@tonic-gate #define fscanf _fscanf_c89
1980Sstevel@tonic-gate #define scanf _scanf_c89
1990Sstevel@tonic-gate #define sscanf _sscanf_c89
2000Sstevel@tonic-gate #endif
2010Sstevel@tonic-gate
2020Sstevel@tonic-gate #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */
2030Sstevel@tonic-gate
2040Sstevel@tonic-gate #if defined(__STDC__)
2050Sstevel@tonic-gate
2060Sstevel@tonic-gate extern int remove(const char *);
2070Sstevel@tonic-gate extern int rename(const char *, const char *);
2080Sstevel@tonic-gate extern FILE *tmpfile(void);
2090Sstevel@tonic-gate extern char *tmpnam(char *);
2100Sstevel@tonic-gate extern int fclose(FILE *);
2110Sstevel@tonic-gate extern int fflush(FILE *);
2120Sstevel@tonic-gate extern FILE *fopen(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
2130Sstevel@tonic-gate extern FILE *freopen(const char *_RESTRICT_KYWD,
2140Sstevel@tonic-gate const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD);
2150Sstevel@tonic-gate extern void setbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
2160Sstevel@tonic-gate extern int setvbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD, int,
2170Sstevel@tonic-gate size_t);
2180Sstevel@tonic-gate /* PRINTFLIKE2 */
2190Sstevel@tonic-gate extern int fprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2200Sstevel@tonic-gate /* SCANFLIKE2 */
2210Sstevel@tonic-gate extern int fscanf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2220Sstevel@tonic-gate /* PRINTFLIKE1 */
2230Sstevel@tonic-gate extern int printf(const char *_RESTRICT_KYWD, ...);
2240Sstevel@tonic-gate /* SCANFLIKE1 */
2250Sstevel@tonic-gate extern int scanf(const char *_RESTRICT_KYWD, ...);
2260Sstevel@tonic-gate /* PRINTFLIKE2 */
2270Sstevel@tonic-gate extern int sprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2280Sstevel@tonic-gate /* SCANFLIKE2 */
2290Sstevel@tonic-gate extern int sscanf(const char *_RESTRICT_KYWD,
2300Sstevel@tonic-gate const char *_RESTRICT_KYWD, ...);
2310Sstevel@tonic-gate extern int vfprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
2320Sstevel@tonic-gate __va_list);
2330Sstevel@tonic-gate extern int vprintf(const char *_RESTRICT_KYWD, __va_list);
2340Sstevel@tonic-gate extern int vsprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
2350Sstevel@tonic-gate __va_list);
2360Sstevel@tonic-gate extern int fgetc(FILE *);
2370Sstevel@tonic-gate extern char *fgets(char *_RESTRICT_KYWD, int, FILE *_RESTRICT_KYWD);
2380Sstevel@tonic-gate extern int fputc(int, FILE *);
2390Sstevel@tonic-gate extern int fputs(const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD);
2400Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \
2410Sstevel@tonic-gate __cplusplus < 199711L
2420Sstevel@tonic-gate extern int getc(FILE *);
2430Sstevel@tonic-gate extern int putc(int, FILE *);
2440Sstevel@tonic-gate #endif
2450Sstevel@tonic-gate #if (__cplusplus >= 199711L && defined(_REENTRANT)) || \
2460Sstevel@tonic-gate __cplusplus < 199711L
2470Sstevel@tonic-gate extern int getchar(void);
2480Sstevel@tonic-gate extern int putchar(int);
2490Sstevel@tonic-gate #endif
2500Sstevel@tonic-gate extern char *gets(char *);
2510Sstevel@tonic-gate extern int puts(const char *);
2520Sstevel@tonic-gate extern int ungetc(int, FILE *);
2530Sstevel@tonic-gate extern size_t fread(void *_RESTRICT_KYWD, size_t, size_t,
2540Sstevel@tonic-gate FILE *_RESTRICT_KYWD);
2550Sstevel@tonic-gate extern size_t fwrite(const void *_RESTRICT_KYWD, size_t, size_t,
2560Sstevel@tonic-gate FILE *_RESTRICT_KYWD);
2570Sstevel@tonic-gate #if !defined(__lint) || defined(_LP64) || _FILE_OFFSET_BITS == 32
2580Sstevel@tonic-gate extern int fgetpos(FILE *_RESTRICT_KYWD, fpos_t *_RESTRICT_KYWD);
2590Sstevel@tonic-gate extern int fsetpos(FILE *, const fpos_t *);
2600Sstevel@tonic-gate #endif
2610Sstevel@tonic-gate extern int fseek(FILE *, long, int);
2620Sstevel@tonic-gate extern long ftell(FILE *);
2630Sstevel@tonic-gate extern void rewind(FILE *);
2640Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \
2650Sstevel@tonic-gate __cplusplus < 199711L
2660Sstevel@tonic-gate extern void clearerr(FILE *);
2670Sstevel@tonic-gate extern int feof(FILE *);
2680Sstevel@tonic-gate extern int ferror(FILE *);
2690Sstevel@tonic-gate #endif
2700Sstevel@tonic-gate extern void perror(const char *);
2710Sstevel@tonic-gate
2720Sstevel@tonic-gate #ifndef _LP64
2730Sstevel@tonic-gate extern int __filbuf(FILE *);
2740Sstevel@tonic-gate extern int __flsbuf(int, FILE *);
2750Sstevel@tonic-gate #endif /* _LP64 */
2760Sstevel@tonic-gate
2770Sstevel@tonic-gate #else /* !defined __STDC__ */
2780Sstevel@tonic-gate
2790Sstevel@tonic-gate extern int remove();
2800Sstevel@tonic-gate extern int rename();
2810Sstevel@tonic-gate extern FILE *tmpfile();
2820Sstevel@tonic-gate extern char *tmpnam();
2830Sstevel@tonic-gate extern int fclose();
2840Sstevel@tonic-gate extern int fflush();
2850Sstevel@tonic-gate extern FILE *fopen();
2860Sstevel@tonic-gate extern FILE *freopen();
2870Sstevel@tonic-gate extern void setbuf();
2880Sstevel@tonic-gate extern int setvbuf();
2890Sstevel@tonic-gate extern int fprintf();
2900Sstevel@tonic-gate extern int fscanf();
2910Sstevel@tonic-gate extern int printf();
2920Sstevel@tonic-gate extern int scanf();
2930Sstevel@tonic-gate extern int sprintf();
2940Sstevel@tonic-gate extern int sscanf();
2950Sstevel@tonic-gate extern int vfprintf();
2960Sstevel@tonic-gate extern int vprintf();
2970Sstevel@tonic-gate extern int vsprintf();
2980Sstevel@tonic-gate extern int fgetc();
2990Sstevel@tonic-gate extern char *fgets();
3000Sstevel@tonic-gate extern int fputc();
3010Sstevel@tonic-gate extern int fputs();
3020Sstevel@tonic-gate extern int getc();
3030Sstevel@tonic-gate extern int getchar();
3040Sstevel@tonic-gate extern char *gets();
3050Sstevel@tonic-gate extern int putc();
3060Sstevel@tonic-gate extern int putchar();
3070Sstevel@tonic-gate extern int puts();
3080Sstevel@tonic-gate extern int ungetc();
3090Sstevel@tonic-gate extern size_t fread();
3100Sstevel@tonic-gate extern size_t fwrite();
3110Sstevel@tonic-gate extern int fgetpos();
3120Sstevel@tonic-gate extern int fseek();
3130Sstevel@tonic-gate extern int fsetpos();
3140Sstevel@tonic-gate extern long ftell();
3150Sstevel@tonic-gate extern void rewind();
3160Sstevel@tonic-gate extern void clearerr();
3170Sstevel@tonic-gate extern int feof();
3180Sstevel@tonic-gate extern int ferror();
3190Sstevel@tonic-gate extern void perror();
3200Sstevel@tonic-gate
3210Sstevel@tonic-gate #ifndef _LP64
3220Sstevel@tonic-gate extern int _filbuf();
3230Sstevel@tonic-gate extern int _flsbuf();
3240Sstevel@tonic-gate #endif /* _LP64 */
3250Sstevel@tonic-gate
3260Sstevel@tonic-gate #endif /* __STDC__ */
3270Sstevel@tonic-gate
3280Sstevel@tonic-gate #if __cplusplus >= 199711L
3290Sstevel@tonic-gate }
3300Sstevel@tonic-gate #endif /* end of namespace std */
3310Sstevel@tonic-gate
3320Sstevel@tonic-gate #if !defined(__lint)
3330Sstevel@tonic-gate
334*11Smuffin #if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)
3350Sstevel@tonic-gate
3360Sstevel@tonic-gate #ifdef __STDC__
3370Sstevel@tonic-gate #if __cplusplus >= 199711L
3380Sstevel@tonic-gate namespace std {
getc(FILE * _p)3390Sstevel@tonic-gate inline int getc(FILE *_p) {
3400Sstevel@tonic-gate return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
putc(int _x,FILE * _p)3410Sstevel@tonic-gate inline int putc(int _x, FILE *_p) {
3420Sstevel@tonic-gate return (--_p->_cnt < 0 ? __flsbuf(_x, _p)
3430Sstevel@tonic-gate : (int)(*_p->_ptr++ = (unsigned char) _x)); }
3440Sstevel@tonic-gate }
3450Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
3460Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
3470Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \
3480Sstevel@tonic-gate : (int)(*(p)->_ptr++ = (unsigned char) (x)))
3490Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3500Sstevel@tonic-gate #else /* __STDC__ */
3510Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int)*(p)->_ptr++)
3520Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((x), (p)) : \
3530Sstevel@tonic-gate (int)(*(p)->_ptr++ = (unsigned char) (x)))
3540Sstevel@tonic-gate #endif /* __STDC__ */
355*11Smuffin
356*11Smuffin #endif /* !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) */
357*11Smuffin
358*11Smuffin #ifndef _REENTRANT
3590Sstevel@tonic-gate
3600Sstevel@tonic-gate #if __cplusplus >= 199711L
3610Sstevel@tonic-gate namespace std {
getchar()3620Sstevel@tonic-gate inline int getchar() { return getc(stdin); }
putchar(int _x)3630Sstevel@tonic-gate inline int putchar(int _x) { return putc(_x, stdout); }
3640Sstevel@tonic-gate }
3650Sstevel@tonic-gate #else
3660Sstevel@tonic-gate #define getchar() getc(stdin)
3670Sstevel@tonic-gate #define putchar(x) putc((x), stdout)
3680Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3690Sstevel@tonic-gate
3700Sstevel@tonic-gate #ifndef _LP64
3710Sstevel@tonic-gate #if __cplusplus >= 199711L
3720Sstevel@tonic-gate namespace std {
clearerr(FILE * _p)3730Sstevel@tonic-gate inline void clearerr(FILE *_p) { _p->_flag &= ~(_IOERR | _IOEOF); }
feof(FILE * _p)3740Sstevel@tonic-gate inline int feof(FILE *_p) { return _p->_flag & _IOEOF; }
ferror(FILE * _p)3750Sstevel@tonic-gate inline int ferror(FILE *_p) { return _p->_flag & _IOERR; }
3760Sstevel@tonic-gate }
3770Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
3780Sstevel@tonic-gate #define clearerr(p) ((void)((p)->_flag &= ~(_IOERR | _IOEOF)))
3790Sstevel@tonic-gate #define feof(p) ((p)->_flag & _IOEOF)
3800Sstevel@tonic-gate #define ferror(p) ((p)->_flag & _IOERR)
3810Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3820Sstevel@tonic-gate #endif /* _LP64 */
3830Sstevel@tonic-gate
3840Sstevel@tonic-gate #endif /* _REENTRANT */
3850Sstevel@tonic-gate
3860Sstevel@tonic-gate #endif /* !defined(__lint) */
3870Sstevel@tonic-gate
3880Sstevel@tonic-gate #ifdef __cplusplus
3890Sstevel@tonic-gate }
3900Sstevel@tonic-gate #endif
3910Sstevel@tonic-gate
3920Sstevel@tonic-gate #endif /* _ISO_STDIO_ISO_H */
393