2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
39 #include <sys/cdefs.h>
41 #include <machine/ansi.h>
43 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
44 #include <machine/types.h>
47 typedef _BSD_RUNE_T_ rune_t;
53 typedef _BSD_SIZE_T_ size_t;
58 typedef _BSD_WCHAR_T_ wchar_t;
63 int quot; /* quotient */
64 int rem; /* remainder */
68 long quot; /* quotient */
69 long rem; /* remainder */
76 #define EXIT_FAILURE 1
77 #define EXIT_SUCCESS 0
79 #define RAND_MAX 0x7fffffff
81 extern int __mb_cur_max;
82 #define MB_CUR_MAX __mb_cur_max
85 void abort __P((void)) __dead2;
86 int abs __P((int)) __pure2;
87 int atexit __P((void (*)(void)));
88 double atof __P((const char *));
89 int atoi __P((const char *));
90 long atol __P((const char *));
91 void *bsearch __P((const void *, const void *, size_t,
92 size_t, int (*)(const void *, const void *)));
93 void *calloc __P((size_t, size_t));
94 div_t div __P((int, int)) __pure2;
95 void exit __P((int)) __dead2;
96 void free __P((void *));
97 char *getenv __P((const char *));
98 long labs __P((long)) __pure2;
99 ldiv_t ldiv __P((long, long)) __pure2;
100 void *malloc __P((size_t));
101 void qsort __P((void *, size_t, size_t,
102 int (*)(const void *, const void *)));
103 int rand __P((void));
104 void *realloc __P((void *, size_t));
105 void srand __P((unsigned));
106 double strtod __P((const char *, char **));
107 long strtol __P((const char *, char **, int));
109 strtoul __P((const char *, char **, int));
110 int system __P((const char *));
112 int mblen __P((const char *, size_t));
113 size_t mbstowcs __P((wchar_t *, const char *, size_t));
114 int wctomb __P((char *, wchar_t));
115 int mbtowc __P((wchar_t *, const char *, size_t));
116 size_t wcstombs __P((char *, const wchar_t *, size_t));
118 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
119 int putenv __P((const char *));
120 int setenv __P((const char *, const char *, int));
122 double drand48 __P((void));
123 double erand48 __P((unsigned short[3]));
124 long jrand48 __P((unsigned short[3]));
125 void lcong48 __P((unsigned short[7]));
126 long lrand48 __P((void));
127 long mrand48 __P((void));
128 long nrand48 __P((unsigned short[3]));
130 *seed48 __P((unsigned short[3]));
131 void srand48 __P((long));
133 void *alloca __P((size_t)); /* built-in for gcc */
134 /* getcap(3) functions */
136 arc4random __P((void));
137 void arc4random_addrandom __P((unsigned char *dat, int datlen));
138 void arc4random_stir __P((void));
139 char *getbsize __P((int *, long *));
140 char *cgetcap __P((char *, char *, int));
141 int cgetclose __P((void));
142 int cgetent __P((char **, char **, char *));
143 int cgetfirst __P((char **, char **));
144 int cgetmatch __P((char *, char *));
145 int cgetnext __P((char **, char **));
146 int cgetnum __P((char *, char *, long *));
147 int cgetset __P((char *));
148 int cgetstr __P((char *, char *, char **));
149 int cgetustr __P((char *, char *, char **));
151 int daemon __P((int, int));
152 char *devname __P((int, int));
153 int getloadavg __P((double [], int));
155 char *group_from_gid __P((unsigned long, int));
156 int heapsort __P((void *, size_t, size_t,
157 int (*)(const void *, const void *)));
158 char *initstate __P((unsigned long, char *, long));
159 int mergesort __P((void *, size_t, size_t,
160 int (*)(const void *, const void *)));
161 int radixsort __P((const unsigned char **, int, const unsigned char *,
163 int sradixsort __P((const unsigned char **, int, const unsigned char *,
165 long random __P((void));
166 char *realpath __P((const char *, char resolved_path[]));
167 char *setstate __P((char *));
168 void srandom __P((unsigned long));
169 void srandomdev __P((void));
170 char *user_from_uid __P((unsigned long, int));
171 #ifndef __STRICT_ANSI__
172 int64_t strtoq __P((const char *, char **, int));
174 strtouq __P((const char *, char **, int));
176 void unsetenv __P((const char *));
177 #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
180 #endif /* !_STDLIB_H_ */