xref: /illumos-gate/usr/src/head/stdlib.h (revision 23a1ccea)
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
57c4dcc55Scasper  * Common Development and Distribution License (the "License").
67c4dcc55Scasper  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21019c3c43Sraf 
227c478bd9Sstevel@tonic-gate /*
23*23a1cceaSRoger A. Faulkner  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef _STDLIB_H
307c478bd9Sstevel@tonic-gate #define	_STDLIB_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <iso/stdlib_iso.h>
337c478bd9Sstevel@tonic-gate #include <iso/stdlib_c99.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_XPG4)
367c478bd9Sstevel@tonic-gate #include <sys/wait.h>
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
417c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/stdlib_iso.h>.
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
447c478bd9Sstevel@tonic-gate using std::div_t;
457c478bd9Sstevel@tonic-gate using std::ldiv_t;
467c478bd9Sstevel@tonic-gate using std::size_t;
477c478bd9Sstevel@tonic-gate using std::abort;
487c478bd9Sstevel@tonic-gate using std::abs;
497c478bd9Sstevel@tonic-gate using std::atexit;
507c478bd9Sstevel@tonic-gate using std::atof;
517c478bd9Sstevel@tonic-gate using std::atoi;
527c478bd9Sstevel@tonic-gate using std::atol;
537c478bd9Sstevel@tonic-gate using std::bsearch;
547c478bd9Sstevel@tonic-gate using std::calloc;
557c478bd9Sstevel@tonic-gate using std::div;
567c478bd9Sstevel@tonic-gate using std::exit;
577c478bd9Sstevel@tonic-gate using std::free;
587c478bd9Sstevel@tonic-gate using std::getenv;
597c478bd9Sstevel@tonic-gate using std::labs;
607c478bd9Sstevel@tonic-gate using std::ldiv;
617c478bd9Sstevel@tonic-gate using std::malloc;
627c478bd9Sstevel@tonic-gate using std::mblen;
637c478bd9Sstevel@tonic-gate using std::mbstowcs;
647c478bd9Sstevel@tonic-gate using std::mbtowc;
657c478bd9Sstevel@tonic-gate using std::qsort;
667c478bd9Sstevel@tonic-gate using std::rand;
677c478bd9Sstevel@tonic-gate using std::realloc;
687c478bd9Sstevel@tonic-gate using std::srand;
697c478bd9Sstevel@tonic-gate using std::strtod;
707c478bd9Sstevel@tonic-gate using std::strtol;
717c478bd9Sstevel@tonic-gate using std::strtoul;
727c478bd9Sstevel@tonic-gate using std::system;
737c478bd9Sstevel@tonic-gate using std::wcstombs;
747c478bd9Sstevel@tonic-gate using std::wctomb;
757c478bd9Sstevel@tonic-gate #endif
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
787c478bd9Sstevel@tonic-gate extern "C" {
797c478bd9Sstevel@tonic-gate #endif
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate #ifndef _UID_T
827c478bd9Sstevel@tonic-gate #define	_UID_T
83f48205beScasper typedef	unsigned int	uid_t;		/* UID type		*/
847c478bd9Sstevel@tonic-gate #endif	/* !_UID_T */
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #if defined(__STDC__)
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /* large file compilation environment setup */
897c478bd9Sstevel@tonic-gate #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate #ifdef	__PRAGMA_REDEFINE_EXTNAME
927c478bd9Sstevel@tonic-gate #pragma redefine_extname	mkstemp		mkstemp64
937c4dcc55Scasper #pragma redefine_extname	mkstemps	mkstemps64
947c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
957c478bd9Sstevel@tonic-gate #define	mkstemp			mkstemp64
967c4dcc55Scasper #define	mkstemps		mkstemps64
977c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #endif	/* _FILE_OFFSET_BITS == 64 */
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate /* In the LP64 compilation environment, all APIs are already large file */
1027c478bd9Sstevel@tonic-gate #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate #ifdef	__PRAGMA_REDEFINE_EXTNAME
1057c478bd9Sstevel@tonic-gate #pragma redefine_extname	mkstemp64	mkstemp
1067c4dcc55Scasper #pragma redefine_extname	mkstemps64	mkstemps
1077c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
1087c478bd9Sstevel@tonic-gate #define	mkstemp64		mkstemp
1097c4dcc55Scasper #define	mkstemps64		mkstemps
1107c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #endif	/* _LP64 && _LARGEFILE64_SOURCE */
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1157c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1167c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
1177c478bd9Sstevel@tonic-gate extern int rand_r(unsigned int *);
1187c478bd9Sstevel@tonic-gate #endif
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate extern void _exithandle(void);
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1237c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1247c478bd9Sstevel@tonic-gate 	defined(_XPG4)
1257c478bd9Sstevel@tonic-gate extern double drand48(void);
1267c478bd9Sstevel@tonic-gate extern double erand48(unsigned short *);
1277c478bd9Sstevel@tonic-gate extern long jrand48(unsigned short *);
1287c478bd9Sstevel@tonic-gate extern void lcong48(unsigned short *);
1297c478bd9Sstevel@tonic-gate extern long lrand48(void);
1307c478bd9Sstevel@tonic-gate extern long mrand48(void);
1317c478bd9Sstevel@tonic-gate extern long nrand48(unsigned short *);
1327c478bd9Sstevel@tonic-gate extern unsigned short *seed48(unsigned short *);
1337c478bd9Sstevel@tonic-gate extern void srand48(long);
1347c478bd9Sstevel@tonic-gate extern int putenv(char *);
1357c478bd9Sstevel@tonic-gate extern void setkey(const char *);
1367c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate /*
1397c478bd9Sstevel@tonic-gate  * swab() has historically been in <stdlib.h> as delivered from AT&T
1407c478bd9Sstevel@tonic-gate  * and continues to be visible in the default compilation environment.
1417c478bd9Sstevel@tonic-gate  * As of Issue 4 of the X/Open Portability Guides, swab() was declared
1427c478bd9Sstevel@tonic-gate  * in <unistd.h>. As a result, with respect to X/Open namespace the
1437c478bd9Sstevel@tonic-gate  * swab() declaration in this header is only visible for the XPG3
1447c478bd9Sstevel@tonic-gate  * environment.
1457c478bd9Sstevel@tonic-gate  */
1467c478bd9Sstevel@tonic-gate #if (defined(__EXTENSIONS__) || \
1477c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC__) && !defined(_POSIX_C_SOURCE))) && \
1487c478bd9Sstevel@tonic-gate 	(!defined(_XOPEN_SOURCE) || (defined(_XPG3) && !defined(_XPG4)))
1497c478bd9Sstevel@tonic-gate #ifndef	_SSIZE_T
1507c478bd9Sstevel@tonic-gate #define	_SSIZE_T
1517c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
1527c478bd9Sstevel@tonic-gate typedef long	ssize_t;	/* size of something in bytes or -1 */
1537c478bd9Sstevel@tonic-gate #else
1547c478bd9Sstevel@tonic-gate typedef int	ssize_t;	/* (historical version) */
1557c478bd9Sstevel@tonic-gate #endif
1567c478bd9Sstevel@tonic-gate #endif	/* !_SSIZE_T */
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate extern void swab(const char *, char *, ssize_t);
1597c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1627c478bd9Sstevel@tonic-gate 	!defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
1637c478bd9Sstevel@tonic-gate 	(defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64)
1647c478bd9Sstevel@tonic-gate extern int	mkstemp(char *);
1654e9cef60Scasper #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
1667c4dcc55Scasper extern int	mkstemps(char *, int);
1674e9cef60Scasper #endif
1687c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) ... */
1697c478bd9Sstevel@tonic-gate 
1707c478bd9Sstevel@tonic-gate #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
1717c478bd9Sstevel@tonic-gate 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
1727c478bd9Sstevel@tonic-gate extern int	mkstemp64(char *);
1734e9cef60Scasper #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
1747c4dcc55Scasper extern int	mkstemps64(char *, int);
1754e9cef60Scasper #endif
1767c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE... */
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1797c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1807c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1817c478bd9Sstevel@tonic-gate extern long a64l(const char *);
1827c478bd9Sstevel@tonic-gate extern char *ecvt(double, int, int *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
1837c478bd9Sstevel@tonic-gate extern char *fcvt(double, int, int *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
1847c478bd9Sstevel@tonic-gate extern char *gcvt(double, int, char *);
1857c478bd9Sstevel@tonic-gate extern int getsubopt(char **, char *const *, char **);
1867c478bd9Sstevel@tonic-gate extern int  grantpt(int);
1877c478bd9Sstevel@tonic-gate extern char *initstate(unsigned, char *, size_t);
1887c478bd9Sstevel@tonic-gate extern char *l64a(long);
1897c478bd9Sstevel@tonic-gate extern char *mktemp(char *);
1907c478bd9Sstevel@tonic-gate extern char *ptsname(int);
1917c478bd9Sstevel@tonic-gate extern long random(void);
1927c478bd9Sstevel@tonic-gate extern char *realpath(const char *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
1937c478bd9Sstevel@tonic-gate extern char *setstate(const char *);
1947c478bd9Sstevel@tonic-gate extern void srandom(unsigned);
1957c478bd9Sstevel@tonic-gate extern int  unlockpt(int);
1967c478bd9Sstevel@tonic-gate /* Marked LEGACY in SUSv2 and removed in SUSv3 */
1977c478bd9Sstevel@tonic-gate #if !defined(_XPG6) || defined(__EXTENSIONS__)
1987c478bd9Sstevel@tonic-gate extern int ttyslot(void);
1997c478bd9Sstevel@tonic-gate extern void *valloc(size_t);
2007c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
2017c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || ... || defined(_XPG4_2) */
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
2047c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2057c478bd9Sstevel@tonic-gate 	defined(_XPG6)
206019c3c43Sraf extern int posix_memalign(void **, size_t, size_t);
2077c478bd9Sstevel@tonic-gate extern int posix_openpt(int);
2087c478bd9Sstevel@tonic-gate extern int setenv(const char *, const char *, int);
2097c478bd9Sstevel@tonic-gate extern int unsetenv(const char *);
2107c478bd9Sstevel@tonic-gate #endif
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
2137c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
214*23a1cceaSRoger A. Faulkner extern char *canonicalize_file_name(const char *);
215*23a1cceaSRoger A. Faulkner extern int clearenv(void);
2167c478bd9Sstevel@tonic-gate extern void closefrom(int);
21744991a1cSVladimir Kotal extern int daemon(int, int);
2187c478bd9Sstevel@tonic-gate extern int dup2(int, int);
2197c478bd9Sstevel@tonic-gate extern int fdwalk(int (*)(void *, int), void *);
2207c478bd9Sstevel@tonic-gate extern char *qecvt(long double, int, int *, int *);
2217c478bd9Sstevel@tonic-gate extern char *qfcvt(long double, int, int *, int *);
2227c478bd9Sstevel@tonic-gate extern char *qgcvt(long double, int, char *);
2237c478bd9Sstevel@tonic-gate extern char *getcwd(char *, size_t);
2247c478bd9Sstevel@tonic-gate extern const char *getexecname(void);
2257c478bd9Sstevel@tonic-gate extern char *getlogin(void);
2267c478bd9Sstevel@tonic-gate extern int getopt(int, char *const *, const char *);
2277c478bd9Sstevel@tonic-gate extern char *optarg;
2287c478bd9Sstevel@tonic-gate extern int optind, opterr, optopt;
2297c478bd9Sstevel@tonic-gate extern char *getpass(const char *);
2307c478bd9Sstevel@tonic-gate extern char *getpassphrase(const char *);
2317c478bd9Sstevel@tonic-gate extern int getpw(uid_t, char *);
2327c478bd9Sstevel@tonic-gate extern int isatty(int);
2337c478bd9Sstevel@tonic-gate extern void *memalign(size_t, size_t);
2347c478bd9Sstevel@tonic-gate extern char *ttyname(int);
2357c4dcc55Scasper extern char *mkdtemp(char *);
236*23a1cceaSRoger A. Faulkner extern const char *getprogname(void);
237*23a1cceaSRoger A. Faulkner extern void setprogname(const char *);
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) && defined(_LONGLONG_TYPE)
2407c478bd9Sstevel@tonic-gate extern char *lltostr(long long, char *);
2417c478bd9Sstevel@tonic-gate extern char *ulltostr(unsigned long long, char *);
2427c478bd9Sstevel@tonic-gate #endif	/* !defined(_STRICT_STDC) && defined(_LONGLONG_TYPE) */
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate #else /* not __STDC__ */
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_XOPEN_OR_POSIX) || \
2497c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
2507c478bd9Sstevel@tonic-gate extern int rand_r();
2517c478bd9Sstevel@tonic-gate #endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT) ... */
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate extern void _exithandle();
2547c478bd9Sstevel@tonic-gate 
2557c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) || defined(_XPG4)
2567c478bd9Sstevel@tonic-gate extern double drand48();
2577c478bd9Sstevel@tonic-gate extern double erand48();
2587c478bd9Sstevel@tonic-gate extern long jrand48();
2597c478bd9Sstevel@tonic-gate extern void lcong48();
2607c478bd9Sstevel@tonic-gate extern long lrand48();
2617c478bd9Sstevel@tonic-gate extern long mrand48();
2627c478bd9Sstevel@tonic-gate extern long nrand48();
2637c478bd9Sstevel@tonic-gate extern unsigned short *seed48();
2647c478bd9Sstevel@tonic-gate extern void srand48();
2657c478bd9Sstevel@tonic-gate extern int putenv();
2667c478bd9Sstevel@tonic-gate extern void setkey();
2677c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) ... */
2687c478bd9Sstevel@tonic-gate 
2697c478bd9Sstevel@tonic-gate #if (defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE)) && \
2707c478bd9Sstevel@tonic-gate 	(!defined(_XOPEN_SOURCE) || (defined(_XPG3) && !defined(_XPG4)))
2717c478bd9Sstevel@tonic-gate extern void swab();
2727c478bd9Sstevel@tonic-gate #endif
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
2757c478bd9Sstevel@tonic-gate 	!defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
2767c478bd9Sstevel@tonic-gate 	(defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64)
2777c478bd9Sstevel@tonic-gate extern int	mkstemp();
2784e9cef60Scasper #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
2797c4dcc55Scasper extern int	mkstemps();
2804e9cef60Scasper #endif
2817c478bd9Sstevel@tonic-gate #endif	/* defined(__EXTENSIONS__) ... */
2827c478bd9Sstevel@tonic-gate 
2837c478bd9Sstevel@tonic-gate #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
2847c478bd9Sstevel@tonic-gate 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
2857c478bd9Sstevel@tonic-gate extern int	mkstemp64();
2864e9cef60Scasper #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
2877c4dcc55Scasper extern int	mkstemps64();
2884e9cef60Scasper #endif
2897c478bd9Sstevel@tonic-gate #endif	/* _LARGEFILE64_SOURCE... */
2907c478bd9Sstevel@tonic-gate 
2917c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
2927c478bd9Sstevel@tonic-gate extern long a64l();
2937c478bd9Sstevel@tonic-gate extern char *ecvt();
2947c478bd9Sstevel@tonic-gate extern char *fcvt();
2957c478bd9Sstevel@tonic-gate extern char *gcvt();
2967c478bd9Sstevel@tonic-gate extern int getsubopt();
2977c478bd9Sstevel@tonic-gate extern int grantpt();
2987c478bd9Sstevel@tonic-gate extern char *initstate();
2997c478bd9Sstevel@tonic-gate extern char *l64a();
3007c478bd9Sstevel@tonic-gate extern char *mktemp();
3017c478bd9Sstevel@tonic-gate extern char *ptsname();
3027c478bd9Sstevel@tonic-gate extern long random();
3037c478bd9Sstevel@tonic-gate extern char *realpath();
3047c478bd9Sstevel@tonic-gate extern char *setstate();
3057c478bd9Sstevel@tonic-gate extern void srandom();
3067c478bd9Sstevel@tonic-gate /* Marked LEGACY in SUSv2 and removed in SUSv3 */
3077c478bd9Sstevel@tonic-gate #if !defined(_XPG6) || defined(__EXTENSIONS__)
3087c478bd9Sstevel@tonic-gate extern int ttyslot();
3097c478bd9Sstevel@tonic-gate extern void *valloc();
3107c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
3117c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || ... || defined(_XPG4_2) */
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG6)
314019c3c43Sraf extern int posix_memalign();
3157c478bd9Sstevel@tonic-gate extern int posix_openpt();
3167c478bd9Sstevel@tonic-gate extern int setenv();
3177c478bd9Sstevel@tonic-gate extern int unsetenv();
3187c478bd9Sstevel@tonic-gate #endif
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
321*23a1cceaSRoger A. Faulkner extern char *canonicalize_file_name();
322*23a1cceaSRoger A. Faulkner extern int clearenv();
3237c478bd9Sstevel@tonic-gate extern void closefrom();
32444991a1cSVladimir Kotal extern int daemon();
3257c478bd9Sstevel@tonic-gate extern int dup2();
3267c478bd9Sstevel@tonic-gate extern int fdwalk();
3277c478bd9Sstevel@tonic-gate extern char *qecvt();
3287c478bd9Sstevel@tonic-gate extern char *qfcvt();
3297c478bd9Sstevel@tonic-gate extern char *qgcvt();
3307c478bd9Sstevel@tonic-gate extern char *getcwd();
3317c478bd9Sstevel@tonic-gate extern char *getexecname();
3327c478bd9Sstevel@tonic-gate extern char *getlogin();
3337c478bd9Sstevel@tonic-gate extern int getopt();
3347c478bd9Sstevel@tonic-gate extern char *optarg;
3357c478bd9Sstevel@tonic-gate extern int optind, opterr, optopt;
3367c478bd9Sstevel@tonic-gate extern char *getpass();
3377c478bd9Sstevel@tonic-gate extern char *getpassphrase();
3387c478bd9Sstevel@tonic-gate extern int getpw();
3397c478bd9Sstevel@tonic-gate extern int isatty();
3407c478bd9Sstevel@tonic-gate extern void *memalign();
3417c478bd9Sstevel@tonic-gate extern char *ttyname();
3427c4dcc55Scasper extern char *mkdtemp();
343*23a1cceaSRoger A. Faulkner extern char *getprogname();
344*23a1cceaSRoger A. Faulkner extern void setprogname();
3457c478bd9Sstevel@tonic-gate 
3467c478bd9Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
3477c478bd9Sstevel@tonic-gate extern char *lltostr();
3487c478bd9Sstevel@tonic-gate extern char *ulltostr();
3497c478bd9Sstevel@tonic-gate #endif  /* defined(_LONGLONG_TYPE) */
3507c478bd9Sstevel@tonic-gate #endif	/* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate #endif	/* __STDC__ */
3537c478bd9Sstevel@tonic-gate 
3547c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3557c478bd9Sstevel@tonic-gate }
3567c478bd9Sstevel@tonic-gate #endif
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate #endif	/* _STDLIB_H */
359