X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/blobdiff_plain/81fc95a5293ee307c688a350a3feb4734aaddbb4..1319714e28c23676db609f63ac5fae4b6a13df48:/include/stdlib.h diff --git a/include/stdlib.h b/include/stdlib.h index 9e2f41f884..2945bab0bf 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -41,6 +41,13 @@ #include #include +#if __BSD_VISIBLE +#ifndef _RUNE_T_DECLARED +typedef __rune_t rune_t; +#define _RUNE_T_DECLARED +#endif +#endif + #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED @@ -68,10 +75,14 @@ typedef struct { #define RAND_MAX 0x7fffffff +__BEGIN_DECLS +#ifdef _XLOCALE_H_ +#include +#endif extern int __mb_cur_max; -#define MB_CUR_MAX __mb_cur_max +extern int ___mb_cur_max(void); +#define MB_CUR_MAX (___mb_cur_max()) -__BEGIN_DECLS void abort(void) __dead2; /* void abort2(const char *, int, void **) __dead2; */ #if !defined(_KERNEL_VIRTUAL) @@ -83,7 +94,7 @@ int atoi(const char *); long atol(const char *); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); -void *calloc(size_t, size_t); +void *calloc(size_t, size_t) __heedresult; div_t div(int, int) __pure2; void exit(int) __dead2; void free(void *); @@ -92,14 +103,14 @@ char *getenv(const char *); long labs(long) __pure2; #endif ldiv_t ldiv(long, long) __pure2; -void *malloc(size_t); +void *malloc(size_t) __heedresult; int posix_memalign(void **, size_t, size_t); int mblen(const char *, size_t); size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); int rand(void); -void *realloc(void *, size_t); +void *realloc(void *, size_t) __heedresult; void srand(unsigned); double strtod(const char * __restrict, char ** __restrict); float strtof(const char * __restrict, char ** __restrict); @@ -166,6 +177,7 @@ int unsetenv(const char *); #endif #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE +int getsubopt(char **, char *const *, char **); #ifndef _MKDTEMP_DECLARED char *mkdtemp(char *); #define _MKDTEMP_DECLARED @@ -186,11 +198,14 @@ int mkstemp(char *); /* XXX XSI requires pollution from here. We'd rather not. */ long a64l(const char *); double drand48(void); -/* char *ecvt(double, int, int * __restrict, int * __restrict); */ double erand48(unsigned short[3]); -/* char *fcvt(double, int, int * __restrict, int * __restrict); */ -/* char *gcvt(double, int, int * __restrict, int * __restrict); */ -int getsubopt(char **, char *const *, char **); +#if 0 +#if __BSD_VISIBLE || __XSI_VISIBLE <= 600 +char *ecvt(double, int, int * __restrict, int * __restrict); /* LEGACY */ +char *fcvt(double, int, int * __restrict, int * __restrict); /* LEGACY */ +char *gcvt(double, int, int * __restrict, int * __restrict); /* LEGACY */ +#endif +#endif int grantpt(int); char *initstate(unsigned long /* XSI requires u_int */, char *, long); long jrand48(unsigned short[3]); @@ -198,7 +213,7 @@ char *l64a(long); void lcong48(unsigned short[7]); long lrand48(void); #if !defined(_MKTEMP_DECLARED) && (__BSD_VISIBLE || __XSI_VISIBLE <= 600) -char *mktemp(char *); +char *mktemp(char *); /* LEGACY */ #define _MKTEMP_DECLARED #endif long mrand48(void); @@ -275,7 +290,7 @@ void qsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); int radixsort(const unsigned char **, int, const unsigned char *, unsigned int); -void *reallocf(void *, size_t); +void *reallocf(void *, size_t) __heedresult; int rpmatch(const char *); void setprogname(const char *); int sradixsort(const unsigned char **, int, const unsigned char *, @@ -299,10 +314,11 @@ extern char *suboptarg; /* getsubopt(3) external variable */ /* * C11 functions. */ -#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L || __BSD_VISIBLE +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L int at_quick_exit(void (*func)(void)); -void quick_exit(int) __dead2; -void *aligned_alloc(size_t, size_t); +_Noreturn void + quick_exit(int); +void *aligned_alloc(size_t, size_t) __heedresult; #endif /* __ISO_C_VISIBLE >= 2011 */ __END_DECLS