Changeset View
Changeset View
Standalone View
Standalone View
include/stdlib.h
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
int l64a_r(long, char *, int); | int l64a_r(long, char *, int); | ||||
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); | int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); | ||||
#ifdef __BLOCKS__ | #ifdef __BLOCKS__ | ||||
int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); | int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); | ||||
#endif | #endif | ||||
int mkostemp(char *, int); | int mkostemp(char *, int); | ||||
int mkostemps(char *, int, int); | int mkostemps(char *, int, int); | ||||
int mkostempsat(int, char *, int, int); | int mkostempsat(int, char *, int, int); | ||||
void qsort_r(void *, size_t, size_t, void *, | void qsort_r(void *, size_t, size_t, | ||||
int (*)(void *, const void *, const void *)); | int (*)(const void *, const void *, void *), void *); | ||||
int radixsort(const unsigned char **, int, const unsigned char *, | int radixsort(const unsigned char **, int, const unsigned char *, | ||||
unsigned); | unsigned); | ||||
void *reallocarray(void *, size_t, size_t) __result_use_check | void *reallocarray(void *, size_t, size_t) __result_use_check | ||||
__alloc_size2(2, 3); | __alloc_size2(2, 3); | ||||
void *reallocf(void *, size_t) __result_use_check __alloc_size(2); | void *reallocf(void *, size_t) __result_use_check __alloc_size(2); | ||||
int rpmatch(const char *); | int rpmatch(const char *); | ||||
void setprogname(const char *); | void setprogname(const char *); | ||||
int sradixsort(const unsigned char **, int, const unsigned char *, | int sradixsort(const unsigned char **, int, const unsigned char *, | ||||
unsigned); | unsigned); | ||||
void srandomdev(void); | void srandomdev(void); | ||||
long long | long long | ||||
strtonum(const char *, long long, long long, const char **); | strtonum(const char *, long long, long long, const char **); | ||||
/* Deprecated interfaces, to be removed. */ | /* Deprecated interfaces, to be removed. */ | ||||
__int64_t | __int64_t | ||||
strtoq(const char *, char **, int); | strtoq(const char *, char **, int); | ||||
__uint64_t | __uint64_t | ||||
strtouq(const char *, char **, int); | strtouq(const char *, char **, int); | ||||
/* | |||||
* In FreeBSD 14, the prototype of qsort_r() was modified to comply with | |||||
emaste: Maybe we should call it the "historical FreeBSD qsort_r" or BSD qsort_r? To give some context… | |||||
* POSIX. The standardized qsort_r()'s order of last two parameters was | |||||
* changed, and the comparator function is now taking thunk as its last | |||||
* parameter, and both are different from the ones expected by the historical | |||||
* FreeBSD qsort_r() interface. | |||||
* | |||||
* Apply a workaround where we explicitly link against the historical | |||||
* interface, qsort_r@FBSD_1.0, in case when qsort_r() is called with | |||||
* the last parameter with a function pointer that exactly matches the | |||||
* historical FreeBSD qsort_r() comparator signature, so applications | |||||
* written for the historical interface can continue to work without | |||||
* modification. | |||||
*/ | |||||
#if defined(__generic) || defined(__cplusplus) | |||||
void __qsort_r_compat(void *, size_t, size_t, void *, | |||||
int (*)(void *, const void *, const void *)); | |||||
__sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0); | |||||
#endif | |||||
#if defined(__generic) && !defined(__cplusplus) | |||||
#define qsort_r(base, nel, width, arg4, arg5) \ | |||||
__generic(arg5, int (*)(void *, const void *, const void *), \ | |||||
__qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5) | |||||
#elif defined(__cplusplus) | |||||
__END_DECLS | |||||
extern "C++" { | |||||
static inline void qsort_r(void *base, size_t nmemb, size_t size, | |||||
void *thunk, int (*compar)(void *, const void *, const void *)) { | |||||
__qsort_r_compat(base, nmemb, size, thunk, compar); | |||||
} | |||||
} | |||||
__BEGIN_DECLS | |||||
#endif | |||||
extern char *suboptarg; /* getsubopt(3) external variable */ | extern char *suboptarg; /* getsubopt(3) external variable */ | ||||
#endif /* __BSD_VISIBLE */ | #endif /* __BSD_VISIBLE */ | ||||
#if __EXT1_VISIBLE | #if __EXT1_VISIBLE | ||||
#ifndef _RSIZE_T_DEFINED | #ifndef _RSIZE_T_DEFINED | ||||
#define _RSIZE_T_DEFINED | #define _RSIZE_T_DEFINED | ||||
Show All 27 Lines |
Maybe we should call it the "historical FreeBSD qsort_r" or BSD qsort_r? To give some context for what the scope of the change is/was.