| 1 | /* stdlib.h,v 1.24 2004/09/14 22:27:36 bird Exp */
|
|---|
| 2 | /** @file
|
|---|
| 3 | * FreeBSD 5.3
|
|---|
| 4 | * @changed bird: EMXifications and OS2ifications.
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | /*-
|
|---|
| 8 | * Copyright (c) 1990, 1993
|
|---|
| 9 | * The Regents of the University of California. All rights reserved.
|
|---|
| 10 | *
|
|---|
| 11 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 12 | * modification, are permitted provided that the following conditions
|
|---|
| 13 | * are met:
|
|---|
| 14 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 15 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 16 | * 2. Redistributions in binary form must reproduce the above copyright
|
|---|
| 17 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 18 | * documentation and/or other materials provided with the distribution.
|
|---|
| 19 | * 3. All advertising materials mentioning features or use of this software
|
|---|
| 20 | * must display the following acknowledgement:
|
|---|
| 21 | * This product includes software developed by the University of
|
|---|
| 22 | * California, Berkeley and its contributors.
|
|---|
| 23 | * 4. Neither the name of the University nor the names of its contributors
|
|---|
| 24 | * may be used to endorse or promote products derived from this software
|
|---|
| 25 | * without specific prior written permission.
|
|---|
| 26 | *
|
|---|
| 27 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|---|
| 28 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|---|
| 29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|---|
| 30 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|---|
| 31 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|---|
| 32 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|---|
| 33 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|---|
| 34 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|---|
| 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|---|
| 36 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|---|
| 37 | * SUCH DAMAGE.
|
|---|
| 38 | *
|
|---|
| 39 | * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
|
|---|
| 40 | * $FreeBSD: src/include/stdlib.h,v 1.56 2004/02/23 03:16:58 ache Exp $
|
|---|
| 41 | */
|
|---|
| 42 |
|
|---|
| 43 | #ifndef _STDLIB_H_
|
|---|
| 44 | #define _STDLIB_H_
|
|---|
| 45 |
|
|---|
| 46 | #include <sys/cdefs.h>
|
|---|
| 47 | #include <sys/_null.h>
|
|---|
| 48 | #include <sys/_types.h>
|
|---|
| 49 |
|
|---|
| 50 | #if __BSD_VISIBLE
|
|---|
| 51 | #ifndef _RUNE_T_DECLARED
|
|---|
| 52 | typedef __rune_t rune_t;
|
|---|
| 53 | #define _RUNE_T_DECLARED
|
|---|
| 54 | #endif
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|
| 57 | #if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: emx */
|
|---|
| 58 | typedef __size_t size_t;
|
|---|
| 59 | #define _SIZE_T_DECLARED
|
|---|
| 60 | #define _SIZE_T /* bird: emx */
|
|---|
| 61 | #endif
|
|---|
| 62 |
|
|---|
| 63 | #ifndef __cplusplus
|
|---|
| 64 | #if !defined(_WCHAR_T_DECLARED) && !defined(_WCHAR_T) /* bird: emx */
|
|---|
| 65 | typedef __wchar_t wchar_t;
|
|---|
| 66 | #define _WCHAR_T_DECLARED
|
|---|
| 67 | #define _WCHAR_T /* bird: emx */
|
|---|
| 68 | #endif
|
|---|
| 69 | #endif
|
|---|
| 70 |
|
|---|
| 71 | typedef struct _div_t { /* bird: emx (tag) */
|
|---|
| 72 | int quot; /* quotient */
|
|---|
| 73 | int rem; /* remainder */
|
|---|
| 74 | } div_t;
|
|---|
| 75 |
|
|---|
| 76 | typedef struct _ldiv_t { /* bird: emx (tag) */
|
|---|
| 77 | long quot;
|
|---|
| 78 | long rem;
|
|---|
| 79 | } ldiv_t;
|
|---|
| 80 |
|
|---|
| 81 | #define EXIT_FAILURE 1
|
|---|
| 82 | #define EXIT_SUCCESS 0
|
|---|
| 83 |
|
|---|
| 84 | #define RAND_MAX 0x7fffffff
|
|---|
| 85 |
|
|---|
| 86 | extern int __mb_cur_max;
|
|---|
| 87 | #define MB_CUR_MAX __mb_cur_max
|
|---|
| 88 |
|
|---|
| 89 | __BEGIN_DECLS
|
|---|
| 90 | void abort(void) __dead2;
|
|---|
| 91 | int abs(int) __pure2;
|
|---|
| 92 | int atexit(void (*)(void));
|
|---|
| 93 | double atof(const char *);
|
|---|
| 94 | int atoi(const char *);
|
|---|
| 95 | long atol(const char *);
|
|---|
| 96 | void *bsearch(const void *, const void *, size_t,
|
|---|
| 97 | size_t, int (*)(const void *, const void *));
|
|---|
| 98 | void *calloc(size_t, size_t);
|
|---|
| 99 | div_t div(int, int) __pure2;
|
|---|
| 100 | void exit(int) __dead2;
|
|---|
| 101 | void free(void *);
|
|---|
| 102 | char *getenv(const char *);
|
|---|
| 103 | long labs(long) __pure2;
|
|---|
| 104 | ldiv_t ldiv(long, long) __pure2;
|
|---|
| 105 | void *malloc(size_t);
|
|---|
| 106 | int mblen(const char *, size_t);
|
|---|
| 107 | size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
|
|---|
| 108 | int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
|
|---|
| 109 | void qsort(void *, size_t, size_t,
|
|---|
| 110 | int (*)(const void *, const void *));
|
|---|
| 111 | int rand(void);
|
|---|
| 112 | void *realloc(void *, size_t);
|
|---|
| 113 | void srand(unsigned);
|
|---|
| 114 | double strtod(const char * __restrict, char ** __restrict);
|
|---|
| 115 | float strtof(const char * __restrict, char ** __restrict);
|
|---|
| 116 | long strtol(const char * __restrict, char ** __restrict, int);
|
|---|
| 117 | long double
|
|---|
| 118 | strtold(const char * __restrict, char ** __restrict);
|
|---|
| 119 | unsigned long
|
|---|
| 120 | strtoul(const char * __restrict, char ** __restrict, int);
|
|---|
| 121 | int system(const char *);
|
|---|
| 122 | int wctomb(char *, wchar_t);
|
|---|
| 123 | size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
|
|---|
| 124 |
|
|---|
| 125 | /*
|
|---|
| 126 | * Functions added in C99 which we make conditionally available in the
|
|---|
| 127 | * BSD^C89 namespace if the compiler supports `long long'.
|
|---|
| 128 | * The #if test is more complicated than it ought to be because
|
|---|
| 129 | * __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long'
|
|---|
| 130 | * is not supported in the compilation environment (which therefore means
|
|---|
| 131 | * that it can't really be ISO C99).
|
|---|
| 132 | *
|
|---|
| 133 | * (The only other extension made by C99 in thie header is _Exit().)
|
|---|
| 134 | */
|
|---|
| 135 | #if __ISO_C_VISIBLE >= 1999
|
|---|
| 136 | #ifdef __LONG_LONG_SUPPORTED
|
|---|
| 137 | /* LONGLONG */
|
|---|
| 138 | typedef struct _lldiv_t { /* bird: emx (tag) */
|
|---|
| 139 | long long quot;
|
|---|
| 140 | long long rem;
|
|---|
| 141 | } lldiv_t;
|
|---|
| 142 |
|
|---|
| 143 | /* LONGLONG */
|
|---|
| 144 | long long
|
|---|
| 145 | atoll(const char *);
|
|---|
| 146 | /* LONGLONG */
|
|---|
| 147 | long long
|
|---|
| 148 | llabs(long long) __pure2;
|
|---|
| 149 | /* LONGLONG */
|
|---|
| 150 | lldiv_t lldiv(long long, long long) __pure2;
|
|---|
| 151 | /* LONGLONG */
|
|---|
| 152 | long long
|
|---|
| 153 | strtoll(const char * __restrict, char ** __restrict, int);
|
|---|
| 154 | /* LONGLONG */
|
|---|
| 155 | unsigned long long
|
|---|
| 156 | strtoull(const char * __restrict, char ** __restrict, int);
|
|---|
| 157 | #endif /* __LONG_LONG_SUPPORTED */
|
|---|
| 158 |
|
|---|
| 159 | void _Exit(int) __dead2;
|
|---|
| 160 | #endif /* __ISO_C_VISIBLE >= 1999 */
|
|---|
| 161 |
|
|---|
| 162 | /*
|
|---|
| 163 | * Extensions made by POSIX relative to C. We don't know yet which edition
|
|---|
| 164 | * of POSIX made these extensions, so assume they've always been there until
|
|---|
| 165 | * research can be done.
|
|---|
| 166 | */
|
|---|
| 167 | #if __POSIX_VISIBLE /* >= ??? */
|
|---|
| 168 | int posix_memalign(void **, size_t, size_t); /* bird: we implement this. */
|
|---|
| 169 | int rand_r(unsigned *); /* (TSF) */
|
|---|
| 170 | int setenv(const char *, const char *, int);
|
|---|
| 171 | int unsetenv(const char *); /* bird: standard saith shall return int. */
|
|---|
| 172 | #endif
|
|---|
| 173 |
|
|---|
| 174 | /*
|
|---|
| 175 | * The only changes to the XSI namespace in revision 6 were the deletion
|
|---|
| 176 | * of the ttyslot() and valloc() functions, which FreeBSD never declared
|
|---|
| 177 | * in this header. For revision 7, ecvt(), fcvt(), and gcvt(), which
|
|---|
| 178 | * FreeBSD also does not have, and mktemp(), are to be deleted.
|
|---|
| 179 | */
|
|---|
| 180 | #if __XSI_VISIBLE
|
|---|
| 181 | /* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */
|
|---|
| 182 | /* long a64l(const char *); */
|
|---|
| 183 | double drand48(void);
|
|---|
| 184 | /* char *ecvt(double, int, int * __restrict, int * __restrict); */
|
|---|
| 185 | double erand48(unsigned short[3]);
|
|---|
| 186 | /* char *fcvt(double, int, int * __restrict, int * __restrict); */
|
|---|
| 187 | /* char *gcvt(double, int, int * __restrict, int * __restrict); */
|
|---|
| 188 | int getsubopt(char **, char *const *, char **);
|
|---|
| 189 | /** @todo int grantpt(int); */
|
|---|
| 190 | char *initstate(unsigned long /* XSI requires u_int */, char *, long);
|
|---|
| 191 | long jrand48(unsigned short[3]);
|
|---|
| 192 | /* char *l64a(long); */
|
|---|
| 193 | void lcong48(unsigned short[7]);
|
|---|
| 194 | long lrand48(void);
|
|---|
| 195 | #ifndef _MKSTEMP_DECLARED
|
|---|
| 196 | int mkstemp(char *);
|
|---|
| 197 | #define _MKSTEMP_DECLARED
|
|---|
| 198 | #endif
|
|---|
| 199 | #ifndef _MKTEMP_DECLARED
|
|---|
| 200 | char *mktemp(char *);
|
|---|
| 201 | #define _MKTEMP_DECLARED
|
|---|
| 202 | #endif
|
|---|
| 203 | long mrand48(void);
|
|---|
| 204 | long nrand48(unsigned short[3]);
|
|---|
| 205 | /** @todo int posix_openpt(int); */
|
|---|
| 206 | /** @todo char *ptsname(int); */
|
|---|
| 207 | int putenv(const char *);
|
|---|
| 208 | long random(void);
|
|---|
| 209 | char *realpath(const char *, char resolved_path[]);
|
|---|
| 210 | unsigned short
|
|---|
| 211 | *seed48(unsigned short[3]);
|
|---|
| 212 | #ifndef _SETKEY_DECLARED
|
|---|
| 213 | /** @todo int setkey(const char *); */
|
|---|
| 214 | #define _SETKEY_DECLARED
|
|---|
| 215 | #endif
|
|---|
| 216 | char *setstate(/* const */ char *);
|
|---|
| 217 | void srand48(long);
|
|---|
| 218 | void srandom(unsigned long);
|
|---|
| 219 | /** @todo int unlockpt(int); */
|
|---|
| 220 | #endif /* __XSI_VISIBLE */
|
|---|
| 221 |
|
|---|
| 222 | #if __BSD_VISIBLE
|
|---|
| 223 | extern const char *_malloc_options;
|
|---|
| 224 | extern void (*_malloc_message)(const char *, const char *, const char *,
|
|---|
| 225 | const char *);
|
|---|
| 226 |
|
|---|
| 227 | /*
|
|---|
| 228 | * The alloca() function can't be implemented in C, and on some
|
|---|
| 229 | * platforms it can't be implemented at all as a callable function.
|
|---|
| 230 | * The GNU C compiler provides a built-in alloca() which we can use;
|
|---|
| 231 | * in all other cases, provide a prototype, mainly to pacify various
|
|---|
| 232 | * incarnations of lint. On platforms where alloca() is not in libc,
|
|---|
| 233 | * programs which use it will fail to link when compiled with non-GNU
|
|---|
| 234 | * compilers.
|
|---|
| 235 | */
|
|---|
| 236 | #if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
|---|
| 237 | #undef alloca /* some GNU bits try to get cute and define this on their own */
|
|---|
| 238 | #define alloca(sz) __builtin_alloca(sz)
|
|---|
| 239 | #elif defined(lint)
|
|---|
| 240 | void *alloca(size_t);
|
|---|
| 241 | #endif
|
|---|
| 242 |
|
|---|
| 243 | __uint32_t
|
|---|
| 244 | arc4random(void);
|
|---|
| 245 | void arc4random_addrandom(unsigned char *dat, int datlen);
|
|---|
| 246 | void arc4random_stir(void);
|
|---|
| 247 | char *getbsize(int *, long *);
|
|---|
| 248 | /* getcap(3) functions */
|
|---|
| 249 | /** @todo char *cgetcap(char *, const char *, int); */
|
|---|
| 250 | /** @todo int cgetclose(void); */
|
|---|
| 251 | /** @todo int cgetent(char **, char **, const char *); */
|
|---|
| 252 | /** @todo int cgetfirst(char **, char **); */
|
|---|
| 253 | /** @todo int cgetmatch(const char *, const char *); */
|
|---|
| 254 | /** @todo int cgetnext(char **, char **); */
|
|---|
| 255 | /** @todo int cgetnum(char *, const char *, long *); */
|
|---|
| 256 | /** @todo int cgetset(const char *); */
|
|---|
| 257 | /** @todo int cgetstr(char *, const char *, char **); */
|
|---|
| 258 | /** @todo int cgetustr(char *, const char *, char **); */
|
|---|
| 259 |
|
|---|
| 260 | /** @todo int daemon(int, int); */
|
|---|
| 261 | /** @todo char *devname(int, int); */
|
|---|
| 262 | /** @todo char *devname_r(int, int, char *, int); */
|
|---|
| 263 | int getloadavg(double [], int);
|
|---|
| 264 | __const char *
|
|---|
| 265 | getprogname(void);
|
|---|
| 266 |
|
|---|
| 267 | int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
|
|---|
| 268 | int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
|
|---|
| 269 | void qsort_r(void *, size_t, size_t, void *,
|
|---|
| 270 | int (*)(void *, const void *, const void *));
|
|---|
| 271 | int radixsort(const unsigned char **, int, const unsigned char *,
|
|---|
| 272 | unsigned);
|
|---|
| 273 | void *reallocf(void *, size_t);
|
|---|
| 274 | void setprogname(const char *);
|
|---|
| 275 | int sradixsort(const unsigned char **, int, const unsigned char *,
|
|---|
| 276 | unsigned);
|
|---|
| 277 | void sranddev(void);
|
|---|
| 278 | void srandomdev(void);
|
|---|
| 279 |
|
|---|
| 280 | /* Deprecated interfaces, to be removed in FreeBSD 6.0. */
|
|---|
| 281 | /** @todo __int64_t
|
|---|
| 282 | strtoq(const char *, char **, int); */
|
|---|
| 283 | /** @todo __uint64_t
|
|---|
| 284 | strtouq(const char *, char **, int); */
|
|---|
| 285 |
|
|---|
| 286 | extern char *suboptarg; /* getsubopt(3) external variable */
|
|---|
| 287 | #endif /* __BSD_VISIBLE */
|
|---|
| 288 |
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 | /* bird: LIBC stuff - start */
|
|---|
| 292 | #ifdef __BSD_VISIBLE
|
|---|
| 293 | char *_getcwdux(char *, size_t);
|
|---|
| 294 | char *_realrealpath(const char *, char *, size_t);
|
|---|
| 295 | int _getenv_longlong(const char *, long long *);
|
|---|
| 296 | int _getenv_long(const char *, long *);
|
|---|
| 297 | int _getenv_int(const char *, int *);
|
|---|
| 298 | #endif
|
|---|
| 299 | #ifdef __USE_GNU
|
|---|
| 300 | char *canonicalize_file_name(const char *);
|
|---|
| 301 | void *valloc(size_t);
|
|---|
| 302 | #endif
|
|---|
| 303 | int on_exit(void (*)(int, void *), void *);
|
|---|
| 304 | /* bird: LIBC stuff - end */
|
|---|
| 305 |
|
|---|
| 306 |
|
|---|
| 307 | /* bird: EMX/PC stuff - start */
|
|---|
| 308 |
|
|---|
| 309 | #include <malloc.h>
|
|---|
| 310 |
|
|---|
| 311 | #if !defined (_MAX_PATH)
|
|---|
| 312 | #define _MAX_PATH 260
|
|---|
| 313 | #define _MAX_DRIVE 3
|
|---|
| 314 | #define _MAX_DIR 256
|
|---|
| 315 | #define _MAX_FNAME 256
|
|---|
| 316 | #define _MAX_EXT 256
|
|---|
| 317 | #endif
|
|---|
| 318 |
|
|---|
| 319 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX)
|
|---|
| 320 |
|
|---|
| 321 | #if !defined (OS2_MODE)
|
|---|
| 322 | #define DOS_MODE 0
|
|---|
| 323 | #define OS2_MODE 1
|
|---|
| 324 | #endif
|
|---|
| 325 |
|
|---|
| 326 | #ifndef _INTPTR_T_DECLARED
|
|---|
| 327 | typedef __intptr_t intptr_t;
|
|---|
| 328 | typedef __uintptr_t uintptr_t;
|
|---|
| 329 | #define _INTPTR_T_DECLARED
|
|---|
| 330 | #endif
|
|---|
| 331 |
|
|---|
| 332 | #if !defined(_MODE_T_DECLARED) && !defined(_MODE_T) /* bird: emx */
|
|---|
| 333 | typedef __mode_t mode_t;
|
|---|
| 334 | #define _MODE_T_DECLARED
|
|---|
| 335 | #define _MODE_T /* bird: emx */
|
|---|
| 336 | #endif
|
|---|
| 337 |
|
|---|
| 338 | /* declare _errno to be compatible with MS/VAC/WATCOM */
|
|---|
| 339 | #if !defined (_ERRNO)
|
|---|
| 340 | #define _ERRNO
|
|---|
| 341 | extern int * _errno(void);
|
|---|
| 342 | #define errno (* _errno())
|
|---|
| 343 | #endif /* bird: emx */
|
|---|
| 344 |
|
|---|
| 345 | #if !defined (_ULDIV_T)
|
|---|
| 346 | #define _ULDIV_T
|
|---|
| 347 | typedef struct
|
|---|
| 348 | {
|
|---|
| 349 | unsigned long quot;
|
|---|
| 350 | unsigned long rem;
|
|---|
| 351 | } _uldiv_t;
|
|---|
| 352 |
|
|---|
| 353 | #if __ISO_C_VISIBLE >= 1999 && defined(__LONG_LONG_SUPPORTED)
|
|---|
| 354 | typedef struct _lldiv_t _lldiv_t;
|
|---|
| 355 | #else
|
|---|
| 356 | typedef struct
|
|---|
| 357 | {
|
|---|
| 358 | long long quot;
|
|---|
| 359 | long long rem;
|
|---|
| 360 | } _lldiv_t;
|
|---|
| 361 | #endif
|
|---|
| 362 | typedef struct
|
|---|
| 363 | {
|
|---|
| 364 | unsigned long long quot;
|
|---|
| 365 | unsigned long long rem;
|
|---|
| 366 | } _ulldiv_t;
|
|---|
| 367 | #endif
|
|---|
| 368 |
|
|---|
| 369 | extern char **environ;
|
|---|
| 370 |
|
|---|
| 371 | extern __const__ unsigned char _osminor;
|
|---|
| 372 | extern __const__ unsigned char _osmajor;
|
|---|
| 373 |
|
|---|
| 374 | /* No DOS support ... */
|
|---|
| 375 | #define _osmode OS2_MODE
|
|---|
| 376 |
|
|---|
| 377 | unsigned alarm (unsigned);
|
|---|
| 378 | int brk(const void *);
|
|---|
| 379 | int chdir (const char *);
|
|---|
| 380 | char *gcvt (double, int, char *); /* this is rubbish standardwise */
|
|---|
| 381 | char *getcwd (char *, size_t);
|
|---|
| 382 | int getpagesize (void);
|
|---|
| 383 | char *getwd (char *);
|
|---|
| 384 | int mkdir(const char *, mode_t);
|
|---|
| 385 | void perror (const char *);
|
|---|
| 386 | int rmdir (const char *);
|
|---|
| 387 | void *sbrk(intptr_t);
|
|---|
| 388 | unsigned sleep (unsigned);
|
|---|
| 389 | long ulimit (int, ...);
|
|---|
| 390 |
|
|---|
| 391 | char *itoa (int, char *, int);
|
|---|
| 392 | char *ltoa (long, char *, int);
|
|---|
| 393 | char *ultoa (unsigned long, char *, int);
|
|---|
| 394 | char *lltoa (long long, char *, int);
|
|---|
| 395 | char *ulltoa (unsigned long long, char *, int);
|
|---|
| 396 |
|
|---|
| 397 | #endif
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 | #if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) || defined (_WITH_UNDERSCORE) || defined(__USE_EMX)
|
|---|
| 401 |
|
|---|
| 402 | extern char **_environ;
|
|---|
| 403 | extern __const__ char * __const__ _sys_errlist[];
|
|---|
| 404 | extern __const__ int _sys_nerr;
|
|---|
| 405 |
|
|---|
| 406 | unsigned _alarm (unsigned);
|
|---|
| 407 | int _brk(const void *);
|
|---|
| 408 | int _chdir (__const__ char *);
|
|---|
| 409 | char *_gcvt (double, int, char *);
|
|---|
| 410 | char *_getcwd (char *, size_t);
|
|---|
| 411 | int _getpagesize (void);
|
|---|
| 412 | char *_getwd (char *);
|
|---|
| 413 | int _mkdir (__const__ char *, long);
|
|---|
| 414 | int _putenv (__const__ char *);
|
|---|
| 415 | int _rmdir (__const__ char *);
|
|---|
| 416 | void *_sbrk(intptr_t);
|
|---|
| 417 | unsigned _sleep (unsigned);
|
|---|
| 418 | void _swab (__const__ void *, void *, size_t);
|
|---|
| 419 | long _ulimit (int, ...);
|
|---|
| 420 |
|
|---|
| 421 | int _abspath (char *, __const__ char *, int);
|
|---|
| 422 | long long _atoll (__const__ char *);
|
|---|
| 423 | long double _atofl (__const__ char *);
|
|---|
| 424 | int _chdir2 (__const__ char *);
|
|---|
| 425 | int _chdir_os2 (const char *);
|
|---|
| 426 | int _chdrive (int);
|
|---|
| 427 | int _core (int);
|
|---|
| 428 | void _defext (char *, __const__ char *);
|
|---|
| 429 | void _envargs (int *, char ***, __const__ char *);
|
|---|
| 430 | int _execname (char *, size_t);
|
|---|
| 431 | void _exit (int) __attribute__ ((__noreturn__));
|
|---|
| 432 | int _filesys (__const__ char *, char *, size_t);
|
|---|
| 433 | char **_fnexplode (__const__ char *);
|
|---|
| 434 | void _fnexplodefree (char **);
|
|---|
| 435 | char _fngetdrive (__const__ char *);
|
|---|
| 436 | int _fnisabs (__const__ char *);
|
|---|
| 437 | int _fnisrel (__const__ char *);
|
|---|
| 438 | void _fnlwr (char *);
|
|---|
| 439 | void _fnlwr2 (char *, __const__ char *);
|
|---|
| 440 | char *_fnslashify (char *);
|
|---|
| 441 | int _fullpath (char *, __const__ char *, int);
|
|---|
| 442 | int _getcwd1 (char *, char);
|
|---|
| 443 | char *_getcwd2 (char *, int);
|
|---|
| 444 | int _getdrive (void);
|
|---|
| 445 | char *_getext (__const__ char *);
|
|---|
| 446 | char *_getext2 (__const__ char *);
|
|---|
| 447 | char *_getname (__const__ char *);
|
|---|
| 448 | int _getsockhandle (int);
|
|---|
| 449 | int _gettid (void);
|
|---|
| 450 | char *_getvol (char);
|
|---|
| 451 | char *_itoa (int, char *, int);
|
|---|
| 452 | _lldiv_t _lldiv (long long, long long);
|
|---|
| 453 | char *_lltoa (long long, char *, int);
|
|---|
| 454 | _uldiv_t _uldiv (unsigned long, unsigned long);
|
|---|
| 455 | _ulldiv_t _ulldiv (unsigned long long, unsigned long long);
|
|---|
| 456 | char *_itoa (int, char *, int);
|
|---|
| 457 | char *_ltoa (long, char *, int);
|
|---|
| 458 | char *_ultoa (unsigned long, char *, int);
|
|---|
| 459 | char *_lltoa (long long, char *, int);
|
|---|
| 460 | char *_ulltoa (unsigned long long, char *, int);
|
|---|
| 461 | void _makepath (char *, __const__ char *, __const__ char *,
|
|---|
| 462 | __const__ char *, __const__ char *);
|
|---|
| 463 | int _path (char *, __const__ char *);
|
|---|
| 464 | int _read_kbd (int, int, int);
|
|---|
| 465 | void _remext (char *);
|
|---|
| 466 | void _rfnlwr (void);
|
|---|
| 467 | void _response (int *, char ***);
|
|---|
| 468 | void _scrsize (int *);
|
|---|
| 469 | void _searchenv (__const__ char *, __const__ char *, char *);
|
|---|
| 470 | void _sfnlwr (__const__ char *);
|
|---|
| 471 | unsigned _sleep2 (unsigned);
|
|---|
| 472 | char ** _splitargs (char *, int *);
|
|---|
| 473 | void _splitpath (__const__ char *, char *, char *, char *, char *);
|
|---|
| 474 | float _strtof (__const__ char *, char **);
|
|---|
| 475 | long double _strtold (__const__ char *, char **);
|
|---|
| 476 | long long _strtoll (__const__ char *, char **, int);
|
|---|
| 477 | unsigned long long _strtoull (__const__ char *, char **, int);
|
|---|
| 478 | char _swchar (void);
|
|---|
| 479 | void _wildcard (int *, char ***);
|
|---|
| 480 |
|
|---|
| 481 | int _beginthread (void (*)(void *), void *, unsigned, void *);
|
|---|
| 482 | void _endthread (void);
|
|---|
| 483 | void **_threadstore (void);
|
|---|
| 484 |
|
|---|
| 485 | int _setenv(const char *envname, const char *envval, int overwrite);
|
|---|
| 486 | int _unsetenv(const char *name);
|
|---|
| 487 |
|
|---|
| 488 | #endif
|
|---|
| 489 |
|
|---|
| 490 | __END_DECLS
|
|---|
| 491 |
|
|---|
| 492 | /* bird: EMX/PC stuff - end */
|
|---|
| 493 |
|
|---|
| 494 | #endif /* !_STDLIB_H_ */
|
|---|
| 495 |
|
|---|