17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5d098320Roger A. Faulkner * Common Development and Distribution License (the "License").
6d098320Roger A. Faulkner * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate
227c478bdstevel@tonic-gate/*
23ba3594bGarrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org>
2423a1cceRoger A. Faulkner * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
27d098320Roger A. Faulkner/*	Copyright (c) 1988 AT&T	*/
28b4203d7Marcel Telka/*	  All Rights Reserved	*/
29d098320Roger A. Faulkner
307c478bdstevel@tonic-gate/*
317c478bdstevel@tonic-gate * User-visible pieces of the ANSI C standard I/O package.
327c478bdstevel@tonic-gate */
337c478bdstevel@tonic-gate
347c478bdstevel@tonic-gate#ifndef _STDIO_H
357c478bdstevel@tonic-gate#define	_STDIO_H
367c478bdstevel@tonic-gate
377c478bdstevel@tonic-gate#include <sys/feature_tests.h>
387c478bdstevel@tonic-gate
397c478bdstevel@tonic-gate#ifdef	__cplusplus
407c478bdstevel@tonic-gateextern "C" {
417c478bdstevel@tonic-gate#endif
427c478bdstevel@tonic-gate
437c478bdstevel@tonic-gate/*
447c478bdstevel@tonic-gate * Do all of our 'redefine_extname' processing before
457c478bdstevel@tonic-gate * declarations of the associated functions are seen.
467c478bdstevel@tonic-gate * This is necessary to keep gcc happy.
477c478bdstevel@tonic-gate */
487c478bdstevel@tonic-gate#if defined(__PRAGMA_REDEFINE_EXTNAME)
497c478bdstevel@tonic-gate
507c478bdstevel@tonic-gate/* large file compilation environment setup */
517c478bdstevel@tonic-gate#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
527c478bdstevel@tonic-gate#pragma redefine_extname	fopen		fopen64
537c478bdstevel@tonic-gate#pragma redefine_extname	freopen		freopen64
547c478bdstevel@tonic-gate#pragma redefine_extname	tmpfile		tmpfile64
557c478bdstevel@tonic-gate#pragma redefine_extname	fgetpos		fgetpos64
567c478bdstevel@tonic-gate#pragma redefine_extname	fsetpos		fsetpos64
577c478bdstevel@tonic-gate#if defined(_LARGEFILE_SOURCE)
587c478bdstevel@tonic-gate#pragma redefine_extname	fseeko		fseeko64
597c478bdstevel@tonic-gate#pragma redefine_extname	ftello		ftello64
607c478bdstevel@tonic-gate#endif	/* _LARGEFILE_SOURCE */
617c478bdstevel@tonic-gate#endif	/* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */
627c478bdstevel@tonic-gate
637c478bdstevel@tonic-gate/* In the LP64 compilation environment, all APIs are already large file */
647c478bdstevel@tonic-gate#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
657c478bdstevel@tonic-gate#pragma redefine_extname	fopen64		fopen
667c478bdstevel@tonic-gate#pragma redefine_extname	freopen64	freopen
677c478bdstevel@tonic-gate#pragma redefine_extname	tmpfile64	tmpfile
687c478bdstevel@tonic-gate#pragma redefine_extname	fgetpos64	fgetpos
697c478bdstevel@tonic-gate#pragma redefine_extname	fsetpos64	fsetpos
707c478bdstevel@tonic-gate#if defined(_LARGEFILE_SOURCE)
717c478bdstevel@tonic-gate#pragma redefine_extname	fseeko64	fseeko
727c478bdstevel@tonic-gate#pragma redefine_extname	ftello64	ftello
737c478bdstevel@tonic-gate#endif	/* _LARGEFILE_SOURCE */
747c478bdstevel@tonic-gate#endif	/* defined(_LP64) && defined(_LARGEFILE64_SOURCE) */
757c478bdstevel@tonic-gate
767c478bdstevel@tonic-gate#endif	/* __PRAGMA_REDEFINE_EXTNAME */
777c478bdstevel@tonic-gate
787c478bdstevel@tonic-gate#ifdef	__cplusplus
797c478bdstevel@tonic-gate}
807c478bdstevel@tonic-gate#endif
817c478bdstevel@tonic-gate
827c478bdstevel@tonic-gate#include <iso/stdio_iso.h>
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gate/*
857c478bdstevel@tonic-gate * If feature test macros are set that enable interfaces that use types
867c478bdstevel@tonic-gate * defined in <sys/types.h>, get those types by doing the include.
877c478bdstevel@tonic-gate *
887c478bdstevel@tonic-gate * Note that in asking for the interfaces associated with this feature test
897c478bdstevel@tonic-gate * macro one also asks for definitions of the POSIX types.
907c478bdstevel@tonic-gate */
917c478bdstevel@tonic-gate
927c478bdstevel@tonic-gate/*
937c478bdstevel@tonic-gate * Allow global visibility for symbols defined in
947c478bdstevel@tonic-gate * C++ "std" namespace in <iso/stdio_iso.h>.
957c478bdstevel@tonic-gate */
967c478bdstevel@tonic-gate#if __cplusplus >= 199711L
977c478bdstevel@tonic-gateusing std::FILE;
987c478bdstevel@tonic-gateusing std::size_t;
997c478bdstevel@tonic-gateusing std::fpos_t;
1007c478bdstevel@tonic-gateusing std::remove;
1017c478bdstevel@tonic-gateusing std::rename;
1027c478bdstevel@tonic-gateusing std::tmpfile;
1037c478bdstevel@tonic-gateusing std::tmpnam;
1047c478bdstevel@tonic-gateusing std::fclose;
1057c478bdstevel@tonic-gateusing std::fflush;
1067c478bdstevel@tonic-gateusing std::fopen;
1077c478bdstevel@tonic-gateusing std::freopen;
1087c478bdstevel@tonic-gateusing std::setbuf;
1097c478bdstevel@tonic-gateusing std::setvbuf;
1107c478bdstevel@tonic-gateusing std::fprintf;
1117c478bdstevel@tonic-gateusing std::fscanf;
1127c478bdstevel@tonic-gateusing std::printf;
1137c478bdstevel@tonic-gateusing std::scanf;
1147c478bdstevel@tonic-gateusing std::sprintf;
1157c478bdstevel@tonic-gateusing std::sscanf;
1167c478bdstevel@tonic-gateusing std::vfprintf;
1177c478bdstevel@tonic-gateusing std::vprintf;
1187c478bdstevel@tonic-gateusing std::vsprintf;
1197c478bdstevel@tonic-gateusing std::fgetc;
1207c478bdstevel@tonic-gateusing std::fgets;
1217c478bdstevel@tonic-gateusing std::fputc;
1227c478bdstevel@tonic-gateusing std::fputs;
1237c478bdstevel@tonic-gateusing std::getc;
1247c478bdstevel@tonic-gateusing std::getchar;
1257c478bdstevel@tonic-gateusing std::gets;
1267c478bdstevel@tonic-gateusing std::putc;
1277c478bdstevel@tonic-gateusing std::putchar;
1287c478bdstevel@tonic-gateusing std::puts;
1297c478bdstevel@tonic-gateusing std::ungetc;
1307c478bdstevel@tonic-gateusing std::fread;
1317c478bdstevel@tonic-gateusing std::fwrite;
1327c478bdstevel@tonic-gateusing std::fgetpos;
1337c478bdstevel@tonic-gateusing std::fseek;
1347c478bdstevel@tonic-gateusing std::fsetpos;
1357c478bdstevel@tonic-gateusing std::ftell;
1367c478bdstevel@tonic-gateusing std::rewind;
1377c478bdstevel@tonic-gateusing std::clearerr;
1387c478bdstevel@tonic-gateusing std::feof;
1397c478bdstevel@tonic-gateusing std::ferror;
1407c478bdstevel@tonic-gateusing std::perror;
1417c478bdstevel@tonic-gate#ifndef	_LP64
1427c478bdstevel@tonic-gateusing std::__filbuf;
1437c478bdstevel@tonic-gateusing std::__flsbuf;
1447c478bdstevel@tonic-gate#endif	/* _LP64 */
1457c478bdstevel@tonic-gate#endif	/*  __cplusplus >= 199711L */
1467c478bdstevel@tonic-gate
1477c478bdstevel@tonic-gate/*
1487c478bdstevel@tonic-gate * This header needs to be included here because it relies on the global
1497c478bdstevel@tonic-gate * visibility of FILE and size_t in the C++ environment.
1507c478bdstevel@tonic-gate */
1517c478bdstevel@tonic-gate#include <iso/stdio_c99.h>
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gate#ifdef	__cplusplus
1547c478bdstevel@tonic-gateextern "C" {
1557c478bdstevel@tonic-gate#endif
1567c478bdstevel@tonic-gate
1577c478bdstevel@tonic-gate#if defined(_LARGEFILE_SOURCE) || defined(_XPG5)
1587c478bdstevel@tonic-gate#ifndef	_OFF_T
1597c478bdstevel@tonic-gate#define	_OFF_T
1607c478bdstevel@tonic-gate#if defined(_LP64) || _FILE_OFFSET_BITS == 32
1617c478bdstevel@tonic-gatetypedef long		off_t;
1627c478bdstevel@tonic-gate#else
1637c478bdstevel@tonic-gatetypedef __longlong_t	off_t;
1647c478bdstevel@tonic-gate#endif
1657c478bdstevel@tonic-gate#ifdef	_LARGEFILE64_SOURCE
1667c478bdstevel@tonic-gate#ifdef _LP64
1677c478bdstevel@tonic-gatetypedef	off_t		off64_t;
1687c478bdstevel@tonic-gate#else
1697c478bdstevel@tonic-gatetypedef __longlong_t	off64_t;
1707c478bdstevel@tonic-gate#endif
1717c478bdstevel@tonic-gate#endif /* _LARGEFILE64_SOURCE */
1727c478bdstevel@tonic-gate#endif /* _OFF_T */
1737c478bdstevel@tonic-gate#endif /* _LARGEFILE_SOURCE */
1747c478bdstevel@tonic-gate
1757c478bdstevel@tonic-gate#ifdef _LARGEFILE64_SOURCE
1767c478bdstevel@tonic-gate#ifdef _LP64
1777c478bdstevel@tonic-gatetypedef fpos_t		fpos64_t;
1787c478bdstevel@tonic-gate#else
1797c478bdstevel@tonic-gatetypedef __longlong_t	fpos64_t;
1807c478bdstevel@tonic-gate#endif
1817c478bdstevel@tonic-gate#endif /* _LARGEFILE64_SOURCE */
1827c478bdstevel@tonic-gate
1837c478bdstevel@tonic-gate/*
1847c478bdstevel@tonic-gate * XPG4 requires that va_list be defined in <stdio.h> "as described in
1857c478bdstevel@tonic-gate * <stdarg.h>".  ANSI-C and POSIX require that the namespace of <stdio.h>
1867c478bdstevel@tonic-gate * not be polluted with this name.
1877c478bdstevel@tonic-gate */
1887c478bdstevel@tonic-gate#if defined(_XPG4) && !defined(_VA_LIST)
1897c478bdstevel@tonic-gate#define	_VA_LIST
1907c478bdstevel@tonic-gatetypedef	__va_list va_list;
1917c478bdstevel@tonic-gate#endif	/* defined(_XPG4 && !defined(_VA_LIST) */
1927c478bdstevel@tonic-gate
1937c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
1947c478bdstevel@tonic-gate		defined(__XOPEN_OR_POSIX)
1957c478bdstevel@tonic-gate
1967c478bdstevel@tonic-gate#define	L_ctermid	9
1977c478bdstevel@tonic-gate
1987c478bdstevel@tonic-gate/* Marked LEGACY in SUSv2 and removed in SUSv3 */
1997c478bdstevel@tonic-gate#if !defined(_XPG6) || defined(__EXTENSIONS__)
2007c478bdstevel@tonic-gate#define	L_cuserid	9
2017c478bdstevel@tonic-gate#endif
2027c478bdstevel@tonic-gate
2037c478bdstevel@tonic-gate#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
2047c478bdstevel@tonic-gate
2057c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || \
2067c478bdstevel@tonic-gate	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
2077c478bdstevel@tonic-gate	defined(_XOPEN_SOURCE)
2087c478bdstevel@tonic-gate
2097c478bdstevel@tonic-gate#define	P_tmpdir	"/var/tmp/"
2107c478bdstevel@tonic-gate#endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
2117c478bdstevel@tonic-gate
2127c478bdstevel@tonic-gate#ifndef _STDIO_ALLOCATE
2137c478bdstevel@tonic-gateextern unsigned char	 _sibuf[], _sobuf[];
2147c478bdstevel@tonic-gate#endif
2157c478bdstevel@tonic-gate
2167c478bdstevel@tonic-gate/* large file compilation environment setup */
2177c478bdstevel@tonic-gate#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
2187c478bdstevel@tonic-gate#if !defined(__PRAGMA_REDEFINE_EXTNAME)
2197c478bdstevel@tonic-gateextern FILE	*fopen64(const char *, const char *);
2207c478bdstevel@tonic-gateextern FILE	*freopen64(const char *, const char *, FILE *);
2217c478bdstevel@tonic-gateextern FILE	*tmpfile64(void);
2227c478bdstevel@tonic-gateextern int	fgetpos64(FILE *, fpos_t *);
2237c478bdstevel@tonic-gateextern int	fsetpos64(FILE *, const fpos_t *);
2247c478bdstevel@tonic-gate#define	fopen			fopen64
2257c478bdstevel@tonic-gate#define	freopen			freopen64
2267c478bdstevel@tonic-gate#define	tmpfile			tmpfile64
2277c478bdstevel@tonic-gate#define	fgetpos			fgetpos64
2287c478bdstevel@tonic-gate#define	fsetpos			fsetpos64
2297c478bdstevel@tonic-gate#ifdef	_LARGEFILE_SOURCE
2307c478bdstevel@tonic-gate#define	fseeko			fseeko64
2317c478bdstevel@tonic-gate#define	ftello			ftello64
2327c478bdstevel@tonic-gate#endif
2337c478bdstevel@tonic-gate#endif	/* !__PRAGMA_REDEFINE_EXTNAME */
2347c478bdstevel@tonic-gate#endif	/* !_LP64 && _FILE_OFFSET_BITS == 64 */
2357c478bdstevel@tonic-gate
2367c478bdstevel@tonic-gate#ifndef _LP64
2377c478bdstevel@tonic-gateextern unsigned char	*_bufendtab[];
2387c478bdstevel@tonic-gateextern FILE		*_lastbuf;
2397c478bdstevel@tonic-gate#endif
2407c478bdstevel@tonic-gate
2417c478bdstevel@tonic-gate/* In the LP64 compilation environment, all APIs are already large file */
2427c478bdstevel@tonic-gate#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
2437c478bdstevel@tonic-gate#if !defined(__PRAGMA_REDEFINE_EXTNAME)
2447c478bdstevel@tonic-gate#define	fopen64		fopen
2457c478bdstevel@tonic-gate#define	freopen64	freopen
2467c478bdstevel@tonic-gate#define	tmpfile64	tmpfile
2477c478bdstevel@tonic-gate#define	fgetpos64	fgetpos
2487c478bdstevel@tonic-gate#define	fsetpos64	fsetpos
2497c478bdstevel@tonic-gate#ifdef	_LARGEFILE_SOURCE
2507c478bdstevel@tonic-gate#define	fseeko64	fseeko
2517c478bdstevel@tonic-gate#define	ftello64	ftello
2527c478bdstevel@tonic-gate#endif
2537c478bdstevel@tonic-gate#endif	/* !__PRAGMA_REDEFINE_EXTNAME */
2547c478bdstevel@tonic-gate#endif	/* _LP64 && _LARGEFILE64_SOURCE */
2557c478bdstevel@tonic-gate
25623a1cceRoger A. Faulkner#ifndef	_SSIZE_T
25723a1cceRoger A. Faulkner#define	_SSIZE_T
25823a1cceRoger A. Faulkner#if defined(_LP64) || defined(_I32LPx)
25923a1cceRoger A. Faulknertypedef long	ssize_t;	/* size of something in bytes or -1 */
26023a1cceRoger A. Faulkner#else
26123a1cceRoger A. Faulknertypedef int	ssize_t;	/* (historical version) */
26223a1cceRoger A. Faulkner#endif
26323a1cceRoger A. Faulkner#endif	/* !_SSIZE_T */
26423a1cceRoger A. Faulkner
2657c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || \
2667c478bdstevel@tonic-gate	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2677c478bdstevel@tonic-gate	defined(_REENTRANT)
2687c478bdstevel@tonic-gateextern char	*tmpnam_r(char *);
2697c478bdstevel@tonic-gate#endif
2707c478bdstevel@tonic-gate
2717c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || \
2727c478bdstevel@tonic-gate	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
27323a1cceRoger A. Faulknerextern int fcloseall(void);
2747c478bdstevel@tonic-gateextern void setbuffer(FILE *, char *, size_t);
2757c478bdstevel@tonic-gateextern int setlinebuf(FILE *);
276d098320Roger A. Faulkner/* PRINTFLIKE2 */
277d098320Roger A. Faulknerextern int asprintf(char **, const char *, ...);
278d098320Roger A. Faulkner/* PRINTFLIKE2 */
279d098320Roger A. Faulknerextern int vasprintf(char **, const char *, __va_list);
2807c478bdstevel@tonic-gate#endif
2817c478bdstevel@tonic-gate
28223a1cceRoger A. Faulkner#if defined(__EXTENSIONS__) || \
28323a1cceRoger A. Faulkner	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
28423a1cceRoger A. Faulkner	/* || defined(_XPG7) */
28523a1cceRoger A. Faulknerextern ssize_t getdelim(char **_RESTRICT_KYWD, size_t *_RESTRICT_KYWD,
28623a1cceRoger A. Faulkner	int, FILE *_RESTRICT_KYWD);
28723a1cceRoger A. Faulknerextern ssize_t getline(char **_RESTRICT_KYWD, size_t *_RESTRICT_KYWD,
28823a1cceRoger A. Faulkner	FILE *_RESTRICT_KYWD);
28923a1cceRoger A. Faulkner#endif	/* __EXTENSIONS__ ... */
29023a1cceRoger A. Faulkner
2917c478bdstevel@tonic-gate/*
2927c478bdstevel@tonic-gate * The following are known to POSIX and XOPEN, but not to ANSI-C.
2937c478bdstevel@tonic-gate */
2947c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || \
2957c478bdstevel@tonic-gate	!defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)
2967c478bdstevel@tonic-gate
2977c478bdstevel@tonic-gateextern FILE	*fdopen(int, const char *);
2987c478bdstevel@tonic-gateextern char	*ctermid(char *);
2997c478bdstevel@tonic-gateextern int	fileno(FILE *);
3007c478bdstevel@tonic-gate
3017c478bdstevel@tonic-gate#endif	/* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
3027c478bdstevel@tonic-gate
3037c478bdstevel@tonic-gate/*
3047c478bdstevel@tonic-gate * The following are known to POSIX.1c, but not to ANSI-C or XOPEN.
3057c478bdstevel@tonic-gate */
3067c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
3077c478bdstevel@tonic-gate	(_POSIX_C_SOURCE - 0 >= 199506L)
3087c478bdstevel@tonic-gateextern void	flockfile(FILE *);
3097c478bdstevel@tonic-gateextern int	ftrylockfile(FILE *);
3107c478bdstevel@tonic-gateextern void	funlockfile(FILE *);
3117c478bdstevel@tonic-gateextern int	getc_unlocked(FILE *);
3127c478bdstevel@tonic-gateextern int	getchar_unlocked(void);
3137c478bdstevel@tonic-gateextern int	putc_unlocked(int, FILE *);
3147c478bdstevel@tonic-gateextern int	putchar_unlocked(int);
3157c478bdstevel@tonic-gate
3167c478bdstevel@tonic-gate#endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
3177c478bdstevel@tonic-gate
3187c478bdstevel@tonic-gate/*
3197c478bdstevel@tonic-gate * The following are known to XOPEN, but not to ANSI-C or POSIX.
3207c478bdstevel@tonic-gate */
3217c478bdstevel@tonic-gate#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
3227c478bdstevel@tonic-gate	defined(_XOPEN_SOURCE)
3237c478bdstevel@tonic-gateextern FILE	*popen(const char *, const char *);
3247c478bdstevel@tonic-gateextern char	*tempnam(const char *, const char *);
3257c478bdstevel@tonic-gateextern int	pclose(FILE *);
3267c478bdstevel@tonic-gate#if !defined(_XOPEN_SOURCE)
3277c478bdstevel@tonic-gateextern int	getsubopt(char **, char *const *, char **);
3287c478bdstevel@tonic-gate#endif /* !defined(_XOPEN_SOURCE) */
3297c478bdstevel@tonic-gate
3307c478bdstevel@tonic-gate/* Marked LEGACY in SUSv2 and removed in SUSv3 */
3317c478bdstevel@tonic-gate#if !defined(_XPG6) || defined(__EXTENSIONS__)
3327c478bdstevel@tonic-gateextern char	*cuserid(char *);
3337c478bdstevel@tonic-gateextern int	getopt(int, char *const *, const char *);
3347c478bdstevel@tonic-gateextern char	*optarg;
3357c478bdstevel@tonic-gateextern int	optind, opterr, optopt;
3367c478bdstevel@tonic-gateextern int	getw(FILE *);
3377c478bdstevel@tonic-gateextern int	putw(int, FILE *);
3387c478bdstevel@tonic-gate#endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
3397c478bdstevel@tonic-gate
3407c478bdstevel@tonic-gate#endif	/* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
3417c478bdstevel@tonic-gate
3427c478bdstevel@tonic-gate/*
3437c478bdstevel@tonic-gate * The following are defined as part of the Large File Summit interfaces.
3447c478bdstevel@tonic-gate */
34523a1cceRoger A. Faulkner#if defined(_LARGEFILE_SOURCE) || defined(_XPG5)
3467c478bdstevel@tonic-gateextern int	fseeko(FILE *, off_t, int);
3477c478bdstevel@tonic-gateextern off_t	ftello(FILE *);
3487c478bdstevel@tonic-gate#endif
3497c478bdstevel@tonic-gate
3507c478bdstevel@tonic-gate/*
3517c478bdstevel@tonic-gate * The following are defined as part of the transitional Large File Summit
3527c478bdstevel@tonic-gate * interfaces.
3537c478bdstevel@tonic-gate */
35423a1cceRoger A. Faulkner#if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
3557c478bdstevel@tonic-gate	    !defined(__PRAGMA_REDEFINE_EXTNAME))
3567c478bdstevel@tonic-gateextern FILE	*fopen64(const char *, const char *);
3577c478bdstevel@tonic-gateextern FILE	*freopen64(const char *, const char *, FILE *);
3587c478bdstevel@tonic-gateextern FILE	*tmpfile64(void);
3597c478bdstevel@tonic-gateextern int	fgetpos64(FILE *, fpos64_t *);
3607c478bdstevel@tonic-gateextern int	fsetpos64(FILE *, const fpos64_t *);
3617c478bdstevel@tonic-gateextern int	fseeko64(FILE *, off64_t, int);
3627c478bdstevel@tonic-gateextern off64_t	ftello64(FILE *);
3637c478bdstevel@tonic-gate#endif
3647c478bdstevel@tonic-gate
365cd62a92Robert Mustacchi/*
366cd62a92Robert Mustacchi * XPG7 symbols
367cd62a92Robert Mustacchi */
368cd62a92Robert Mustacchi#if !defined(_STRICT_SYMBOLS) || defined(_XPG7)
369cd62a92Robert Mustacchiextern FILE	*fmemopen(void *_RESTRICT_KYWD, size_t,
370cd62a92Robert Mustacchi		    const char *_RESTRICT_KYWD);
371cd62a92Robert Mustacchiextern FILE	*open_memstream(char **, size_t *);
372cd62a92Robert Mustacchi#endif	/* !_STRICT_SYMBOLS || _XPG7 */
373cd62a92Robert Mustacchi
37423a1cceRoger A. Faulkner#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
3757c478bdstevel@tonic-gate	    (_POSIX_C_SOURCE - 0 >= 199506L)
3767c478bdstevel@tonic-gate#define	getchar_unlocked()	getc_unlocked(stdin)
3777c478bdstevel@tonic-gate#define	putchar_unlocked(x)	putc_unlocked((x), stdout)
3787c478bdstevel@tonic-gate#endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
3797c478bdstevel@tonic-gate
3807c478bdstevel@tonic-gate#ifdef	__cplusplus
3817c478bdstevel@tonic-gate}
3827c478bdstevel@tonic-gate#endif
3837c478bdstevel@tonic-gate
3847c478bdstevel@tonic-gate#endif	/* _STDIO_H */
385