Changeset View
Changeset View
Standalone View
Standalone View
include/stdlib.h
| Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | |||||||||
| #endif /* __XSI_VISIBLE */ | #endif /* __XSI_VISIBLE */ | ||||||||
| #if __XSI_VISIBLE | #if __XSI_VISIBLE | ||||||||
| int grantpt(int); | int grantpt(int); | ||||||||
| int posix_openpt(int); | int posix_openpt(int); | ||||||||
| char *ptsname(int); | char *ptsname(int); | ||||||||
| int unlockpt(int); | int unlockpt(int); | ||||||||
| #endif /* __XSI_VISIBLE */ | #endif /* __XSI_VISIBLE */ | ||||||||
| #if __BSD_VISIBLE | /* | ||||||||
| /* ptsname_r will be included in POSIX issue 8 */ | * ptsname_r is included in POSIX issue 8 (IEEE Std 1003.1-2024). | ||||||||
| * posix_ptsname_r() is the POSIX-compliant interface (returns error number). | |||||||||
| * ptsname_r() is the traditional FreeBSD interface (returns -1 and sets errno). | |||||||||
| * When _POSIX_C_SOURCE >= 202405, ptsname_r is aliased to posix_ptsname_r. | |||||||||
| */ | |||||||||
| #if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 202405) || __BSD_VISIBLE | |||||||||
| int posix_ptsname_r(int, char *, size_t); | |||||||||
| #endif | |||||||||
| #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 202405 | |||||||||
kib: Why not add the preprocessor hack synchronously with the function prototype? I do not quite… | |||||||||
| #define ptsname_r posix_ptsname_r | |||||||||
kibUnsubmitted Not Done Inline Actions
kib: | |||||||||
| #elif __BSD_VISIBLE | |||||||||
| int ptsname_r(int, char *, size_t); | int ptsname_r(int, char *, size_t); | ||||||||
| #endif | #endif | ||||||||
Not Done Inline ActionsLooking at this hack, and at the warning(), I think we do not want it is way. Instead, name the new function posix_ptsname_r() and keep existing ptsname_r() as is. Then, if _POSIX_C_SOURCE is right, do #define ptsname_r posix_ptsname_r. This way we do not need to require sym_compat() working in our public header. kib: Looking at this hack, and at the warning(), I think we do not want it is way. Instead, name the… | |||||||||
| #if __BSD_VISIBLE | #if __BSD_VISIBLE | ||||||||
| extern const char *malloc_conf; | extern const char *malloc_conf; | ||||||||
| extern void (*malloc_message)(void *, const char *); | extern void (*malloc_message)(void *, const char *); | ||||||||
| /* | /* | ||||||||
| * The alloca() function can't be implemented in C, and on some | * The alloca() function can't be implemented in C, and on some | ||||||||
| * platforms it can't be implemented at all as a callable function. | * platforms it can't be implemented at all as a callable function. | ||||||||
| ▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines | |||||||||
Why not add the preprocessor hack synchronously with the function prototype? I do not quite see why default compilation env (AKA __BSD_VISIBLE) is excluded.