17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate * with the License.
87c478bd9Sstevel@tonic-gate *
97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate * and limitations under the License.
137c478bd9Sstevel@tonic-gate *
147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate *
207c478bd9Sstevel@tonic-gate * CDDL HEADER END
217c478bd9Sstevel@tonic-gate */
227c478bd9Sstevel@tonic-gate /*
23*b59b3655SGarrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24*b59b3655SGarrett D'Amore *
2550b37527Smuffin * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
267c478bd9Sstevel@tonic-gate * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate */
287c478bd9Sstevel@tonic-gate
2950b37527Smuffin /* Copyright (c) 1988 AT&T */
3050b37527Smuffin /* All Rights Reserved */
3150b37527Smuffin
327c478bd9Sstevel@tonic-gate /*
337c478bd9Sstevel@tonic-gate * An application should not include this header directly. Instead it
347c478bd9Sstevel@tonic-gate * should be included only through the inclusion of other Sun headers.
357c478bd9Sstevel@tonic-gate *
367c478bd9Sstevel@tonic-gate * The contents of this header is limited to identifiers specified in the
377c478bd9Sstevel@tonic-gate * C Standard. Any new identifiers specified in future amendments to the
387c478bd9Sstevel@tonic-gate * C Standard must be placed in this header. If these new identifiers
397c478bd9Sstevel@tonic-gate * are required to also be in the C++ Standard "std" namespace, then for
407c478bd9Sstevel@tonic-gate * anything other than macro definitions, corresponding "using" directives
417c478bd9Sstevel@tonic-gate * must also be added to <stdio.h>.
427c478bd9Sstevel@tonic-gate */
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate * User-visible pieces of the ANSI C standard I/O package.
467c478bd9Sstevel@tonic-gate */
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gate #ifndef _ISO_STDIO_ISO_H
497c478bd9Sstevel@tonic-gate #define _ISO_STDIO_ISO_H
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
527c478bd9Sstevel@tonic-gate #include <sys/va_list.h>
537c478bd9Sstevel@tonic-gate #include <stdio_tag.h>
547c478bd9Sstevel@tonic-gate #include <stdio_impl.h>
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate /*
577c478bd9Sstevel@tonic-gate * If feature test macros are set that enable interfaces that use types
587c478bd9Sstevel@tonic-gate * defined in <sys/types.h>, get those types by doing the include.
597c478bd9Sstevel@tonic-gate *
607c478bd9Sstevel@tonic-gate * Note that in asking for the interfaces associated with this feature test
617c478bd9Sstevel@tonic-gate * macro one also asks for definitions of the POSIX types.
627c478bd9Sstevel@tonic-gate */
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate #ifdef __cplusplus
657c478bd9Sstevel@tonic-gate extern "C" {
667c478bd9Sstevel@tonic-gate #endif
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate #if !defined(_LP64) && (_FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE))
697c478bd9Sstevel@tonic-gate /*
707c478bd9Sstevel@tonic-gate * The following typedefs are adopted from ones in <sys/types.h> (with leading
717c478bd9Sstevel@tonic-gate * underscores added to avoid polluting the ANSI C name space). See the
727c478bd9Sstevel@tonic-gate * commentary there for further explanation.
737c478bd9Sstevel@tonic-gate */
747c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
757c478bd9Sstevel@tonic-gate typedef long long __longlong_t;
767c478bd9Sstevel@tonic-gate #else
777c478bd9Sstevel@tonic-gate /* used to reserve space and generate alignment */
787c478bd9Sstevel@tonic-gate typedef union {
797c478bd9Sstevel@tonic-gate double _d;
807c478bd9Sstevel@tonic-gate int _l[2];
817c478bd9Sstevel@tonic-gate } __longlong_t;
827c478bd9Sstevel@tonic-gate #endif
837c478bd9Sstevel@tonic-gate #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 || defined(_LARGEFILE64_SOURCE) */
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
867c478bd9Sstevel@tonic-gate namespace std {
877c478bd9Sstevel@tonic-gate #endif
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gate #if !defined(_FILEDEFED) || __cplusplus >= 199711L
907c478bd9Sstevel@tonic-gate #define _FILEDEFED
917c478bd9Sstevel@tonic-gate typedef __FILE FILE;
927c478bd9Sstevel@tonic-gate #endif
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
957c478bd9Sstevel@tonic-gate #define _SIZE_T
967c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
977c478bd9Sstevel@tonic-gate typedef unsigned long size_t; /* size of something in bytes */
987c478bd9Sstevel@tonic-gate #else
997c478bd9Sstevel@tonic-gate typedef unsigned int size_t; /* (historical version) */
1007c478bd9Sstevel@tonic-gate #endif
1017c478bd9Sstevel@tonic-gate #endif /* !_SIZE_T */
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gate #if defined(_LP64) || _FILE_OFFSET_BITS == 32
1047c478bd9Sstevel@tonic-gate typedef long fpos_t;
1057c478bd9Sstevel@tonic-gate #else
1067c478bd9Sstevel@tonic-gate typedef __longlong_t fpos_t;
1077c478bd9Sstevel@tonic-gate #endif
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
1107c478bd9Sstevel@tonic-gate }
1117c478bd9Sstevel@tonic-gate #endif /* end of namespace std */
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gate #ifndef NULL
1147c478bd9Sstevel@tonic-gate #if defined(_LP64)
1157c478bd9Sstevel@tonic-gate #define NULL 0L
1167c478bd9Sstevel@tonic-gate #else
1177c478bd9Sstevel@tonic-gate #define NULL 0
1187c478bd9Sstevel@tonic-gate #endif
1197c478bd9Sstevel@tonic-gate #endif
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gate #define BUFSIZ 1024
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate /*
1247c478bd9Sstevel@tonic-gate * The value of _NFILE is defined in the Processor Specific ABI. The value
1257c478bd9Sstevel@tonic-gate * is chosen for historical reasons rather than for truly processor related
1267c478bd9Sstevel@tonic-gate * attribute. Note that the SPARC Processor Specific ABI uses the common
1277c478bd9Sstevel@tonic-gate * UNIX historical value of 20 so it is allowed to fall through.
1287c478bd9Sstevel@tonic-gate */
1297c478bd9Sstevel@tonic-gate #if defined(__i386)
1307c478bd9Sstevel@tonic-gate #define _NFILE 60 /* initial number of streams: Intel x86 ABI */
1317c478bd9Sstevel@tonic-gate #else
1327c478bd9Sstevel@tonic-gate #define _NFILE 20 /* initial number of streams: SPARC ABI and default */
1337c478bd9Sstevel@tonic-gate #endif
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate #define _SBFSIZ 8 /* compatibility with shared libs */
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gate #define _IOFBF 0000 /* full buffered */
1387c478bd9Sstevel@tonic-gate #define _IOLBF 0100 /* line buffered */
1397c478bd9Sstevel@tonic-gate #define _IONBF 0004 /* not buffered */
1407c478bd9Sstevel@tonic-gate #define _IOEOF 0020 /* EOF reached on read */
1417c478bd9Sstevel@tonic-gate #define _IOERR 0040 /* I/O error from system */
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gate #define _IOREAD 0001 /* currently reading */
1447c478bd9Sstevel@tonic-gate #define _IOWRT 0002 /* currently writing */
1457c478bd9Sstevel@tonic-gate #define _IORW 0200 /* opened for reading and writing */
1467c478bd9Sstevel@tonic-gate #define _IOMYBUF 0010 /* stdio malloc()'d buffer */
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate #ifndef EOF
1497c478bd9Sstevel@tonic-gate #define EOF (-1)
1507c478bd9Sstevel@tonic-gate #endif
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gate #define FOPEN_MAX _NFILE
1537c478bd9Sstevel@tonic-gate #define FILENAME_MAX 1024 /* max # of characters in a path name */
1547c478bd9Sstevel@tonic-gate
1557c478bd9Sstevel@tonic-gate #define SEEK_SET 0
1567c478bd9Sstevel@tonic-gate #define SEEK_CUR 1
1577c478bd9Sstevel@tonic-gate #define SEEK_END 2
1587c478bd9Sstevel@tonic-gate #define TMP_MAX 17576 /* 26 * 26 * 26 */
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate #define L_tmpnam 25 /* (sizeof(P_tmpdir) + 15) */
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gate extern __FILE __iob[_NFILE];
1637c478bd9Sstevel@tonic-gate #define stdin (&__iob[0])
1647c478bd9Sstevel@tonic-gate #define stdout (&__iob[1])
1657c478bd9Sstevel@tonic-gate #define stderr (&__iob[2])
1667c478bd9Sstevel@tonic-gate
1677c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
1687c478bd9Sstevel@tonic-gate namespace std {
1697c478bd9Sstevel@tonic-gate #endif
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gate #if !defined(_LP64) && !defined(_LONGLONG_TYPE)
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
1747c478bd9Sstevel@tonic-gate #pragma redefine_extname fprintf _fprintf_c89
1757c478bd9Sstevel@tonic-gate #pragma redefine_extname printf _printf_c89
1767c478bd9Sstevel@tonic-gate #pragma redefine_extname sprintf _sprintf_c89
1777c478bd9Sstevel@tonic-gate #pragma redefine_extname vfprintf _vfprintf_c89
1787c478bd9Sstevel@tonic-gate #pragma redefine_extname vprintf _vprintf_c89
1797c478bd9Sstevel@tonic-gate #pragma redefine_extname vsprintf _vsprintf_c89
1807c478bd9Sstevel@tonic-gate #pragma redefine_extname fscanf _fscanf_c89
1817c478bd9Sstevel@tonic-gate #pragma redefine_extname scanf _scanf_c89
1827c478bd9Sstevel@tonic-gate #pragma redefine_extname sscanf _sscanf_c89
1837c478bd9Sstevel@tonic-gate #else
1847c478bd9Sstevel@tonic-gate #define fprintf _fprintf_c89
1857c478bd9Sstevel@tonic-gate #define printf _printf_c89
1867c478bd9Sstevel@tonic-gate #define sprintf _sprintf_c89
1877c478bd9Sstevel@tonic-gate #define vfprintf _vfprintf_c89
1887c478bd9Sstevel@tonic-gate #define vprintf _vprintf_c89
1897c478bd9Sstevel@tonic-gate #define vsprintf _vsprintf_c89
1907c478bd9Sstevel@tonic-gate #define fscanf _fscanf_c89
1917c478bd9Sstevel@tonic-gate #define scanf _scanf_c89
1927c478bd9Sstevel@tonic-gate #define sscanf _sscanf_c89
1937c478bd9Sstevel@tonic-gate #endif
1947c478bd9Sstevel@tonic-gate
1957c478bd9Sstevel@tonic-gate #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */
1967c478bd9Sstevel@tonic-gate
1977c478bd9Sstevel@tonic-gate extern int remove(const char *);
1987c478bd9Sstevel@tonic-gate extern int rename(const char *, const char *);
1997c478bd9Sstevel@tonic-gate extern FILE *tmpfile(void);
2007c478bd9Sstevel@tonic-gate extern char *tmpnam(char *);
2017c478bd9Sstevel@tonic-gate extern int fclose(FILE *);
2027c478bd9Sstevel@tonic-gate extern int fflush(FILE *);
2037c478bd9Sstevel@tonic-gate extern FILE *fopen(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
2047c478bd9Sstevel@tonic-gate extern FILE *freopen(const char *_RESTRICT_KYWD,
2057c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD);
2067c478bd9Sstevel@tonic-gate extern void setbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
2077c478bd9Sstevel@tonic-gate extern int setvbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD, int,
2087c478bd9Sstevel@tonic-gate size_t);
2097c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */
2107c478bd9Sstevel@tonic-gate extern int fprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2117c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */
2127c478bd9Sstevel@tonic-gate extern int fscanf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2137c478bd9Sstevel@tonic-gate /* PRINTFLIKE1 */
2147c478bd9Sstevel@tonic-gate extern int printf(const char *_RESTRICT_KYWD, ...);
2157c478bd9Sstevel@tonic-gate /* SCANFLIKE1 */
2167c478bd9Sstevel@tonic-gate extern int scanf(const char *_RESTRICT_KYWD, ...);
2177c478bd9Sstevel@tonic-gate /* PRINTFLIKE2 */
2187c478bd9Sstevel@tonic-gate extern int sprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, ...);
2197c478bd9Sstevel@tonic-gate /* SCANFLIKE2 */
2207c478bd9Sstevel@tonic-gate extern int sscanf(const char *_RESTRICT_KYWD,
2217c478bd9Sstevel@tonic-gate const char *_RESTRICT_KYWD, ...);
2227c478bd9Sstevel@tonic-gate extern int vfprintf(FILE *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
2237c478bd9Sstevel@tonic-gate __va_list);
2247c478bd9Sstevel@tonic-gate extern int vprintf(const char *_RESTRICT_KYWD, __va_list);
2257c478bd9Sstevel@tonic-gate extern int vsprintf(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
2267c478bd9Sstevel@tonic-gate __va_list);
2277c478bd9Sstevel@tonic-gate extern int fgetc(FILE *);
2287c478bd9Sstevel@tonic-gate extern char *fgets(char *_RESTRICT_KYWD, int, FILE *_RESTRICT_KYWD);
2297c478bd9Sstevel@tonic-gate extern int fputc(int, FILE *);
2307c478bd9Sstevel@tonic-gate extern int fputs(const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD);
2317c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \
2327c478bd9Sstevel@tonic-gate __cplusplus < 199711L
2337c478bd9Sstevel@tonic-gate extern int getc(FILE *);
2347c478bd9Sstevel@tonic-gate extern int putc(int, FILE *);
2357c478bd9Sstevel@tonic-gate #endif
2367c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && defined(_REENTRANT)) || \
2377c478bd9Sstevel@tonic-gate __cplusplus < 199711L
2387c478bd9Sstevel@tonic-gate extern int getchar(void);
2397c478bd9Sstevel@tonic-gate extern int putchar(int);
2407c478bd9Sstevel@tonic-gate #endif
2417c478bd9Sstevel@tonic-gate extern char *gets(char *);
2427c478bd9Sstevel@tonic-gate extern int puts(const char *);
2437c478bd9Sstevel@tonic-gate extern int ungetc(int, FILE *);
2447c478bd9Sstevel@tonic-gate extern size_t fread(void *_RESTRICT_KYWD, size_t, size_t,
2457c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD);
2467c478bd9Sstevel@tonic-gate extern size_t fwrite(const void *_RESTRICT_KYWD, size_t, size_t,
2477c478bd9Sstevel@tonic-gate FILE *_RESTRICT_KYWD);
2487c478bd9Sstevel@tonic-gate #if !defined(__lint) || defined(_LP64) || _FILE_OFFSET_BITS == 32
2497c478bd9Sstevel@tonic-gate extern int fgetpos(FILE *_RESTRICT_KYWD, fpos_t *_RESTRICT_KYWD);
2507c478bd9Sstevel@tonic-gate extern int fsetpos(FILE *, const fpos_t *);
2517c478bd9Sstevel@tonic-gate #endif
2527c478bd9Sstevel@tonic-gate extern int fseek(FILE *, long, int);
2537c478bd9Sstevel@tonic-gate extern long ftell(FILE *);
2547c478bd9Sstevel@tonic-gate extern void rewind(FILE *);
2557c478bd9Sstevel@tonic-gate #if (__cplusplus >= 199711L && (defined(_LP64) || defined(_REENTRANT))) || \
2567c478bd9Sstevel@tonic-gate __cplusplus < 199711L
2577c478bd9Sstevel@tonic-gate extern void clearerr(FILE *);
2587c478bd9Sstevel@tonic-gate extern int feof(FILE *);
2597c478bd9Sstevel@tonic-gate extern int ferror(FILE *);
2607c478bd9Sstevel@tonic-gate #endif
2617c478bd9Sstevel@tonic-gate extern void perror(const char *);
2627c478bd9Sstevel@tonic-gate
2637c478bd9Sstevel@tonic-gate #ifndef _LP64
2647c478bd9Sstevel@tonic-gate extern int __filbuf(FILE *);
2657c478bd9Sstevel@tonic-gate extern int __flsbuf(int, FILE *);
2667c478bd9Sstevel@tonic-gate #endif /* _LP64 */
2677c478bd9Sstevel@tonic-gate
2687c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
2697c478bd9Sstevel@tonic-gate }
2707c478bd9Sstevel@tonic-gate #endif /* end of namespace std */
2717c478bd9Sstevel@tonic-gate
2727c478bd9Sstevel@tonic-gate #if !defined(__lint)
2737c478bd9Sstevel@tonic-gate
274693e4d84SAlexander Pyhalov #if !defined(_REENTRANT) && !defined(_LP64)
2757c478bd9Sstevel@tonic-gate
2767c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
2777c478bd9Sstevel@tonic-gate namespace std {
getc(FILE * _p)2787c478bd9Sstevel@tonic-gate inline int getc(FILE *_p) {
2797c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
putc(int _x,FILE * _p)2807c478bd9Sstevel@tonic-gate inline int putc(int _x, FILE *_p) {
2817c478bd9Sstevel@tonic-gate return (--_p->_cnt < 0 ? __flsbuf(_x, _p)
2827c478bd9Sstevel@tonic-gate : (int)(*_p->_ptr++ = (unsigned char) _x)); }
2837c478bd9Sstevel@tonic-gate }
2847c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
2857c478bd9Sstevel@tonic-gate #define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
2867c478bd9Sstevel@tonic-gate #define putc(x, p) (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \
2877c478bd9Sstevel@tonic-gate : (int)(*(p)->_ptr++ = (unsigned char) (x)))
2887c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
28950b37527Smuffin
290693e4d84SAlexander Pyhalov #endif /* !defined(_REENTRANT) && !defined(_LP64) */
29150b37527Smuffin
29250b37527Smuffin #ifndef _REENTRANT
2937c478bd9Sstevel@tonic-gate
2947c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
2957c478bd9Sstevel@tonic-gate namespace std {
getchar()2967c478bd9Sstevel@tonic-gate inline int getchar() { return getc(stdin); }
putchar(int _x)2977c478bd9Sstevel@tonic-gate inline int putchar(int _x) { return putc(_x, stdout); }
2987c478bd9Sstevel@tonic-gate }
2997c478bd9Sstevel@tonic-gate #else
3007c478bd9Sstevel@tonic-gate #define getchar() getc(stdin)
3017c478bd9Sstevel@tonic-gate #define putchar(x) putc((x), stdout)
3027c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3037c478bd9Sstevel@tonic-gate
3047c478bd9Sstevel@tonic-gate #ifndef _LP64
3057c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
3067c478bd9Sstevel@tonic-gate namespace std {
clearerr(FILE * _p)3077c478bd9Sstevel@tonic-gate inline void clearerr(FILE *_p) { _p->_flag &= ~(_IOERR | _IOEOF); }
feof(FILE * _p)3087c478bd9Sstevel@tonic-gate inline int feof(FILE *_p) { return _p->_flag & _IOEOF; }
ferror(FILE * _p)3097c478bd9Sstevel@tonic-gate inline int ferror(FILE *_p) { return _p->_flag & _IOERR; }
3107c478bd9Sstevel@tonic-gate }
3117c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
3127c478bd9Sstevel@tonic-gate #define clearerr(p) ((void)((p)->_flag &= ~(_IOERR | _IOEOF)))
3137c478bd9Sstevel@tonic-gate #define feof(p) ((p)->_flag & _IOEOF)
3147c478bd9Sstevel@tonic-gate #define ferror(p) ((p)->_flag & _IOERR)
3157c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3167c478bd9Sstevel@tonic-gate #endif /* _LP64 */
3177c478bd9Sstevel@tonic-gate
3187c478bd9Sstevel@tonic-gate #endif /* _REENTRANT */
3197c478bd9Sstevel@tonic-gate
3207c478bd9Sstevel@tonic-gate #endif /* !defined(__lint) */
3217c478bd9Sstevel@tonic-gate
3227c478bd9Sstevel@tonic-gate #ifdef __cplusplus
3237c478bd9Sstevel@tonic-gate }
3247c478bd9Sstevel@tonic-gate #endif
3257c478bd9Sstevel@tonic-gate
3267c478bd9Sstevel@tonic-gate #endif /* _ISO_STDIO_ISO_H */
327