diff --git a/headers/posix/ctype.h b/headers/posix/ctype.h index 57b2820eff..7693ae6e09 100644 --- a/headers/posix/ctype.h +++ b/headers/posix/ctype.h @@ -6,6 +6,9 @@ #define _CTYPE_H +#include + + #ifdef __cplusplus extern "C" { #endif @@ -27,6 +30,22 @@ int toascii(int); int tolower(int); int toupper(int); + +int isalnum_l(int, locale_t); +int isalpha_l(int, locale_t); +int isblank_l(int, locale_t); +int iscntrl_l(int, locale_t); +int isdigit_l(int, locale_t); +int isgraph_l(int, locale_t); +int islower_l(int, locale_t); +int isprint_l(int, locale_t); +int ispunct_l(int, locale_t); +int isspace_l(int, locale_t); +int isupper_l(int, locale_t); +int isxdigit_l(int, locale_t); +int tolower_l(int, locale_t); +int toupper_l(int, locale_t); + enum { _ISblank = 0x0001, /* blank */ _IScntrl = 0x0002, /* control */ @@ -48,14 +67,19 @@ extern const unsigned short int *__ctype_b; extern const int *__ctype_tolower; extern const int *__ctype_toupper; +extern const unsigned short int **__ctype_b_loc(); +extern const int **__ctype_tolower_loc(); +extern const int **__ctype_toupper_loc(); + #define __isctype(c, type) \ - (__ctype_b[(int)(c)] & (unsigned short int)type) + ((*__ctype_b_loc())[(int)(c)] & (unsigned short int)type) + +#define tolower(c) ((int)(*__ctype_tolower_loc())[(int)(c)]) +#define toupper(c) ((int)(*__ctype_toupper_loc())[(int)(c)]) #define isascii(c) (((c) & ~0x7f) == 0) /* ASCII characters have bit 8 cleared */ #define toascii(c) ((c) & 0x7f) /* Clear higher bits */ -#define tolower(c) ((int)__ctype_tolower[(int)(c)]) -#define toupper(c) ((int)__ctype_toupper[(int)(c)]) #define _tolower(c) tolower(c) #define _toupper(c) toupper(c) diff --git a/headers/posix/langinfo.h b/headers/posix/langinfo.h index d5dc7c819f..f01d042485 100644 --- a/headers/posix/langinfo.h +++ b/headers/posix/langinfo.h @@ -145,6 +145,7 @@ enum { __BEGIN_DECLS extern char* nl_langinfo(nl_item item); +extern char* nl_langinfo_l(nl_item item, locale_t locale); __END_DECLS diff --git a/headers/posix/locale.h b/headers/posix/locale.h index 2cc8717623..46d6103084 100644 --- a/headers/posix/locale.h +++ b/headers/posix/locale.h @@ -6,6 +6,7 @@ #define _LOCALE_H_ +#include #include struct lconv { @@ -48,6 +49,19 @@ struct lconv { */ #define LC_LAST LC_MESSAGES +#define LC_COLLATE_MASK (1 << (LC_COLLATE - 1)) +#define LC_CTYPE_MASK (1 << (LC_CTYPE - 1)) +#define LC_MONETARY_MASK (1 << (LC_MONETARY - 1)) +#define LC_NUMERIC_MASK (1 << (LC_NUMERIC - 1)) +#define LC_TIME_MASK (1 << (LC_TIME - 1)) +#define LC_MESSAGES_MASK (1 << (LC_MESSAGES - 1)) + +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \ + LC_MONETARY_MASK | LC_NUMERIC_MASK | \ + LC_TIME_MASK | LC_MESSAGES_MASK) + +#define LC_GLOBAL_LOCALE ((locale_t)-1) + #ifdef __cplusplus extern "C" { #endif @@ -55,6 +69,11 @@ extern "C" { extern struct lconv *localeconv(void); extern char *setlocale(int category, const char *locale); +extern locale_t duplocale(locale_t); +extern void freelocale(locale_t); +extern locale_t newlocale(int, const char *, locale_t); +extern locale_t uselocale(locale_t); + #ifdef __cplusplus } #endif diff --git a/headers/posix/locale_t.h b/headers/posix/locale_t.h new file mode 100644 index 0000000000..f6c3b3d503 --- /dev/null +++ b/headers/posix/locale_t.h @@ -0,0 +1,12 @@ +/* + * Copyright 2022 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _LOCALE_T_H_ +#define _LOCALE_T_H_ + + +typedef void* locale_t; + + +#endif \ No newline at end of file diff --git a/headers/posix/monetary.h b/headers/posix/monetary.h index 0624f4c31c..084f9d1017 100644 --- a/headers/posix/monetary.h +++ b/headers/posix/monetary.h @@ -6,7 +6,7 @@ #define _MONETARY_H_ -#include +#include #include #include #include @@ -15,6 +15,7 @@ __BEGIN_DECLS extern ssize_t strfmon(char* s, size_t maxsize, const char* format, ...); +extern ssize_t strfmon_l(char* s, size_t maxsize, locale_t locale, const char* format, ...); __END_DECLS diff --git a/headers/posix/string.h b/headers/posix/string.h index 6f19108379..235b982e45 100644 --- a/headers/posix/string.h +++ b/headers/posix/string.h @@ -6,6 +6,7 @@ #define _STRING_H_ +#include #include @@ -74,6 +75,11 @@ extern char *strupr(char *string); extern const char *strsignal(int signum); +/* locale versions of string functions */ +extern int strcoll_l(const char *string1, const char *string2, locale_t locale); +extern char *strerror_l(int errorCode, locale_t locale); +extern size_t strxfrm_l(char *string1, const char *string2, size_t length, locale_t locale); + /* for compatibility, pull in functions declared in strings.h */ #include diff --git a/headers/posix/strings.h b/headers/posix/strings.h index 5a70c862b5..a6ef1c879e 100644 --- a/headers/posix/strings.h +++ b/headers/posix/strings.h @@ -6,6 +6,7 @@ #define _STRINGS_H_ +#include #include @@ -19,6 +20,10 @@ extern int strcasecmp(const char *string1, const char *string2); extern int strncasecmp(const char *string1, const char *string2, size_t length); +extern int strcasecmp_l(const char *string1, const char *string2, locale_t locale); +extern int strncasecmp_l(const char *string1, const char *string2, + size_t length, locale_t locale); + /* legacy compatibility -- might be removed one day */ #define bcmp(a, b, length) memcmp((a), (b), (length)) #define bcopy(source, dest, length) memmove((dest), (source), (length)) diff --git a/headers/posix/time.h b/headers/posix/time.h index 1658b696e0..347cc80b2c 100644 --- a/headers/posix/time.h +++ b/headers/posix/time.h @@ -6,6 +6,7 @@ #define _TIME_H_ +#include #include @@ -92,6 +93,8 @@ extern struct tm *localtime_r(const time_t *timer, struct tm *tm); extern int nanosleep(const struct timespec *, struct timespec *); extern size_t strftime(char *buffer, size_t maxSize, const char *format, const struct tm *tm); +extern size_t strftime_l(char *buffer, size_t maxSize, const char *format, + const struct tm *tm, locale_t locale); extern char *strptime(const char *buf, const char *format, struct tm *tm); /* clock functions */ diff --git a/headers/posix/wchar.h b/headers/posix/wchar.h index a2a82d4547..727fda02ca 100644 --- a/headers/posix/wchar.h +++ b/headers/posix/wchar.h @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -93,6 +94,7 @@ extern wchar_t *wcpcpy(wchar_t *dest, const wchar_t *src); extern wchar_t *wcpncpy(wchar_t *dest, const wchar_t *src, size_t srcLength); extern size_t wcrtomb(char *dest, wchar_t wc, mbstate_t *mbState); extern int wcscasecmp(const wchar_t *wcs1, const wchar_t *wcs2); +extern int wcscasecmp_l(const wchar_t *wcs1, const wchar_t *wcs2, locale_t locale); extern wchar_t *wcscat(wchar_t *dest, const wchar_t *src); extern wchar_t *wcschr(const wchar_t *wcs, wchar_t wc); #ifdef _GNU_SOURCE @@ -100,6 +102,7 @@ extern wchar_t *wcschrnul(const wchar_t *wcs, wchar_t wc); #endif extern int wcscmp(const wchar_t *wcs1, const wchar_t *wcs2); extern int wcscoll(const wchar_t *wcs1, const wchar_t *wcs2); +extern int wcscoll_l(const wchar_t *wcs1, const wchar_t *wcs2, locale_t locale); extern wchar_t *wcscpy(wchar_t *dest, const wchar_t *src); extern size_t wcscspn(const wchar_t *wcs, const wchar_t *reject); extern wchar_t *wcsdup(const wchar_t *wcs); @@ -110,6 +113,8 @@ extern size_t wcslcpy(wchar_t *dest, const wchar_t *src, size_t maxLength); extern size_t wcslen(const wchar_t *wcs); extern int wcsncasecmp(const wchar_t *wcs1, const wchar_t *wcs2, size_t maxLength); +extern int wcsncasecmp_l(const wchar_t *wcs1, const wchar_t *wcs2, + size_t maxLength, locale_t locale); extern wchar_t *wcsncat(wchar_t *dest, const wchar_t *src, size_t srcLength); extern int wcsncmp(const wchar_t *wcs1, const wchar_t *wcs2, size_t length); @@ -136,6 +141,8 @@ extern unsigned long long wcstoull(const wchar_t *wcs, wchar_t **endPtr, extern wchar_t *wcswcs(const wchar_t *haystack, const wchar_t *needle); extern int wcswidth(const wchar_t *wcs, size_t length); extern size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t destLength); +extern size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t destLength, + locale_t locale); extern int wctob(wint_t wc); extern int wcwidth(wchar_t wc); extern wchar_t *wmemchr(const wchar_t *wcs, wchar_t wc, size_t n); diff --git a/headers/posix/wctype.h b/headers/posix/wctype.h index 00d7776542..087cd9109e 100644 --- a/headers/posix/wctype.h +++ b/headers/posix/wctype.h @@ -6,6 +6,7 @@ #define _WCTYPE_H_ +#include #include typedef int wctrans_t; @@ -36,6 +37,29 @@ extern wint_t towupper(wint_t wc); extern wctrans_t wctrans(const char *charClass); extern wctype_t wctype(const char *property); + +extern int iswalnum_l(wint_t wc, locale_t locale); +extern int iswalpha_l(wint_t wc, locale_t locale); +extern int iswcntrl_l(wint_t wc, locale_t locale); +extern int iswctype_l(wint_t wc, wctype_t desc, locale_t locale); +extern int iswdigit_l(wint_t wc, locale_t locale); +extern int iswgraph_l(wint_t wc, locale_t locale); +extern int iswlower_l(wint_t wc, locale_t locale); +extern int iswprint_l(wint_t wc, locale_t locale); +extern int iswpunct_l(wint_t wc, locale_t locale); +extern int iswspace_l(wint_t wc, locale_t locale); +extern int iswupper_l(wint_t wc, locale_t locale); +extern int iswxdigit_l(wint_t wc, locale_t locale); + +extern int iswblank_l(wint_t wc, locale_t locale); + +extern wint_t towctrans_l(wint_t wc, wctrans_t transition, locale_t locale); +extern wint_t towlower_l(wint_t wc, locale_t locale); +extern wint_t towupper_l(wint_t wc, locale_t locale); + +extern wctrans_t wctrans_l(const char *charClass, locale_t locale); +extern wctype_t wctype_l(const char *property, locale_t locale); + #ifdef __cplusplus } #endif diff --git a/headers/private/libroot/locale/LocaleBackend.h b/headers/private/libroot/locale/LocaleBackend.h index 38798b366b..e552b34630 100644 --- a/headers/private/libroot/locale/LocaleBackend.h +++ b/headers/private/libroot/locale/LocaleBackend.h @@ -8,11 +8,11 @@ #include +#include #include #include -struct lconv; struct lc_time_t; struct locale_data; // glibc @@ -22,29 +22,38 @@ namespace Libroot { struct LocaleCtypeDataBridge { - const unsigned short** addrOfClassInfoTable; - const int** addrOfToLowerTable; - const int** addrOfToUpperTable; +private: + const unsigned short* localClassInfoTable; + const int* localToLowerTable; + const int* localToUpperTable; - const unsigned short* posixClassInfo; - const int* posixToLowerMap; - const int* posixToUpperMap; +public: + const unsigned short** addrOfClassInfoTable; + const int** addrOfToLowerTable; + const int** addrOfToUpperTable; - LocaleCtypeDataBridge(); + const unsigned short* const posixClassInfo; + const int* const posixToLowerMap; + const int* const posixToUpperMap; + + bool isGlobal; + + LocaleCtypeDataBridge(bool isGlobal); void setMbCurMax(unsigned short mbCurMax); + void ApplyToCurrentThread(); }; struct LocaleMessagesDataBridge { - const char** posixLanginfo; + const char** const posixLanginfo; LocaleMessagesDataBridge(); }; struct LocaleMonetaryDataBridge { - const struct lconv* posixLocaleConv; + const struct lconv* const posixLocaleConv; LocaleMonetaryDataBridge(); }; @@ -71,29 +80,42 @@ private: values[6]; }; locale_data* originalGlibcLocale; + GlibcNumericLocale glibcNumericLocaleData; public: - const struct lconv* posixLocaleConv; - GlibcNumericLocale glibcNumericLocale; + const struct lconv* const posixLocaleConv; + GlibcNumericLocale* glibcNumericLocale; + bool isGlobal; - LocaleNumericDataBridge(); + LocaleNumericDataBridge(bool isGlobal); ~LocaleNumericDataBridge(); + + void ApplyToCurrentThread(); }; struct LocaleTimeDataBridge { - const struct lc_time_t* posixLCTimeInfo; + const struct lc_time_t* const posixLCTimeInfo; LocaleTimeDataBridge(); }; struct TimeConversionDataBridge { +private: + int localDaylight; + long localTimezone; + char* localTZName[2]; + char localTZName0[64]; + char localTZName1[64]; + +public: int* addrOfDaylight; long* addrOfTimezone; char** addrOfTZName; + bool isGlobal; - TimeConversionDataBridge(); + TimeConversionDataBridge(bool isGlobal); }; @@ -104,9 +126,12 @@ struct LocaleDataBridge { LocaleNumericDataBridge numericDataBridge; LocaleTimeDataBridge timeDataBridge; TimeConversionDataBridge timeConversionDataBridge; - const char** posixLanginfo; + const char** const posixLanginfo; + bool isGlobal; - LocaleDataBridge(); + LocaleDataBridge(bool isGlobal); + + void ApplyToCurrentThread(); }; @@ -162,12 +187,25 @@ public: virtual void Initialize(LocaleDataBridge* dataBridge) = 0; static status_t LoadBackend(); + static LocaleBackend* CreateBackend(); + static void DestroyBackend(LocaleBackend* instance); }; -extern LocaleBackend* gLocaleBackend; +// The real struct behind locale_t +struct LocaleBackendData { + int magic; + LocaleBackend* backend; + LocaleDataBridge* databridge; +}; +LocaleBackendData* GetCurrentLocaleInfo(); +void SetCurrentLocaleInfo(LocaleBackendData* newLocale); +LocaleBackend* GetCurrentLocaleBackend(); +extern LocaleBackend* gGlobalLocaleBackend; +extern LocaleDataBridge gGlobalLocaleDataBridge; + } // namespace Libroot } // namespace BPrivate diff --git a/headers/private/libroot/locale/ThreadLocale.h b/headers/private/libroot/locale/ThreadLocale.h new file mode 100644 index 0000000000..99dd64ef32 --- /dev/null +++ b/headers/private/libroot/locale/ThreadLocale.h @@ -0,0 +1,60 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#ifndef _THREAD_LOCALE_H +#define _THREAD_LOCALE_H + + +#include "LocaleBackend.h" + + +namespace BPrivate { +namespace Libroot { + + +// This struct is taken from glibc's __locale_struct +// from xlocale.h. +// It will also be used by glibc so it should have the same +// layout. +struct GlibcLocaleStruct { + void *__locales[7]; /* 7 = __LC_LAST. */ + + const unsigned short int *__ctype_b; + const int *__ctype_tolower; + const int *__ctype_toupper; +}; + + +// Taken from glibc's bits/locale.h +// glibc uses different codes from our the native locale.h. +// This should be the values used for the indexes +// in GlibcLocaleStruct. +enum { + GLIBC_LC_CTYPE = 0, + GLIBC_LC_NUMERIC = 1, + GLIBC_LC_TIME = 2, + GLIBC_LC_COLLATE = 3, + GLIBC_LC_MONETARY = 4, + GLIBC_LC_MESSAGES = 5, + GLIBC_LC_ALL = 6, +}; + + +// The pointer in the TLS will point to this struct. +struct ThreadLocale { + GlibcLocaleStruct glibcLocaleStruct; + LocaleBackendData* threadLocaleInfo; +}; + + +ThreadLocale* GetCurrentThreadLocale(); + + +} // namespace Libroot +} // namespace BPrivate + + +#endif // _THREAD_LOCALE_H diff --git a/headers/private/libroot/time/timelocal.h b/headers/private/libroot/time/timelocal.h index 5e5983443f..a75fb31f24 100644 --- a/headers/private/libroot/time/timelocal.h +++ b/headers/private/libroot/time/timelocal.h @@ -29,6 +29,7 @@ #define _TIMELOCAL_H_ +#include #include @@ -54,6 +55,7 @@ struct lc_time_t { __BEGIN_DECLS const struct lc_time_t* __get_current_time_locale(void); +const struct lc_time_t* __get_time_locale(locale_t); __END_DECLS diff --git a/headers/private/libroot/wchar_private.h b/headers/private/libroot/wchar_private.h index 5f232c3dc6..a4f583b232 100644 --- a/headers/private/libroot/wchar_private.h +++ b/headers/private/libroot/wchar_private.h @@ -33,11 +33,15 @@ extern wchar_t *__wcpcpy(wchar_t *dest, const wchar_t *src); extern wchar_t *__wcpncpy(wchar_t *dest, const wchar_t *src, size_t srcLength); extern size_t __wcrtomb(char *dest, wchar_t wc, mbstate_t *mbState); extern int __wcscasecmp(const wchar_t *wcs1, const wchar_t *wcs2); +extern int __wcscasecmp_l(const wchar_t *wcs1, const wchar_t *wcs2, + locale_t locale); extern wchar_t *__wcscat(wchar_t *dest, const wchar_t *src); extern wchar_t *__wcschr(const wchar_t *wcs, wchar_t wc); extern wchar_t *__wcschrnul(const wchar_t *wcs, wchar_t wc); extern int __wcscmp(const wchar_t *wcs1, const wchar_t *wcs2); extern int __wcscoll(const wchar_t *wcs1, const wchar_t *wcs2); +extern int __wcscoll_l(const wchar_t *wcs1, const wchar_t *wcs2, + locale_t locale); extern wchar_t *__wcscpy(wchar_t *dest, const wchar_t *src); extern size_t __wcscspn(const wchar_t *wcs, const wchar_t *reject); extern wchar_t *__wcsdup(const wchar_t *wcs); @@ -48,6 +52,8 @@ extern size_t __wcslcpy(wchar_t *dest, const wchar_t *src, size_t maxLength); extern size_t __wcslen(const wchar_t *wcs); extern int __wcsncasecmp(const wchar_t *wcs1, const wchar_t *wcs2, size_t maxLength); +extern int __wcsncasecmp_l(const wchar_t *wcs1, const wchar_t *wcs2, + size_t maxLength, locale_t locale); extern wchar_t *__wcsncat(wchar_t *dest, const wchar_t *src, size_t srcLength); extern int __wcsncmp(const wchar_t *wcs1, const wchar_t *wcs2, size_t length); @@ -76,6 +82,8 @@ extern int __wctomb(char *string, wchar_t wc); extern wchar_t *__wcswcs(const wchar_t *haystack, const wchar_t *needle); extern int __wcswidth(const wchar_t *wcs, size_t length); extern size_t __wcsxfrm(wchar_t *dest, const wchar_t *src, size_t destLength); +extern size_t __wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t destLength, + locale_t locale); extern int __wctob(wint_t wc); extern int __wcwidth(wchar_t wc); extern wchar_t *__wmemchr(const wchar_t *wcs, wchar_t wc, size_t n); diff --git a/headers/private/system/tls.h b/headers/private/system/tls.h index f173755c56..e87ac4698b 100644 --- a/headers/private/system/tls.h +++ b/headers/private/system/tls.h @@ -21,6 +21,7 @@ enum { TLS_ON_EXIT_THREAD_SLOT, TLS_USER_THREAD_SLOT, TLS_DYNAMIC_THREAD_VECTOR, + TLS_LOCALE_SLOT, // Note: these entries can safely be changed between // releases; 3rd party code always calls tls_allocate() diff --git a/src/libs/stdc++/legacy/Jamfile b/src/libs/stdc++/legacy/Jamfile index 53e89366b4..bb587cec6b 100644 --- a/src/libs/stdc++/legacy/Jamfile +++ b/src/libs/stdc++/legacy/Jamfile @@ -21,7 +21,9 @@ for architectureObject in [ MultiArchSubDirSetup x86_gcc2 ] { = [ FDirName $(HAIKU_TOP) src system libroot posix glibc ] ; SYSHDRS = $(SUBDIR) + [ FDirName $(glibcDir) ctype ] [ FDirName $(glibcDir) libio ] + [ FDirName $(glibcDir) locale ] [ FDirName $(glibcDir) stdlib ] [ FDirName $(glibcDir) stdio-common ] [ FDirName $(glibcDir) include ] diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile index a7a9a4e162..25bc957878 100644 --- a/src/system/boot/Jamfile +++ b/src/system/boot/Jamfile @@ -306,6 +306,8 @@ for platform in [ MultiBootSubDirSetup ] { BootMergeObject boot_libroot_$(platform:G=).o : abs.c + ctype_loc.cpp + ctype_l.cpp ctype.cpp LocaleData.cpp qsort.c diff --git a/src/system/kernel/lib/Jamfile b/src/system/kernel/lib/Jamfile index b9f80d4c4e..9482e64fed 100644 --- a/src/system/kernel/lib/Jamfile +++ b/src/system/kernel/lib/Jamfile @@ -64,6 +64,8 @@ KernelMergeObject kernel_lib_posix.o : poll.cpp utime.c # locale + ctype_loc.cpp + ctype_l.cpp ctype.cpp localeconv.cpp LocaleData.cpp diff --git a/src/system/libroot/add-ons/icu/ICULocaleBackend.cpp b/src/system/libroot/add-ons/icu/ICULocaleBackend.cpp index 5dccc60f7f..5ce51a62d6 100644 --- a/src/system/libroot/add-ons/icu/ICULocaleBackend.cpp +++ b/src/system/libroot/add-ons/icu/ICULocaleBackend.cpp @@ -30,6 +30,13 @@ CreateInstance() } +extern "C" void +DestroyInstance(LocaleBackend* instance) +{ + delete instance; +} + + ICULocaleBackend::ICULocaleBackend() : fThreadLocalStorageKey(_CreateThreadLocalStorageKey()), diff --git a/src/system/libroot/add-ons/icu/ICUNumericData.cpp b/src/system/libroot/add-ons/icu/ICUNumericData.cpp index cdde2dec92..733867ab90 100644 --- a/src/system/libroot/add-ons/icu/ICUNumericData.cpp +++ b/src/system/libroot/add-ons/icu/ICUNumericData.cpp @@ -34,9 +34,9 @@ ICUNumericData::ICUNumericData(pthread_key_t tlsKey, struct lconv& localeConv) void ICUNumericData::Initialize(LocaleNumericDataBridge* dataBridge) { - dataBridge->glibcNumericLocale.values[0].string = fDecimalPoint; - dataBridge->glibcNumericLocale.values[1].string = fThousandsSep; - dataBridge->glibcNumericLocale.values[2].string = fGrouping; + dataBridge->glibcNumericLocale->values[0].string = fDecimalPoint; + dataBridge->glibcNumericLocale->values[1].string = fThousandsSep; + dataBridge->glibcNumericLocale->values[2].string = fGrouping; fDataBridge = dataBridge; } @@ -62,13 +62,13 @@ ICUNumericData::SetTo(const Locale& locale, const char* posixLocaleName) if (result == B_OK) { result = _SetLocaleconvEntry(formatSymbols, fDecimalPoint, DecimalFormatSymbols::kDecimalSeparatorSymbol); - fDataBridge->glibcNumericLocale.values[3].word + fDataBridge->glibcNumericLocale->values[3].word = (unsigned int)fDecimalPoint[0]; } if (result == B_OK) { result = _SetLocaleconvEntry(formatSymbols, fThousandsSep, DecimalFormatSymbols::kGroupingSeparatorSymbol); - fDataBridge->glibcNumericLocale.values[4].word + fDataBridge->glibcNumericLocale->values[4].word = (unsigned int)fThousandsSep[0]; } if (result == B_OK) { @@ -104,9 +104,9 @@ ICUNumericData::SetToPosix() strcpy(fDecimalPoint, fDataBridge->posixLocaleConv->decimal_point); strcpy(fThousandsSep, fDataBridge->posixLocaleConv->thousands_sep); strcpy(fGrouping, fDataBridge->posixLocaleConv->grouping); - fDataBridge->glibcNumericLocale.values[3].word + fDataBridge->glibcNumericLocale->values[3].word = (unsigned int)fDecimalPoint[0]; - fDataBridge->glibcNumericLocale.values[4].word + fDataBridge->glibcNumericLocale->values[4].word = (unsigned int)fThousandsSep[0]; } diff --git a/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp b/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp index 5951b6c50b..c076cf7d50 100644 --- a/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp +++ b/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp @@ -47,6 +47,7 @@ status_t ICUTimeConversion::TZSet(const char* timeZoneID, const char* tz) { bool offsetHasBeenSet = false; + bool timeZoneIdMatches = false; // The given TZ environment variable's content overrides the default // system timezone. @@ -55,8 +56,10 @@ ICUTimeConversion::TZSet(const char* timeZoneID, const char* tz) // value is implementation specific, we expect a full timezone ID. if (*tz == ':') { // nothing to do if the given name matches the current timezone - if (strcasecmp(fTimeZoneID, tz + 1) == 0) - return B_OK; + if (strcasecmp(fTimeZoneID, tz + 1) == 0) { + timeZoneIdMatches = true; + goto done; + } strlcpy(fTimeZoneID, tz + 1, sizeof(fTimeZoneID)); } else { @@ -64,8 +67,10 @@ ICUTimeConversion::TZSet(const char* timeZoneID, const char* tz) strlcpy(fTimeZoneID, tz, sizeof(fTimeZoneID)); // nothing to do if the given name matches the current timezone - if (strcasecmp(fTimeZoneID, fDataBridge->addrOfTZName[0]) == 0) - return B_OK; + if (strcasecmp(fTimeZoneID, fDataBridge->addrOfTZName[0]) == 0) { + timeZoneIdMatches = true; + goto done; + } // parse TZ variable (only and supported) const char* tzNameEnd = tz; @@ -88,12 +93,21 @@ ICUTimeConversion::TZSet(const char* timeZoneID, const char* tz) } } else { // nothing to do if the given name matches the current timezone - if (strcasecmp(fTimeZoneID, timeZoneID) == 0) - return B_OK; + if (strcasecmp(fTimeZoneID, timeZoneID) == 0) { + timeZoneIdMatches = true; + goto done; + } strlcpy(fTimeZoneID, timeZoneID, sizeof(fTimeZoneID)); } +done: + // fTimeZone can still be NULL if we don't initialize it + // in the first TZSet, causing problems for future + // Localtime invocations. + if (fTimeZone != NULL && timeZoneIdMatches) + return B_OK; + delete fTimeZone; fTimeZone = TimeZone::createTimeZone(fTimeZoneID); if (fTimeZone == NULL) diff --git a/src/system/libroot/posix/glibc/ctype/ctype.h b/src/system/libroot/posix/glibc/ctype/ctype.h index adffe76cb0..af64a50cbd 100644 --- a/src/system/libroot/posix/glibc/ctype/ctype.h +++ b/src/system/libroot/posix/glibc/ctype/ctype.h @@ -64,6 +64,11 @@ enum /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. + In the thread-specific locale model (see `uselocale' in ) + we cannot use global variables for these as was done in the past. + Instead, the following accessor functions return the address of + each variable, which is local to the current thread if multithreaded. + These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned @@ -72,12 +77,12 @@ enum rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ -extern __const unsigned short int *__ctype_b; /* Characteristics. */ -extern __const __int32_t *__ctype_tolower; /* Case conversions. */ -extern __const __int32_t *__ctype_toupper; /* Case conversions. */ +extern __const unsigned short int **__ctype_b_loc (void); /* Characteristics. */ +extern __const __int32_t **__ctype_tolower_loc (void); /* Case conversions. */ +extern __const __int32_t **__ctype_toupper_loc (void); /* Case conversions. */ #define __isctype(c, type) \ - (__ctype_b[(int) (c)] & (unsigned short int) type) + ((*__ctype_b_loc())[(int) (c)] & (unsigned short int) type) #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ @@ -167,27 +172,27 @@ __exctype (_tolower); __extern_inline int tolower (int __c) __THROW { - return __c >= -128 && __c < 256 ? __ctype_tolower[__c] : __c; + return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c; } __extern_inline int toupper (int __c) __THROW { - return __c >= -128 && __c < 256 ? __ctype_toupper[__c] : __c; + return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c; } # endif # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus -# define tolower(c) __tobody (c, tolower, __ctype_tolower, (c)) -# define toupper(c) __tobody (c, toupper, __ctype_toupper, (c)) +# define tolower(c) __tobody (c, tolower, (*__ctype_tolower_loc()), (c)) +# define toupper(c) __tobody (c, toupper, (*__ctype_toupper_loc()), (c)) # endif /* Optimizing gcc */ # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) -# define _tolower(c) ((int) __ctype_tolower[(int) (c)]) -# define _toupper(c) ((int) __ctype_toupper[(int) (c)]) +# define _tolower(c) ((int) (*__ctype_tolower_loc())[(int) (c)]) +# define _toupper(c) ((int) (*__ctype_toupper_loc())[(int) (c)]) # endif #endif /* Not __NO_CTYPE. */ diff --git a/src/system/libroot/posix/glibc/extensions/Jamfile b/src/system/libroot/posix/glibc/extensions/Jamfile index 507c0ade40..724a305308 100644 --- a/src/system/libroot/posix/glibc/extensions/Jamfile +++ b/src/system/libroot/posix/glibc/extensions/Jamfile @@ -10,6 +10,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; + SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/glibc/locale/Jamfile b/src/system/libroot/posix/glibc/locale/Jamfile index b3ba468564..2291736c61 100644 --- a/src/system/libroot/posix/glibc/locale/Jamfile +++ b/src/system/libroot/posix/glibc/locale/Jamfile @@ -13,6 +13,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; + SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; MergeObject <$(architecture)>posix_gnu_locale.o : @@ -24,6 +25,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { C-time.c C_name.c coll-lookup.c + global-locale.c lc-collate.c lc-ctype.c lc-messages.c diff --git a/src/system/libroot/posix/glibc/locale/global-locale.c b/src/system/libroot/posix/glibc/locale/global-locale.c new file mode 100644 index 0000000000..fa93468b9d --- /dev/null +++ b/src/system/libroot/posix/glibc/locale/global-locale.c @@ -0,0 +1,48 @@ +/* Locale object representing the global locale controlled by setlocale. + Copyright (C) 2002-2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include "localeinfo.h" + +#define DEFINE_CATEGORY(category, category_name, items, a) \ +extern struct locale_data _nl_C_##category; +#include "categories.def" +#undef DEFINE_CATEGORY + +/* Defined in locale/C-ctype.c. */ +extern const char _nl_C_LC_CTYPE_class[]; +extern const char _nl_C_LC_CTYPE_toupper[]; +extern const char _nl_C_LC_CTYPE_tolower[]; + +/* Here we define the locale object maintained by setlocale. + The references in the initializer are weak, so the parts of + the structure that are never referred to will be zero. */ + +struct __locale_struct _nl_global_locale = + { + .__locales = + { +#define DEFINE_CATEGORY(category, category_name, items, a) \ + [category] = &_nl_C_##category, +#include "categories.def" +#undef DEFINE_CATEGORY + }, + .__ctype_b = (const unsigned short int *) _nl_C_LC_CTYPE_class + 128, + .__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128, + .__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128 + }; diff --git a/src/system/libroot/posix/glibc/locale/lc-ctype.c b/src/system/libroot/posix/glibc/locale/lc-ctype.c index 742dae41ee..db34d32b54 100644 --- a/src/system/libroot/posix/glibc/locale/lc-ctype.c +++ b/src/system/libroot/posix/glibc/locale/lc-ctype.c @@ -47,9 +47,9 @@ _nl_postload_ctype (void) offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET); for (cnt = 0; cnt < 12; cnt++) - __ctype32_wctype[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string; + __ctype32_wctype[cnt] = _nl_global_locale.__locales[LC_CTYPE]->values[offset + cnt].string; offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET); for (cnt = 0; cnt < 2; cnt++) - __ctype32_wctrans[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string; + __ctype32_wctrans[cnt] = _nl_global_locale.__locales[LC_CTYPE]->values[offset + cnt].string; } diff --git a/src/system/libroot/posix/glibc/locale/localeinfo.h b/src/system/libroot/posix/glibc/locale/localeinfo.h index 814a273210..3467895c7b 100644 --- a/src/system/libroot/posix/glibc/locale/localeinfo.h +++ b/src/system/libroot/posix/glibc/locale/localeinfo.h @@ -27,6 +27,11 @@ #include #include +// __locale_struct +#include +// LC_* values +#include + /* This has to be changed whenever a new locale is defined. */ #define __LC_LAST 7 @@ -141,12 +146,6 @@ enum (((((const uint32_t *) (desc)) - 8)[(c) >> 5] >> ((c) & 0x1f)) & 1) -/* For each category declare the variable for the current locale data. */ -#define DEFINE_CATEGORY(category, category_name, items, a) \ -extern struct locale_data *_nl_current_##category; -#include "categories.def" -#undef DEFINE_CATEGORY - extern const char *const _nl_category_names[__LC_LAST]; extern const size_t _nl_category_name_sizes[__LC_LAST]; extern struct locale_data * *const _nl_current[__LC_LAST]; @@ -158,22 +157,33 @@ extern const char _nl_POSIX_name[]; /* The standard codeset. */ extern const char _nl_C_codeset[]; +/* This is the internal locale_t object that holds the global locale + controlled by calls to setlocale. A thread's TSD locale pointer + points to this when `uselocale (LC_GLOBAL_LOCALE)' is in effect. */ +extern struct __locale_struct _nl_global_locale; + +extern struct __locale_struct* _nl_current_locale(); +#define _NL_CURRENT_LOCALE (_nl_current_locale()) + +/* Return a pointer to the current `struct __locale_data' for CATEGORY. */ +#define _NL_CURRENT_DATA(category) \ + (_NL_CURRENT_LOCALE->__locales[category]) + /* Extract the current CATEGORY locale's string for ITEM. */ #define _NL_CURRENT(category, item) \ - (_nl_current_##category->values[_NL_ITEM_INDEX (item)].string) + (_NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].string) /* Extract the current CATEGORY locale's string for ITEM. */ #define _NL_CURRENT_WSTR(category, item) \ - ((wchar_t *) (_nl_current_##category->values[_NL_ITEM_INDEX (item)].wstr)) + ((wchar_t *) _NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].wstr) /* Extract the current CATEGORY locale's word for ITEM. */ #define _NL_CURRENT_WORD(category, item) \ - (_nl_current_##category->values[_NL_ITEM_INDEX (item)].word) + ((uint32_t) _NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].word) /* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */ #define _NL_CURRENT_DEFINE(category) \ - extern struct locale_data _nl_C_##category; \ - struct locale_data *_nl_current_##category = &_nl_C_##category + /* No per-category variable here. */ /* Load the locale data for CATEGORY from the file specified by *NAME. If *NAME is "", use environment variables as specified by POSIX, diff --git a/src/system/libroot/posix/glibc/misc/Jamfile b/src/system/libroot/posix/glibc/misc/Jamfile index eb793f2f39..6fe8280aa9 100644 --- a/src/system/libroot/posix/glibc/misc/Jamfile +++ b/src/system/libroot/posix/glibc/misc/Jamfile @@ -12,6 +12,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; + SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc misc ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; diff --git a/src/system/libroot/posix/glibc/stdio-common/Jamfile b/src/system/libroot/posix/glibc/stdio-common/Jamfile index 45bda51b09..b494c5a105 100644 --- a/src/system/libroot/posix/glibc/stdio-common/Jamfile +++ b/src/system/libroot/posix/glibc/stdio-common/Jamfile @@ -14,6 +14,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdio-common ; + SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/glibc/stdlib/Jamfile b/src/system/libroot/posix/glibc/stdlib/Jamfile index c4173ec9aa..f74052246b 100644 --- a/src/system/libroot/posix/glibc/stdlib/Jamfile +++ b/src/system/libroot/posix/glibc/stdlib/Jamfile @@ -12,6 +12,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include ; + SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ctype ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc locale ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc stdlib ; SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ; diff --git a/src/system/libroot/posix/locale/Jamfile b/src/system/libroot/posix/locale/Jamfile index d2f9aefa56..eb420bac86 100644 --- a/src/system/libroot/posix/locale/Jamfile +++ b/src/system/libroot/posix/locale/Jamfile @@ -4,6 +4,7 @@ UsePrivateHeaders [ FDirName libroot ] [ FDirName libroot locale ] [ FDirName libroot time ] + [ FDirName system ] ; local architectureObject ; @@ -12,14 +13,23 @@ for architectureObject in [ MultiArchSubDirSetup ] { local architecture = $(TARGET_PACKAGING_ARCH) ; MergeObject <$(architecture)>posix_locale.o : + ctype_l.cpp ctype.cpp LocaleBackend.cpp LocaleData.cpp LocaleDataBridge.cpp + LocaleInternal.cpp + locale_t.cpp localeconv.cpp nl_langinfo.cpp setlocale.cpp + ThreadLocale.cpp + wctype_l.cpp wctype.cpp ; + + MergeObject <$(architecture)>ctype_loc.o : + ctype_loc.cpp + ; } } diff --git a/src/system/libroot/posix/locale/LocaleBackend.cpp b/src/system/libroot/posix/locale/LocaleBackend.cpp index dfd1be59e8..902a4be83e 100644 --- a/src/system/libroot/posix/locale/LocaleBackend.cpp +++ b/src/system/libroot/posix/locale/LocaleBackend.cpp @@ -10,37 +10,56 @@ #include #include +#include + namespace BPrivate { namespace Libroot { -LocaleBackend* gLocaleBackend = NULL; +LocaleBackend* gGlobalLocaleBackend = NULL; +LocaleDataBridge gGlobalLocaleDataBridge = LocaleDataBridge(true); + + +static void* sImageHandle = NULL; +typedef LocaleBackend* (*create_instance_t)(); +typedef void (*destroy_instance_t)(LocaleBackend*); +static create_instance_t sCreateInstanceFunc = NULL; +static destroy_instance_t sDestroyInstanceFunc = NULL; -static LocaleDataBridge sLocaleDataBridge; static pthread_once_t sBackendInitOnce = PTHREAD_ONCE_INIT; +static pthread_once_t sFunctionsInitOnce = PTHREAD_ONCE_INIT; + + +static void +LoadFunctions() +{ + sImageHandle = dlopen("libroot-addon-icu.so", RTLD_LAZY); + if (sImageHandle == NULL) + return; + + sCreateInstanceFunc = (create_instance_t)dlsym(sImageHandle, "CreateInstance"); + sDestroyInstanceFunc = (destroy_instance_t)dlsym(sImageHandle, "DestroyInstance"); + + if ((sCreateInstanceFunc == NULL) || (sDestroyInstanceFunc == NULL)) { + dlclose(sImageHandle); + return; + } +} static void LoadBackend() { - void* imageHandle = dlopen("libroot-addon-icu.so", RTLD_LAZY); - if (imageHandle == NULL) - return; - - typedef LocaleBackend* (*symbolType)(); - symbolType createInstanceFunc - = (symbolType)dlsym(imageHandle, "CreateInstance"); - if (createInstanceFunc == NULL) { - dlclose(imageHandle); - return; + gGlobalLocaleBackend = LocaleBackend::CreateBackend(); + if (gGlobalLocaleBackend != NULL) { + gGlobalLocaleBackend->Initialize(&gGlobalLocaleDataBridge); } - - gLocaleBackend = createInstanceFunc(); } + LocaleBackend::LocaleBackend() { } @@ -54,15 +73,60 @@ LocaleBackend::~LocaleBackend() status_t LocaleBackend::LoadBackend() { - if (gLocaleBackend == NULL) { + if (gGlobalLocaleBackend == NULL) { pthread_once(&sBackendInitOnce, &BPrivate::Libroot::LoadBackend); - if (gLocaleBackend != NULL) - gLocaleBackend->Initialize(&sLocaleDataBridge); } - return gLocaleBackend != NULL ? B_OK : B_ERROR; + return gGlobalLocaleBackend != NULL ? B_OK : B_ERROR; } +LocaleBackend* +LocaleBackend::CreateBackend() +{ + if (sCreateInstanceFunc == NULL) { + pthread_once(&sFunctionsInitOnce, &BPrivate::Libroot::LoadFunctions); + } + + if (sCreateInstanceFunc != NULL) { + LocaleBackend* backend = sCreateInstanceFunc(); + return backend; + } + + return NULL; +} + + +void +LocaleBackend::DestroyBackend(LocaleBackend* instance) +{ + if (sDestroyInstanceFunc != NULL) { + sDestroyInstanceFunc(instance); + } +} + + +LocaleBackendData* GetCurrentLocaleInfo() +{ + return GetCurrentThreadLocale()->threadLocaleInfo; +} + + +void +SetCurrentLocaleInfo(LocaleBackendData* newLocale) +{ + GetCurrentThreadLocale()->threadLocaleInfo = newLocale; +} + + +LocaleBackend* GetCurrentLocaleBackend() +{ + LocaleBackendData* info = GetCurrentThreadLocale()->threadLocaleInfo; + if (info != NULL && info->backend != NULL) { + return info->backend; + } + return gGlobalLocaleBackend; +} + } // namespace Libroot } // namespace BPrivate diff --git a/src/system/libroot/posix/locale/LocaleDataBridge.cpp b/src/system/libroot/posix/locale/LocaleDataBridge.cpp index c8f2631974..140650fddc 100644 --- a/src/system/libroot/posix/locale/LocaleDataBridge.cpp +++ b/src/system/libroot/posix/locale/LocaleDataBridge.cpp @@ -15,24 +15,45 @@ #include #include #include +#include -extern locale_data* _nl_current_LC_NUMERIC; +extern const unsigned short* __ctype_b; +extern const int* __ctype_tolower; +extern const int* __ctype_toupper; namespace BPrivate { namespace Libroot { -LocaleCtypeDataBridge::LocaleCtypeDataBridge() +extern "C" GlibcLocaleStruct* _nl_current_locale(); +extern "C" GlibcLocaleStruct _nl_global_locale; +#define _NL_CURRENT_DATA(category) \ + ((locale_data*&)(_nl_current_locale()->__locales[category])) +#define _NL_GLOBAL_DATA(category) \ + ((locale_data*&)(_nl_global_locale.__locales[category])) + + +LocaleCtypeDataBridge::LocaleCtypeDataBridge(bool isGlobal) : - addrOfClassInfoTable(&__ctype_b), - addrOfToLowerTable(&__ctype_tolower), - addrOfToUpperTable(&__ctype_toupper), + localClassInfoTable(__ctype_b), + localToLowerTable(__ctype_tolower), + localToUpperTable(__ctype_toupper), posixClassInfo(gPosixClassInfo), posixToLowerMap(gPosixToLowerMap), - posixToUpperMap(gPosixToUpperMap) + posixToUpperMap(gPosixToUpperMap), + isGlobal(isGlobal) { + if (isGlobal) { + addrOfClassInfoTable = &__ctype_b; + addrOfToLowerTable = &__ctype_tolower; + addrOfToUpperTable = &__ctype_toupper; + } else { + addrOfClassInfoTable = &localClassInfoTable; + addrOfToLowerTable = &localToLowerTable; + addrOfToUpperTable = &localToUpperTable; + } } @@ -42,6 +63,15 @@ void LocaleCtypeDataBridge::setMbCurMax(unsigned short mbCurMax) } +void +LocaleCtypeDataBridge::ApplyToCurrentThread() +{ + *__ctype_b_loc() = *addrOfClassInfoTable; + *__ctype_tolower_loc() = *addrOfToLowerTable; + *__ctype_toupper_loc() = *addrOfToUpperTable; +} + + LocaleMessagesDataBridge::LocaleMessagesDataBridge() : posixLanginfo(gPosixLanginfo) @@ -56,20 +86,36 @@ LocaleMonetaryDataBridge::LocaleMonetaryDataBridge() } -LocaleNumericDataBridge::LocaleNumericDataBridge() +LocaleNumericDataBridge::LocaleNumericDataBridge(bool isGlobal) : - originalGlibcLocale(_nl_current_LC_NUMERIC), - posixLocaleConv(&gPosixLocaleConv) + posixLocaleConv(&gPosixLocaleConv), + glibcNumericLocale(&glibcNumericLocaleData) { - memcpy(&glibcNumericLocale, _nl_current_LC_NUMERIC, - sizeof(glibcNumericLocale)); - _nl_current_LC_NUMERIC = (locale_data*)&glibcNumericLocale; + + memcpy(glibcNumericLocale, _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC), + sizeof(GlibcNumericLocale)); + + if (isGlobal) { + originalGlibcLocale = _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC); + _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC) = (locale_data*)glibcNumericLocale; + } } LocaleNumericDataBridge::~LocaleNumericDataBridge() { - _nl_current_LC_NUMERIC = originalGlibcLocale; + if (isGlobal) { + _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC) = originalGlibcLocale; + } else if (_NL_CURRENT_DATA(GLIBC_LC_NUMERIC) == (locale_data*)glibcNumericLocale) { + _NL_CURRENT_DATA(GLIBC_LC_NUMERIC) = _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC); + } +} + + +void +LocaleNumericDataBridge::ApplyToCurrentThread() +{ + _NL_CURRENT_DATA(GLIBC_LC_NUMERIC) = (locale_data*)glibcNumericLocale; } @@ -80,19 +126,50 @@ LocaleTimeDataBridge::LocaleTimeDataBridge() } -TimeConversionDataBridge::TimeConversionDataBridge() +TimeConversionDataBridge::TimeConversionDataBridge(bool isGlobal) : - addrOfDaylight(&daylight), - addrOfTimezone(&timezone), - addrOfTZName(tzname) + localDaylight(daylight), + localTimezone(timezone), + isGlobal(isGlobal) +{ + if (isGlobal) { + addrOfDaylight = &daylight; + addrOfTimezone = &timezone; + addrOfTZName = tzname; + } else { + addrOfDaylight = &localDaylight; + addrOfTimezone = &localTimezone; + addrOfTZName = localTZName; + addrOfTZName[0] = localTZName0; + addrOfTZName[1] = localTZName1; + strlcpy(localTZName0, tzname[0], sizeof(localTZName0)); + strlcpy(localTZName1, tzname[1], sizeof(localTZName1)); + } +} + + +LocaleDataBridge::LocaleDataBridge(bool isGlobal) + : + ctypeDataBridge(isGlobal), + numericDataBridge(isGlobal), + timeConversionDataBridge(isGlobal), + posixLanginfo(gPosixLanginfo), + isGlobal(isGlobal) { } -LocaleDataBridge::LocaleDataBridge() - : - posixLanginfo(gPosixLanginfo) +void +LocaleDataBridge::ApplyToCurrentThread() { + ctypeDataBridge.ApplyToCurrentThread(); + numericDataBridge.ApplyToCurrentThread(); + // While timeConverstionDataBridge stores read-write variables, + // these variables are global (by POSIX definition). Furthermore, + // none of the backends seem to access these variables + // directly. The values are set in the bridge mostly for + // synchronization purposes. Therefore, don't call + // ApplyToCurrentThread for this object. } diff --git a/src/system/libroot/posix/locale/LocaleInternal.cpp b/src/system/libroot/posix/locale/LocaleInternal.cpp new file mode 100644 index 0000000000..16d5aafd9b --- /dev/null +++ b/src/system/libroot/posix/locale/LocaleInternal.cpp @@ -0,0 +1,75 @@ +/* + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de + * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include "LocaleInternal.h" + +#include +#include +#include + +#include + + +namespace BPrivate { +namespace Libroot { + + +status_t +GetLocalesFromEnvironment(int category, const char** locales) +{ + if (category > LC_LAST) { + return B_BAD_VALUE; + } + + const char* locale = getenv("LC_ALL"); + if (locale != NULL && *locale != '\0') + locales[category] = locale; + else { + // the order of the names must match the one specified in locale.h + const char* const categoryNames[] = { + "LC_ALL", + "LC_COLLATE", + "LC_CTYPE", + "LC_MONETARY", + "LC_NUMERIC", + "LC_TIME", + "LC_MESSAGES" + }; + + STATIC_ASSERT(B_COUNT_OF(categoryNames) == LC_LAST + 1); + + int from, to; + if (category == LC_ALL) { + // we need to check each real category if all of them should be set + from = 1; + to = LC_LAST; + } else + from = to = category; + bool haveDifferentLocales = false; + locale = NULL; + for (int lc = from; lc <= to; lc++) { + const char* lastLocale = locale; + locale = getenv(categoryNames[lc]); + if (locale == NULL || *locale == '\0') + locale = getenv("LANG"); + if (locale == NULL || *locale == '\0') + locale = "POSIX"; + locales[lc] = locale; + if (lastLocale != NULL && strcasecmp(locale, lastLocale) != 0) + haveDifferentLocales = true; + } + if (!haveDifferentLocales) { + // we can set all locales at once + locales[LC_ALL] = locale; + } + } + + return B_OK; +} + +} // namespace Libroot +} // namespace BPrivate diff --git a/src/system/libroot/posix/locale/LocaleInternal.h b/src/system/libroot/posix/locale/LocaleInternal.h new file mode 100644 index 0000000000..4f381af493 --- /dev/null +++ b/src/system/libroot/posix/locale/LocaleInternal.h @@ -0,0 +1,21 @@ +/* + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de + * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include + + +#define LOCALE_T_MAGIC 'LOCA' + + +namespace BPrivate { +namespace Libroot { + + +status_t GetLocalesFromEnvironment(int category, const char** locales); + +} // namespace Libroot +} // namespace BPrivate diff --git a/src/system/libroot/posix/locale/ThreadLocale.cpp b/src/system/libroot/posix/locale/ThreadLocale.cpp new file mode 100644 index 0000000000..512612856a --- /dev/null +++ b/src/system/libroot/posix/locale/ThreadLocale.cpp @@ -0,0 +1,74 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include + +#include +#include +#include + + +// From glibc's localeinfo.h +extern BPrivate::Libroot::GlibcLocaleStruct _nl_global_locale; + + +namespace BPrivate { +namespace Libroot { + + +static void DestroyThreadLocale(void* ptr) +{ + ThreadLocale* threadLocale = (ThreadLocale*)ptr; + delete threadLocale; +} + + +ThreadLocale* +GetCurrentThreadLocale() +{ + ThreadLocale* threadLocale = (ThreadLocale*)tls_get(TLS_LOCALE_SLOT); + if (threadLocale == NULL) { + threadLocale = new ThreadLocale(); + threadLocale->glibcLocaleStruct = _nl_global_locale; + threadLocale->threadLocaleInfo = NULL; + on_exit_thread(DestroyThreadLocale, threadLocale); + tls_set(TLS_LOCALE_SLOT, threadLocale); + } + return threadLocale; +} + + +// Exported so that glibc could also use. +extern "C" GlibcLocaleStruct* +_nl_current_locale() +{ + return &GetCurrentThreadLocale()->glibcLocaleStruct; +} + + +extern "C" const unsigned short** +__ctype_b_loc() +{ + return &GetCurrentThreadLocale()->glibcLocaleStruct.__ctype_b; +} + + +extern "C" const int** +__ctype_tolower_loc() +{ + return &GetCurrentThreadLocale()->glibcLocaleStruct.__ctype_tolower; +} + + +extern "C" const int** +__ctype_toupper_loc() +{ + return &GetCurrentThreadLocale()->glibcLocaleStruct.__ctype_toupper; +} + + +} // namespace Libroot +} // namespace BPrivate diff --git a/src/system/libroot/posix/locale/ctype.cpp b/src/system/libroot/posix/locale/ctype.cpp index e558a86dee..38578e3b39 100644 --- a/src/system/libroot/posix/locale/ctype.cpp +++ b/src/system/libroot/posix/locale/ctype.cpp @@ -44,7 +44,7 @@ int isalnum(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & (_ISupper | _ISlower | _ISdigit); + return (*__ctype_b_loc())[c] & (_ISupper | _ISlower | _ISdigit); return 0; } @@ -54,7 +54,7 @@ int isalpha(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & (_ISupper | _ISlower); + return (*__ctype_b_loc())[c] & (_ISupper | _ISlower); return 0; } @@ -72,7 +72,7 @@ int isblank(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISblank; + return (*__ctype_b_loc())[c] & _ISblank; return 0; } @@ -82,7 +82,7 @@ int iscntrl(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _IScntrl; + return (*__ctype_b_loc())[c] & _IScntrl; return 0; } @@ -92,7 +92,7 @@ int isdigit(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISdigit; + return (*__ctype_b_loc())[c] & _ISdigit; return 0; } @@ -102,7 +102,7 @@ int isgraph(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISgraph; + return (*__ctype_b_loc())[c] & _ISgraph; return 0; } @@ -112,7 +112,7 @@ int islower(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISlower; + return (*__ctype_b_loc())[c] & _ISlower; return 0; } @@ -122,7 +122,7 @@ int isprint(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISprint; + return (*__ctype_b_loc())[c] & _ISprint; return 0; } @@ -132,7 +132,7 @@ int ispunct(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISpunct; + return (*__ctype_b_loc())[c] & _ISpunct; return 0; } @@ -142,7 +142,7 @@ int isspace(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISspace; + return (*__ctype_b_loc())[c] & _ISspace; return 0; } @@ -152,7 +152,7 @@ int isupper(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISupper; + return (*__ctype_b_loc())[c] & _ISupper; return 0; } @@ -162,7 +162,7 @@ int isxdigit(int c) { if (c >= -128 && c < 256) - return __ctype_b[c] & _ISxdigit; + return (*__ctype_b_loc())[c] & _ISxdigit; return 0; } @@ -180,7 +180,7 @@ int tolower(int c) { if (c >= -128 && c < 256) - return __ctype_tolower[c]; + return (*__ctype_tolower_loc())[c]; return c; } @@ -190,7 +190,7 @@ int toupper(int c) { if (c >= -128 && c < 256) - return __ctype_toupper[c]; + return (*__ctype_toupper_loc())[c]; return c; } diff --git a/src/system/libroot/posix/locale/ctype_l.cpp b/src/system/libroot/posix/locale/ctype_l.cpp new file mode 100644 index 0000000000..4dc07500cb --- /dev/null +++ b/src/system/libroot/posix/locale/ctype_l.cpp @@ -0,0 +1,202 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include +#include + +#include +#include + + +namespace BPrivate { +namespace Libroot { + + +// A NULL databridge means that the object represents the POSIX locale. +static const unsigned short* +GetClassInfoTable(locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + + if (locale->databridge == NULL) { + return &gPosixClassInfo[128]; + } + return *locale->databridge->ctypeDataBridge.addrOfClassInfoTable; +} + + +static const int* +GetToUpperTable(locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + + if (locale->databridge == NULL) { + return &gPosixToUpperMap[128]; + } + return *locale->databridge->ctypeDataBridge.addrOfToUpperTable; +} + + +static const int* +GetToLowerTable(locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + + if (locale->databridge == NULL) { + return &gPosixToLowerMap[128]; + } + return *locale->databridge->ctypeDataBridge.addrOfToLowerTable; +} + + +extern "C" { + + +int +isalnum_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & (_ISupper | _ISlower | _ISdigit); + + return 0; +} + + +int +isalpha_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & (_ISupper | _ISlower); + + return 0; +} + + +int +isblank_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISblank; + + return 0; +} + + +int +iscntrl_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _IScntrl; + + return 0; +} + + +int +isdigit_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISdigit; + + return 0; +} + + +int +isgraph_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISgraph; + + return 0; +} + + +int +islower_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISlower; + + return 0; +} + + +int +isprint_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISprint; + + return 0; +} + + +int +ispunct_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISpunct; + + return 0; +} + + +int +isspace_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISspace; + + return 0; +} + + +int +isupper_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISupper; + + return 0; +} + + +int +isxdigit_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetClassInfoTable(l)[c] & _ISxdigit; + + return 0; +} + + +int +tolower_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetToLowerTable(l)[c]; + + return c; +} + + +int +toupper_l(int c, locale_t l) +{ + if (c >= -128 && c < 256) + return GetToUpperTable(l)[c]; + + return c; +} + + +} + + +} // namespace Libroot +} // namespace BPrivate diff --git a/src/system/libroot/posix/locale/ctype_loc.cpp b/src/system/libroot/posix/locale/ctype_loc.cpp new file mode 100644 index 0000000000..4c3b127032 --- /dev/null +++ b/src/system/libroot/posix/locale/ctype_loc.cpp @@ -0,0 +1,33 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include + + +// These functions are intended for scenarios where we cannot +// link to the whole libroot and access pthread functions; +// for example, when we're in the bootloader, kernel or the +// runtime_loader. + +extern "C" const unsigned short** +__ctype_b_loc() +{ + return &__ctype_b; +} + + +extern "C" const int** +__ctype_tolower_loc() +{ + return &__ctype_tolower; +} + + +extern "C" const int** +__ctype_toupper_loc() +{ + return &__ctype_toupper; +} diff --git a/src/system/libroot/posix/locale/locale_t.cpp b/src/system/libroot/posix/locale/locale_t.cpp new file mode 100644 index 0000000000..70ba38da09 --- /dev/null +++ b/src/system/libroot/posix/locale/locale_t.cpp @@ -0,0 +1,238 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include +#include +#include +#include + +#include + +#include "LocaleBackend.h" +#include "LocaleInternal.h" + + +using BPrivate::Libroot::gGlobalLocaleBackend; +using BPrivate::Libroot::gGlobalLocaleDataBridge; +using BPrivate::Libroot::GetCurrentLocaleInfo; +using BPrivate::Libroot::GetLocalesFromEnvironment; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; +using BPrivate::Libroot::LocaleDataBridge; + + +extern "C" locale_t +duplocale(locale_t l) +{ + LocaleBackendData* locObj = (LocaleBackendData*)l; + + LocaleBackendData* newObj = new (std::nothrow) LocaleBackendData; + if (newObj == NULL) { + errno = ENOMEM; + return (locale_t)0; + } + + LocaleBackend* backend = (l == LC_GLOBAL_LOCALE) ? + gGlobalLocaleBackend : (LocaleBackend*)locObj->backend; + + if (backend == NULL) { + newObj->backend = NULL; + return (locale_t)newObj; + } + + // Check if everything is set to "C" or "POSIX", + // and avoid making a backend. + const char* localeDescription = backend->SetLocale(LC_ALL, NULL); + + if ((strcasecmp(localeDescription, "POSIX") == 0) + || (strcasecmp(localeDescription, "C") == 0)) { + newObj->backend = NULL; + return (locale_t)newObj; + } + + BPrivate::ErrnoMaintainer errnoMaintainer; + + LocaleBackend*& newBackend = newObj->backend; + LocaleDataBridge*& newDataBridge = newObj->databridge; + newBackend = LocaleBackend::CreateBackend(); + + if (newBackend == NULL) { + errno = ENOMEM; + delete newObj; + return (locale_t)0; + } + + newDataBridge = new (std::nothrow) LocaleDataBridge(false); + + if (newDataBridge == NULL) { + errno = ENOMEM; + delete newBackend; + delete newObj; + return (locale_t)0; + } + + newBackend->Initialize(newDataBridge); + + // Skipping LC_ALL. Asking for LC_ALL would force the backend + // to query each other value once, anyway. + for (int lc = 1; lc <= LC_LAST; ++lc) { + newBackend->SetLocale(lc, backend->SetLocale(lc, NULL)); + } + + return (locale_t)newObj; +} + + +extern "C" void +freelocale(locale_t l) +{ + LocaleBackendData* locobj = (LocaleBackendData*)l; + + if (locobj->backend) { + LocaleBackend::DestroyBackend(locobj->backend); + LocaleDataBridge* databridge = locobj->databridge; + delete databridge; + } + delete locobj; +} + + +extern "C" locale_t +newlocale(int category_mask, const char* locale, locale_t base) +{ + if (((category_mask | LC_ALL_MASK) != LC_ALL_MASK) || (locale == NULL)) { + errno = EINVAL; + return (locale_t)0; + } + + bool newObject = false; + LocaleBackendData* localeObject = (LocaleBackendData*)base; + + if (localeObject == NULL) { + localeObject = new (std::nothrow) LocaleBackendData; + if (localeObject == NULL) { + errno = ENOMEM; + return (locale_t)0; + } + localeObject->magic = LOCALE_T_MAGIC; + localeObject->backend = NULL; + localeObject->databridge = NULL; + + newObject = true; + } + + LocaleBackend*& backend = localeObject->backend; + LocaleDataBridge*& databridge = localeObject->databridge; + + const char* locales[LC_LAST + 1]; + for (int lc = 0; lc <= LC_LAST; lc++) + locales[lc] = NULL; + + if (*locale == '\0') { + if (category_mask == LC_ALL_MASK) { + GetLocalesFromEnvironment(LC_ALL, locales); + } else { + for (int lc = 1; lc <= LC_LAST; ++lc) { + if (category_mask & (1 << (lc - 1))) { + GetLocalesFromEnvironment(lc, locales); + } + } + } + } else { + if (category_mask == LC_ALL_MASK) { + locales[LC_ALL] = locale; + } + for (int lc = 1; lc <= LC_LAST; ++lc) { + if (category_mask & (1 << (lc - 1))) { + locales[lc] = locale; + } + } + } + + if (backend == NULL) { + // for any locale other than POSIX/C, we try to activate the ICU + // backend + bool needBackend = false; + for (int lc = 0; lc <= LC_LAST; lc++) { + if (locales[lc] != NULL && strcasecmp(locales[lc], "POSIX") != 0 + && strcasecmp(locales[lc], "C") != 0) { + needBackend = true; + break; + } + } + if (needBackend) { + backend = LocaleBackend::CreateBackend(); + if (backend == NULL) { + errno = ENOMEM; + if (newObject) { + delete localeObject; + } + return (locale_t)0; + } + databridge = new (std::nothrow) LocaleDataBridge(false); + if (databridge == NULL) { + errno = ENOMEM; + delete backend; + if (newObject) { + delete localeObject; + } + return (locale_t)0; + } + backend->Initialize(databridge); + } + } + + BPrivate::ErrnoMaintainer errnoMaintainer; + + if (backend != NULL) { + for (int lc = 0; lc <= LC_LAST; lc++) { + if (locales[lc] != NULL) { + locale = backend->SetLocale(lc, locales[lc]); + if (lc == LC_ALL) { + // skip the rest, LC_ALL overrides + break; + } + } + } + } + + return (locale_t)localeObject; +} + + +extern "C" locale_t +uselocale(locale_t newLoc) +{ + locale_t oldLoc = (locale_t)GetCurrentLocaleInfo(); + if (oldLoc == NULL) { + oldLoc = LC_GLOBAL_LOCALE; + } + + if (newLoc != (locale_t)0) { + // Avoid expensive TLS reads with a local variable. + locale_t appliedLoc = oldLoc; + + if (newLoc == LC_GLOBAL_LOCALE) { + appliedLoc = NULL; + } else { + if (((LocaleBackendData*)newLoc)->magic != LOCALE_T_MAGIC) { + errno = EINVAL; + return (locale_t)0; + } + appliedLoc = newLoc; + } + + SetCurrentLocaleInfo((LocaleBackendData*)appliedLoc); + + if (appliedLoc != NULL) { + ((LocaleBackendData*)appliedLoc)->databridge->ApplyToCurrentThread(); + } else { + gGlobalLocaleDataBridge.ApplyToCurrentThread(); + } + } + + return oldLoc; +} diff --git a/src/system/libroot/posix/locale/localeconv.cpp b/src/system/libroot/posix/locale/localeconv.cpp index 8b353ccef5..ec26185c79 100644 --- a/src/system/libroot/posix/locale/localeconv.cpp +++ b/src/system/libroot/posix/locale/localeconv.cpp @@ -11,8 +11,12 @@ #include #ifndef _KERNEL_MODE +#include #include "LocaleBackend.h" -using BPrivate::Libroot::gLocaleBackend; + +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; #endif @@ -20,9 +24,25 @@ extern "C" struct lconv* localeconv(void) { #ifndef _KERNEL_MODE - if (gLocaleBackend) - return const_cast(gLocaleBackend->LocaleConv()); + LocaleBackend* backend = GetCurrentLocaleBackend(); + if (backend != NULL) + return const_cast(backend->LocaleConv()); #endif return &BPrivate::Libroot::gPosixLocaleConv; } + + +#ifndef _KERNEL_MODE +extern "C" struct lconv* +localeconv_l(locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) + return const_cast(backend->LocaleConv()); + + return &BPrivate::Libroot::gPosixLocaleConv; +} +#endif \ No newline at end of file diff --git a/src/system/libroot/posix/locale/nl_langinfo.cpp b/src/system/libroot/posix/locale/nl_langinfo.cpp index b48f6f56ed..d88fb057cd 100644 --- a/src/system/libroot/posix/locale/nl_langinfo.cpp +++ b/src/system/libroot/posix/locale/nl_langinfo.cpp @@ -11,8 +11,10 @@ #include -using BPrivate::Libroot::gLocaleBackend; using BPrivate::Libroot::gPosixLanginfo; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" char* @@ -21,8 +23,23 @@ nl_langinfo(nl_item item) if (item < 0 || item >= _NL_LANGINFO_LAST) return const_cast(""); - if (gLocaleBackend != NULL) - return const_cast(gLocaleBackend->GetLanginfo(item)); + if (GetCurrentLocaleBackend() != NULL) + return const_cast(GetCurrentLocaleBackend()->GetLanginfo(item)); + + return const_cast(gPosixLanginfo[item]); +} + + +extern "C" char* +nl_langinfo_l(nl_item item, locale_t locale) +{ + if (item < 0 || item >= _NL_LANGINFO_LAST) + return const_cast(""); + + LocaleBackend* backend = ((LocaleBackendData*)locale)->backend; + + if (backend != NULL) + return const_cast(backend->GetLanginfo(item)); return const_cast(gPosixLanginfo[item]); } diff --git a/src/system/libroot/posix/locale/setlocale.cpp b/src/system/libroot/posix/locale/setlocale.cpp index 7977780316..4c1ffccc5b 100644 --- a/src/system/libroot/posix/locale/setlocale.cpp +++ b/src/system/libroot/posix/locale/setlocale.cpp @@ -7,65 +7,19 @@ #include #include -#include #include #include #include "LocaleBackend.h" +#include "LocaleInternal.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::gGlobalLocaleBackend; +using BPrivate::Libroot::GetLocalesFromEnvironment; using BPrivate::Libroot::LocaleBackend; -static status_t -GetLocalesFromEnvironment(int category, const char** locales) -{ - const char* locale = getenv("LC_ALL"); - if (locale && *locale) - locales[category] = locale; - else { - // the order of the names must match the one specified in locale.h - const char* categoryNames[] = { - "LC_ALL", - "LC_COLLATE", - "LC_CTYPE", - "LC_MONETARY", - "LC_NUMERIC", - "LC_TIME", - "LC_MESSAGES" - }; - int from, to; - if (category == LC_ALL) { - // we need to check each real category if all of them should be set - from = 1; - to = LC_LAST; - } else - from = to = category; - bool haveDifferentLocales = false; - locale = NULL; - for (int lc = from; lc <= to; lc++) { - const char* lastLocale = locale; - locale = getenv(categoryNames[lc]); - if (!locale || *locale == '\0') - locale = getenv("LANG"); - if (!locale || *locale == '\0') - locale = "POSIX"; - locales[lc] = locale; - if (lastLocale && strcasecmp(locale, lastLocale) != 0) - haveDifferentLocales = true; - } - if (!haveDifferentLocales) { - // we can set all locales at once - locales[LC_ALL] = locale; - } - } - - return B_OK; -} - - extern "C" char* setlocale(int category, const char* locale) { @@ -76,8 +30,8 @@ setlocale(int category, const char* locale) if (locale == NULL) { // query the locale of the given category - if (gLocaleBackend != NULL) - return const_cast(gLocaleBackend->SetLocale(category, NULL)); + if (gGlobalLocaleBackend != NULL) + return const_cast(gGlobalLocaleBackend->SetLocale(category, NULL)); else return const_cast("POSIX"); } @@ -93,7 +47,7 @@ setlocale(int category, const char* locale) else locales[category] = locale; - if (!gLocaleBackend) { + if (gGlobalLocaleBackend == NULL) { // for any locale other than POSIX/C, we try to activate the ICU // backend bool needBackend = false; @@ -108,17 +62,17 @@ setlocale(int category, const char* locale) return NULL; } - if (gLocaleBackend != NULL) { + if (gGlobalLocaleBackend != NULL) { for (int lc = 0; lc <= LC_LAST; lc++) { if (locales[lc] != NULL) { - locale = gLocaleBackend->SetLocale(lc, locales[lc]); + locale = gGlobalLocaleBackend->SetLocale(lc, locales[lc]); if (lc == LC_ALL) { // skip the rest, LC_ALL overrides return const_cast(locale); } } } - return const_cast(gLocaleBackend->SetLocale(category, NULL)); + return const_cast(gGlobalLocaleBackend->SetLocale(category, NULL)); } return const_cast("POSIX"); diff --git a/src/system/libroot/posix/locale/wctype.cpp b/src/system/libroot/posix/locale/wctype.cpp index 4c50c5b547..d6ae6a92dd 100644 --- a/src/system/libroot/posix/locale/wctype.cpp +++ b/src/system/libroot/posix/locale/wctype.cpp @@ -13,7 +13,9 @@ #include "LocaleBackend.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; + /* * In many of the following functions, we make use of the fact that with @@ -26,13 +28,15 @@ using BPrivate::Libroot::gLocaleBackend; int iswctype(wint_t wc, wctype_t charClass) { - if (gLocaleBackend == NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend == NULL) { if (wc < 0 || wc > 127) return 0; return __isctype(wc, charClass); } - return gLocaleBackend->IsWCType(wc, charClass); + return backend->IsWCType(wc, charClass); } @@ -123,14 +127,16 @@ iswxdigit(wint_t wc) wint_t towlower(wint_t wc) { - if (gLocaleBackend == NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend == NULL) { if (wc < 0 || wc > 127) return wc; return tolower(wc); } wint_t result = wc; - gLocaleBackend->ToWCTrans(wc, _ISlower, result); + backend->ToWCTrans(wc, _ISlower, result); return result; } @@ -139,14 +145,16 @@ towlower(wint_t wc) wint_t towupper(wint_t wc) { - if (gLocaleBackend == NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend == NULL) { if (wc < 0 || wc > 127) return wc; return toupper(wc); } wint_t result = wc; - gLocaleBackend->ToWCTrans(wc, _ISupper, result); + backend->ToWCTrans(wc, _ISupper, result); return result; } @@ -155,7 +163,9 @@ towupper(wint_t wc) wint_t towctrans(wint_t wc, wctrans_t transition) { - if (gLocaleBackend == NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend == NULL) { if (transition == _ISlower) return tolower(wc); if (transition == _ISupper) @@ -166,7 +176,7 @@ towctrans(wint_t wc, wctrans_t transition) } wint_t result = wc; - status_t status = gLocaleBackend->ToWCTrans(wc, transition, result); + status_t status = backend->ToWCTrans(wc, transition, result); if (status != B_OK) __set_errno(EINVAL); diff --git a/src/system/libroot/posix/locale/wctype_l.cpp b/src/system/libroot/posix/locale/wctype_l.cpp new file mode 100644 index 0000000000..24a845b73f --- /dev/null +++ b/src/system/libroot/posix/locale/wctype_l.cpp @@ -0,0 +1,236 @@ +/* + * Copyright 2022, Trung Nguyen, trungnt282910@gmail.com + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include +#include +#include +#include +#include + +#include + +#include "LocaleBackend.h" + + +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; + + +int +iswctype_l(wint_t wc, wctype_t charClass, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend == NULL) { + if (wc < 0 || wc > 127) + return 0; + return __isctype(wc, charClass); + } + + return backend->IsWCType(wc, charClass); +} + + +int +iswalnum_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISalnum, locale); +} + + +int +iswalpha_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISalpha, locale); +} + + +int +iswblank_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISblank, locale); +} + + +int +iswcntrl_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _IScntrl, locale); +} + + +int +iswdigit_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISdigit, locale); +} + + +int +iswgraph_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISgraph, locale); +} + + +int +iswlower_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISlower, locale); +} + + +int +iswprint_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISprint, locale); +} + + +int +iswpunct_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISpunct, locale); +} + + +int +iswspace_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISspace, locale); +} + + +int +iswupper_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISupper, locale); +} + + +int +iswxdigit_l(wint_t wc, locale_t locale) +{ + return iswctype_l(wc, _ISxdigit, locale); +} + + +wint_t +towlower_l(wint_t wc, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend == NULL) { + if (wc < 0 || wc > 127) + return wc; + return tolower(wc); + } + + wint_t result = wc; + backend->ToWCTrans(wc, _ISlower, result); + + return result; +} + + +wint_t +towupper_l(wint_t wc, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend == NULL) { + if (wc < 0 || wc > 127) + return wc; + return toupper(wc); + } + + wint_t result = wc; + backend->ToWCTrans(wc, _ISupper, result); + + return result; +} + + +wint_t +towctrans_l(wint_t wc, wctrans_t transition, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend == NULL) { + if (transition == _ISlower) + return tolower(wc); + if (transition == _ISupper) + return toupper(wc); + + __set_errno(EINVAL); + return wc; + } + + wint_t result = wc; + status_t status = backend->ToWCTrans(wc, transition, result); + if (status != B_OK) + __set_errno(EINVAL); + + return result; +} + + +wctrans_t +wctrans_l(const char *charClass, locale_t locale) +{ + (void)locale; + + if (charClass != NULL) { + // we do not know any locale-specific character classes + if (strcmp(charClass, "tolower") == 0) + return _ISlower; + if (strcmp(charClass, "toupper") == 0) + return _ISupper; + } + + __set_errno(EINVAL); + return 0; +} + + +wctype_t +wctype_l(const char *property, locale_t locale) +{ + (void)locale; + + // currently, we do not support any locale-specific properties + if (strcmp(property, "alnum") == 0) + return _ISalnum; + if (strcmp(property, "alpha") == 0) + return _ISalpha; + if (strcmp(property, "blank") == 0) + return _ISblank; + if (strcmp(property, "cntrl") == 0) + return _IScntrl; + if (strcmp(property, "digit") == 0) + return _ISdigit; + if (strcmp(property, "graph") == 0) + return _ISgraph; + if (strcmp(property, "lower") == 0) + return _ISlower; + if (strcmp(property, "print") == 0) + return _ISprint; + if (strcmp(property, "punct") == 0) + return _ISpunct; + if (strcmp(property, "space") == 0) + return _ISspace; + if (strcmp(property, "upper") == 0) + return _ISupper; + if (strcmp(property, "xdigit") == 0) + return _ISxdigit; + + return 0; +} diff --git a/src/system/libroot/posix/stdlib/strfmon.c b/src/system/libroot/posix/stdlib/strfmon.c index c2b97e68f6..ffb810f1e5 100644 --- a/src/system/libroot/posix/stdlib/strfmon.c +++ b/src/system/libroot/posix/stdlib/strfmon.c @@ -89,19 +89,39 @@ } while (0) -static void __setup_vars(int, char *, char *, char *, char **); -static int __calc_left_pad(int, char *); -static char *__format_grouped_double(double, int *, int, int, int); +extern struct lconv* localeconv_l(locale_t); + +static ssize_t __strfmon(char*, size_t, struct lconv*, const char*, va_list ap); +static void __setup_vars(int, struct lconv*, char *, char *, char *, char **); +static int __calc_left_pad(int, struct lconv*, char *); +static char *__format_grouped_double(double, struct lconv*, int *, int, int, int); ssize_t -strfmon(char *s, size_t maxsize, const char *format, - ...) +strfmon(char *s, size_t maxsize, const char *format, ...) +{ + va_list ap; + struct lconv* lc = localeconv(); + va_start(ap, format); + return __strfmon(s, maxsize, lc, format, ap); +} + + +ssize_t +strfmon_l(char *s, size_t maxsize, locale_t locale, const char *format, ...) +{ + va_list ap; + struct lconv* lc = localeconv_l(locale); + va_start(ap, format); + return __strfmon(s, maxsize, lc, format, ap); +} + + +static ssize_t +__strfmon(char *s, size_t maxsize, struct lconv* lc, const char *format, va_list ap) { - va_list ap; char *dst; /* output destination pointer */ const char *fmt; /* current format poistion pointer */ - struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ int flags; /* formatting options */ @@ -122,9 +142,6 @@ strfmon(char *s, size_t maxsize, const char *format, char *tmpptr; /* temporary vars */ int sverrno; - va_start(ap, format); - - lc = localeconv(); dst = s; fmt = format; asciivalue = NULL; @@ -253,22 +270,22 @@ strfmon(char *s, size_t maxsize, const char *format, /* fill left_prec with amount of padding chars */ if (left_prec >= 0) { - pad_size = __calc_left_pad((flags ^ IS_NEGATIVE), - currency_symbol) - __calc_left_pad(flags, currency_symbol); + pad_size = __calc_left_pad((flags ^ IS_NEGATIVE), lc, + currency_symbol) - __calc_left_pad(flags, lc, currency_symbol); if (pad_size < 0) pad_size = 0; } if (asciivalue != NULL) free(asciivalue); - asciivalue = __format_grouped_double(value, &flags, left_prec, + asciivalue = __format_grouped_double(value, lc, &flags, left_prec, right_prec, pad_char); if (asciivalue == NULL) goto end_error; /* errno already set */ /* to ENOMEM by malloc() */ /* set some variables for later use */ - __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr); + __setup_vars(flags, lc, &cs_precedes, &sep_by_space, &sign_posn, &signstr); /* * Description of some LC_MONETARY's values: @@ -405,11 +422,9 @@ end_error: static void -__setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, +__setup_vars(int flags, struct lconv* lc, char *cs_precedes, char *sep_by_space, char *sign_posn, char **signstr) { - struct lconv *lc = localeconv(); - if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { *cs_precedes = lc->int_n_cs_precedes; *sep_by_space = lc->int_n_sep_by_space; @@ -443,12 +458,12 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, static int -__calc_left_pad(int flags, char *cur_symb) +__calc_left_pad(int flags, struct lconv* lc, char *cur_symb) { char cs_precedes, sep_by_space, sign_posn, *signstr; int left_chars = 0; - __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr); + __setup_vars(flags, lc, &cs_precedes, &sep_by_space, &sign_posn, &signstr); if (cs_precedes != 0) { left_chars += strlen(cur_symb); @@ -495,7 +510,7 @@ get_groups(int size, char *grouping) /* convert double to ASCII */ static char * -__format_grouped_double(double value, int *flags, int left_prec, int right_prec, +__format_grouped_double(double value, struct lconv* lc, int *flags, int left_prec, int right_prec, int pad_char) { char *rslt; @@ -508,7 +523,6 @@ __format_grouped_double(double value, int *flags, int left_prec, int right_prec, int padded; - struct lconv *lc = localeconv(); char *grouping; char decimal_point; char thousands_sep; diff --git a/src/system/libroot/posix/string/strcasecmp.c b/src/system/libroot/posix/string/strcasecmp.c index a44545ae9f..f43b437959 100644 --- a/src/system/libroot/posix/string/strcasecmp.c +++ b/src/system/libroot/posix/string/strcasecmp.c @@ -68,3 +68,35 @@ strncasecmp(const char *s1, const char *s2, size_t n) return 0; } + +int +strcasecmp_l(const char *s1, const char *s2, locale_t locale) +{ + const u_char *us1 = (const u_char *)s1; + const u_char *us2 = (const u_char *)s2; + + while (tolower_l(*us1, locale) == tolower_l(*us2++, locale)) { + if (*us1++ == '\0') + return 0; + } + + return tolower_l(*us1, locale) - tolower_l(*--us2, locale); +} + + +int +strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale) +{ + if (n != 0) { + const u_char *us1 = (const u_char *)s1; + const u_char *us2 = (const u_char *)s2; + + do { + if (tolower_l(*us1, locale) != tolower_l(*us2++, locale)) + return tolower_l(*us1, locale) - tolower_l(*--us2, locale); + if (*us1++ == '\0') + break; + } while (--n != 0); + } + return 0; +} diff --git a/src/system/libroot/posix/string/strcoll.cpp b/src/system/libroot/posix/string/strcoll.cpp index 1a477e57f0..6339fd0a03 100644 --- a/src/system/libroot/posix/string/strcoll.cpp +++ b/src/system/libroot/posix/string/strcoll.cpp @@ -11,15 +11,39 @@ #include "LocaleBackend.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" int strcoll(const char *a, const char *b) { - if (gLocaleBackend != NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { int result = 0; - status_t status = gLocaleBackend->Strcoll(a, b, result); + status_t status = backend->Strcoll(a, b, result); + + if (status != B_OK) + __set_errno(EINVAL); + + return result; + } + + return strcmp(a, b); +} + + +extern "C" int +strcoll_l(const char *a, const char *b, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) { + int result = 0; + status_t status = backend->Strcoll(a, b, result); if (status != B_OK) __set_errno(EINVAL); diff --git a/src/system/libroot/posix/string/strerror.c b/src/system/libroot/posix/string/strerror.c index bc52cb19d9..0feea3a8ea 100644 --- a/src/system/libroot/posix/string/strerror.c +++ b/src/system/libroot/posix/string/strerror.c @@ -583,3 +583,11 @@ strerror_r(int error, char *buffer, size_t bufferSize) // TODO: could return ERANGE if buffer is too small } + +char * +strerror_l(int error, locale_t locale) +{ + // Don't have error messages in other locales yet. + (void)locale; + return strerror(error); +} diff --git a/src/system/libroot/posix/string/strxfrm.cpp b/src/system/libroot/posix/string/strxfrm.cpp index 058f3cf123..041bdcf609 100644 --- a/src/system/libroot/posix/string/strxfrm.cpp +++ b/src/system/libroot/posix/string/strxfrm.cpp @@ -11,15 +11,39 @@ #include "LocaleBackend.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" size_t strxfrm(char *out, const char *in, size_t size) { - if (gLocaleBackend != NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { size_t outSize = 0; - status_t status = gLocaleBackend->Strxfrm(out, in, size, outSize); + status_t status = backend->Strxfrm(out, in, size, outSize); + + if (status != B_OK) + __set_errno(EINVAL); + + return outSize; + } + + return strlcpy(out, in, size); +} + + +extern "C" size_t +strxfrm_l(char *out, const char *in, size_t size, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) { + size_t outSize = 0; + status_t status = backend->Strxfrm(out, in, size, outSize); if (status != B_OK) __set_errno(EINVAL); diff --git a/src/system/libroot/posix/time/localtime.cpp b/src/system/libroot/posix/time/localtime.cpp index 739712fb81..7d36f2989d 100644 --- a/src/system/libroot/posix/time/localtime.cpp +++ b/src/system/libroot/posix/time/localtime.cpp @@ -17,7 +17,7 @@ #include "LocaleBackend.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; using BPrivate::Libroot::LocaleBackend; @@ -43,13 +43,13 @@ extern "C" time_t __timegm_fallback(struct tm* tmp); extern "C" void tzset(void) { - if (gLocaleBackend == NULL && LocaleBackend::LoadBackend() != B_OK) + if (GetCurrentLocaleBackend() == NULL && LocaleBackend::LoadBackend() != B_OK) return; char timeZoneID[B_FILE_NAME_LENGTH] = { "GMT" }; _kern_get_timezone(NULL, timeZoneID, sizeof(timeZoneID)); - gLocaleBackend->TZSet(timeZoneID, getenv("TZ")); + GetCurrentLocaleBackend()->TZSet(timeZoneID, getenv("TZ")); } @@ -71,8 +71,11 @@ localtime_r(const time_t* inTime, struct tm* tmOut) } tzset(); - if (gLocaleBackend != NULL) { - status_t status = gLocaleBackend->Localtime(inTime, tmOut); + + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { + status_t status = backend->Localtime(inTime, tmOut); if (status != B_OK) __set_errno(EOVERFLOW); @@ -104,8 +107,11 @@ gmtime_r(const time_t* inTime, struct tm* tmOut) } tzset(); - if (gLocaleBackend != NULL) { - status_t status = gLocaleBackend->Gmtime(inTime, tmOut); + + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { + status_t status = backend->Gmtime(inTime, tmOut); if (status != B_OK) __set_errno(EOVERFLOW); @@ -128,9 +134,12 @@ mktime(struct tm* inTm) } tzset(); - if (gLocaleBackend != NULL) { + + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { time_t timeOut; - status_t status = gLocaleBackend->Mktime(inTm, timeOut); + status_t status = backend->Mktime(inTm, timeOut); if (status != B_OK) { __set_errno(EOVERFLOW); @@ -154,9 +163,12 @@ timegm(struct tm* inTm) return -1; } tzset(); - if (gLocaleBackend != NULL) { + + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { time_t timeOut; - status_t status = gLocaleBackend->Timegm(inTm, timeOut); + status_t status = backend->Timegm(inTm, timeOut); if (status != B_OK) { __set_errno(EOVERFLOW); diff --git a/src/system/libroot/posix/time/strftime.c b/src/system/libroot/posix/time/strftime.c index dd725326ec..72550bbd8d 100644 --- a/src/system/libroot/posix/time/strftime.c +++ b/src/system/libroot/posix/time/strftime.c @@ -38,13 +38,13 @@ static const char sccsid[] = "@(#)strftime.c 5.4 (Berkeley) 3/14/89"; #include "locale.h" #include "timelocal.h" -#define Locale __get_current_time_locale() - static char * _add P((const char *, char *, const char *)); static char * _conv P((int, const char *, char *, const char *)); static char * _fmt P((const char *, const struct tm *, char *, const char *, - int *)); + int *, const struct lc_time_t*)); static char * _yconv P((int, int, int, int, char *, const char *)); +static size_t __strftime(char * const, const size_t, const char * const, + const struct tm * const, const struct lc_time_t*); extern char * tzname[]; @@ -60,18 +60,32 @@ extern char * tzname[]; #define NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU size_t -strftime(s, maxsize, format, t) +strftime(char* const s, const size_t maxsize, const char* const format, const struct tm* const t) +{ + return __strftime(s, maxsize, format, t, __get_current_time_locale()); +} + +size_t +strftime_l(char* const s, const size_t maxsize, const char* const format, const struct tm* const t, + locale_t locale) +{ + return __strftime(s, maxsize, format, t, __get_time_locale(locale)); +} + +static size_t +__strftime(s, maxsize, format, t, locale) char * const s; const size_t maxsize; const char * const format; const struct tm * const t; +const struct lc_time_t* locale; { char * p; int warn; tzset(); warn = IN_NONE; - p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn); + p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn, locale); #ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { (void) fprintf(stderr, "\n"); @@ -95,12 +109,13 @@ const struct tm * const t; } static char * -_fmt(format, t, pt, ptlim, warnp) +_fmt(format, t, pt, ptlim, warnp, Locale) const char * format; const struct tm * const t; char * pt; const char * const ptlim; int * warnp; +const struct lc_time_t* Locale; { for ( ; *format; ++format) { if (*format == '%') { @@ -152,13 +167,13 @@ label: { int warn2 = IN_SOME; - pt = _fmt(Locale->c_fmt, t, pt, ptlim, warnp); + pt = _fmt(Locale->c_fmt, t, pt, ptlim, warnp, Locale); if (warn2 > *warnp) *warnp = warn2; } continue; case 'D': - pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp); + pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp, Locale); continue; case 'd': pt = _conv(t->tm_mday, "%02d", pt, ptlim); @@ -179,7 +194,7 @@ label: pt = _conv(t->tm_mday, "%2d", pt, ptlim); continue; case 'F': - pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp); + pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp, Locale); continue; case 'H': pt = _conv(t->tm_hour, "%02d", pt, ptlim); @@ -243,10 +258,10 @@ label: pt, ptlim); continue; case 'R': - pt = _fmt("%H:%M", t, pt, ptlim, warnp); + pt = _fmt("%H:%M", t, pt, ptlim, warnp, Locale); continue; case 'r': - pt = _fmt("%I:%M:%S %p", t, pt, ptlim, warnp); + pt = _fmt("%I:%M:%S %p", t, pt, ptlim, warnp, Locale); continue; case 'S': pt = _conv(t->tm_sec, "%02d", pt, ptlim); @@ -269,7 +284,7 @@ label: } continue; case 'T': - pt = _fmt("%H:%M:%S", t, pt, ptlim, warnp); + pt = _fmt("%H:%M:%S", t, pt, ptlim, warnp, Locale); continue; case 't': pt = _add("\t", pt, ptlim); @@ -384,7 +399,7 @@ label: ** "date as dd-bbb-YYYY" ** (ado, 1993-05-24) */ - pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp); + pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp, Locale); continue; case 'W': pt = _conv((t->tm_yday + DAYSPERWEEK - @@ -397,13 +412,13 @@ label: pt = _conv(t->tm_wday, "%d", pt, ptlim); continue; case 'X': - pt = _fmt(Locale->X_fmt, t, pt, ptlim, warnp); + pt = _fmt(Locale->X_fmt, t, pt, ptlim, warnp, Locale); continue; case 'x': { int warn2 = IN_SOME; - pt = _fmt(Locale->x_fmt, t, pt, ptlim, &warn2); + pt = _fmt(Locale->x_fmt, t, pt, ptlim, &warn2, Locale); if (warn2 == IN_ALL) warn2 = IN_THIS; if (warn2 > *warnp) @@ -489,7 +504,7 @@ label: continue; case '+': pt = _fmt(Locale->date_fmt, t, pt, ptlim, - warnp); + warnp, Locale); continue; case '%': /* diff --git a/src/system/libroot/posix/time/timelocal.cpp b/src/system/libroot/posix/time/timelocal.cpp index bfa62bbdc9..0aa99af3cb 100644 --- a/src/system/libroot/posix/time/timelocal.cpp +++ b/src/system/libroot/posix/time/timelocal.cpp @@ -12,14 +12,29 @@ #include "PosixLCTimeInfo.h" -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" const lc_time_t* __get_current_time_locale(void) { - if (gLocaleBackend) - return gLocaleBackend->LCTimeInfo(); + if (GetCurrentLocaleBackend() != NULL) + return GetCurrentLocaleBackend()->LCTimeInfo(); + + return &BPrivate::Libroot::gPosixLCTimeInfo; +} + + +extern "C" const lc_time_t* +__get_time_locale(locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) + return backend->LCTimeInfo(); return &BPrivate::Libroot::gPosixLCTimeInfo; } diff --git a/src/system/libroot/posix/wchar/mbrtowc.cpp b/src/system/libroot/posix/wchar/mbrtowc.cpp index 38ee8a0529..625b11ab13 100644 --- a/src/system/libroot/posix/wchar/mbrtowc.cpp +++ b/src/system/libroot/posix/wchar/mbrtowc.cpp @@ -20,7 +20,8 @@ #endif -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; extern "C" size_t @@ -34,7 +35,9 @@ __mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps) if (s == NULL) return __mbrtowc(NULL, "", 1, ps); - if (gLocaleBackend == NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend == NULL) { if (*s == '\0') { memset(ps, 0, sizeof(mbstate_t)); @@ -63,8 +66,7 @@ __mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps) } size_t lengthUsed; - status_t status - = gLocaleBackend->MultibyteToWchar(pwc, s, n, ps, lengthUsed); + status_t status = backend->MultibyteToWchar(pwc, s, n, ps, lengthUsed); if (status == B_BAD_INDEX) return (size_t)-2; diff --git a/src/system/libroot/posix/wchar/mbsrtowcs.cpp b/src/system/libroot/posix/wchar/mbsrtowcs.cpp index 7776be27a8..dd1a0c4a7e 100644 --- a/src/system/libroot/posix/wchar/mbsrtowcs.cpp +++ b/src/system/libroot/posix/wchar/mbsrtowcs.cpp @@ -20,22 +20,25 @@ #endif -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; extern "C" size_t __mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, mbstate_t* ps) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + TRACE(("mbsnrtowcs(%p, %p, %lu, %lu) - lb:%p\n", dst, *src, nmc, len, - gLocaleBackend)); + backend)); if (ps == NULL) { static mbstate_t internalMbState; ps = &internalMbState; } - if (gLocaleBackend == NULL) { + if (backend == NULL) { /* * The POSIX locale is active. Since the POSIX locale only contains * chars 0-127 and those ASCII chars are compatible with the UTF32 @@ -82,7 +85,7 @@ __mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, } size_t result = 0; - status_t status = gLocaleBackend->MultibyteStringToWchar(dst, len, src, nmc, + status_t status = backend->MultibyteStringToWchar(dst, len, src, nmc, ps, result); if (status == B_BAD_DATA) { @@ -112,7 +115,8 @@ __mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps) ps = &internalMbState; } - size_t srcLen = gLocaleBackend == NULL ? strlen(*src) + 1 : (size_t)-1; + LocaleBackend* backend = GetCurrentLocaleBackend(); + size_t srcLen = backend == NULL ? strlen(*src) + 1 : (size_t)-1; return __mbsnrtowcs(dst, src, srcLen, len, ps); } diff --git a/src/system/libroot/posix/wchar/wcrtomb.cpp b/src/system/libroot/posix/wchar/wcrtomb.cpp index 828535169f..3847bec797 100644 --- a/src/system/libroot/posix/wchar/wcrtomb.cpp +++ b/src/system/libroot/posix/wchar/wcrtomb.cpp @@ -20,12 +20,15 @@ #endif -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; extern "C" size_t __wcrtomb(char* s, wchar_t wc, mbstate_t* ps) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + if (ps == NULL) { static mbstate_t internalMbState; ps = &internalMbState; @@ -34,7 +37,7 @@ __wcrtomb(char* s, wchar_t wc, mbstate_t* ps) if (s == NULL) wc = 0; - if (gLocaleBackend == NULL) { + if (backend == NULL) { /* * The POSIX locale is active. Since the POSIX locale only contains * chars 0-127 and those ASCII chars are compatible with the UTF32 @@ -54,7 +57,7 @@ __wcrtomb(char* s, wchar_t wc, mbstate_t* ps) } size_t lengthUsed; - status_t status = gLocaleBackend->WcharToMultibyte(s, wc, ps, lengthUsed); + status_t status = backend->WcharToMultibyte(s, wc, ps, lengthUsed); if (status == B_BAD_INDEX) return (size_t)-2; diff --git a/src/system/libroot/posix/wchar/wcscasecmp.c b/src/system/libroot/posix/wchar/wcscasecmp.c index 3156f49874..ec486b33be 100644 --- a/src/system/libroot/posix/wchar/wcscasecmp.c +++ b/src/system/libroot/posix/wchar/wcscasecmp.c @@ -27,3 +27,22 @@ __wcscasecmp(const wchar_t* wcs1, const wchar_t* wcs2) B_DEFINE_WEAK_ALIAS(__wcscasecmp, wcscasecmp); + + +int +__wcscasecmp_l(const wchar_t* wcs1, const wchar_t* wcs2, locale_t locale) +{ + int cmp; + + for (;;) { + cmp = towlower_l(*wcs1, locale) - towlower_l(*wcs2++, locale); + + if (cmp != 0 || *wcs1++ == L'\0') + break; + } + + return cmp; +} + + +B_DEFINE_WEAK_ALIAS(__wcscasecmp_l, wcscasecmp_l); diff --git a/src/system/libroot/posix/wchar/wcscoll.cpp b/src/system/libroot/posix/wchar/wcscoll.cpp index d06ffcb0bc..2a7c8a4e82 100644 --- a/src/system/libroot/posix/wchar/wcscoll.cpp +++ b/src/system/libroot/posix/wchar/wcscoll.cpp @@ -8,15 +8,19 @@ #include -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" int __wcscoll(const wchar_t* wcs1, const wchar_t* wcs2) { - if (gLocaleBackend != NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { int result = 0; - status_t status = gLocaleBackend->Wcscoll(wcs1, wcs2, result); + status_t status = backend->Wcscoll(wcs1, wcs2, result); if (status != B_OK) __set_errno(EINVAL); @@ -29,3 +33,26 @@ __wcscoll(const wchar_t* wcs1, const wchar_t* wcs2) B_DEFINE_WEAK_ALIAS(__wcscoll, wcscoll); + + +extern "C" int +__wcscoll_l(const wchar_t* wcs1, const wchar_t* wcs2, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) { + int result = 0; + status_t status = backend->Wcscoll(wcs1, wcs2, result); + + if (status != B_OK) + __set_errno(EINVAL); + + return result; + } + + return wcscmp(wcs1, wcs2); +} + + +B_DEFINE_WEAK_ALIAS(__wcscoll_l, wcscoll_l); diff --git a/src/system/libroot/posix/wchar/wcsncasecmp.c b/src/system/libroot/posix/wchar/wcsncasecmp.c index 5c611f1566..6796f6907f 100644 --- a/src/system/libroot/posix/wchar/wcsncasecmp.c +++ b/src/system/libroot/posix/wchar/wcsncasecmp.c @@ -27,3 +27,24 @@ __wcsncasecmp(const wchar_t* wcs1, const wchar_t* wcs2, size_t count) B_DEFINE_WEAK_ALIAS(__wcsncasecmp, wcsncasecmp); + + +int +__wcsncasecmp_l(const wchar_t* wcs1, const wchar_t* wcs2, size_t count, locale_t locale) +{ + int cmp = 0; + + while (count-- > 0) { + cmp = towlower_l(*wcs1, locale) - towlower_l(*wcs2++, locale); + /* note: won't overflow, since our wchar_t is guaranteed to never + have the highest bit set */ + + if (cmp != 0 || *wcs1++ == L'\0') + break; + } + + return cmp; +} + + +B_DEFINE_WEAK_ALIAS(__wcsncasecmp_l, wcsncasecmp_l); diff --git a/src/system/libroot/posix/wchar/wcsrtombs.cpp b/src/system/libroot/posix/wchar/wcsrtombs.cpp index 9d6b3cc455..110ab2625a 100644 --- a/src/system/libroot/posix/wchar/wcsrtombs.cpp +++ b/src/system/libroot/posix/wchar/wcsrtombs.cpp @@ -21,22 +21,25 @@ #endif -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; extern "C" size_t __wcsnrtombs(char* dst, const wchar_t** src, size_t nwc, size_t len, mbstate_t* ps) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + TRACE(("wcsnrtombs(%p, %p, %lu, %lu) - lb:%p\n", dst, *src, nwc, len, - gLocaleBackend)); + backend)); if (ps == NULL) { static mbstate_t internalMbState; ps = &internalMbState; } - if (gLocaleBackend == NULL) { + if (backend == NULL) { /* * The POSIX locale is active. Since the POSIX locale only contains * chars 0-127 and those ASCII chars are compatible with the UTF32 @@ -83,7 +86,7 @@ __wcsnrtombs(char* dst, const wchar_t** src, size_t nwc, size_t len, } size_t result = 0; - status_t status = gLocaleBackend->WcharStringToMultibyte(dst, len, src, nwc, + status_t status = backend->WcharStringToMultibyte(dst, len, src, nwc, ps, result); if (status == B_BAD_DATA) { diff --git a/src/system/libroot/posix/wchar/wcsxfrm.cpp b/src/system/libroot/posix/wchar/wcsxfrm.cpp index 4260703d32..ac935a75e8 100644 --- a/src/system/libroot/posix/wchar/wcsxfrm.cpp +++ b/src/system/libroot/posix/wchar/wcsxfrm.cpp @@ -10,15 +10,19 @@ #include -using BPrivate::Libroot::gLocaleBackend; +using BPrivate::Libroot::GetCurrentLocaleBackend; +using BPrivate::Libroot::LocaleBackend; +using BPrivate::Libroot::LocaleBackendData; extern "C" size_t __wcsxfrm(wchar_t* dest, const wchar_t* src, size_t destSize) { - if (gLocaleBackend != NULL) { + LocaleBackend* backend = GetCurrentLocaleBackend(); + + if (backend != NULL) { size_t outSize = 0; - status_t status = gLocaleBackend->Wcsxfrm(dest, src, destSize, outSize); + status_t status = backend->Wcsxfrm(dest, src, destSize, outSize); if (status != B_OK) __set_errno(EINVAL); @@ -31,3 +35,26 @@ __wcsxfrm(wchar_t* dest, const wchar_t* src, size_t destSize) B_DEFINE_WEAK_ALIAS(__wcsxfrm, wcsxfrm); + + +extern "C" size_t +__wcsxfrm_l(wchar_t* dest, const wchar_t* src, size_t destSize, locale_t l) +{ + LocaleBackendData* locale = (LocaleBackendData*)l; + LocaleBackend* backend = locale->backend; + + if (backend != NULL) { + size_t outSize = 0; + status_t status = backend->Wcsxfrm(dest, src, destSize, outSize); + + if (status != B_OK) + __set_errno(EINVAL); + + return outSize; + } + + return wcslcpy(dest, src, destSize); +} + + +B_DEFINE_WEAK_ALIAS(__wcsxfrm_l, wcsxfrm_l); diff --git a/src/system/libroot/stubbed/libroot_stubs.c b/src/system/libroot/stubbed/libroot_stubs.c index 5cd88a1b25..81b4fdb55c 100644 --- a/src/system/libroot/stubbed/libroot_stubs.c +++ b/src/system/libroot/stubbed/libroot_stubs.c @@ -11,16 +11,16 @@ int _ZN10__cxxabiv120__unexpected_handlerE; int _ZN8BPrivate10kGroupFileE; int _ZN8BPrivate11kPasswdFileE; int _ZN8BPrivate14kShadowPwdFileE; -int _ZN8BPrivate7Libroot14gLocaleBackendE; int _ZN8BPrivate7Libroot14gPosixLanginfoE; int _ZN8BPrivate7Libroot16gPosixLCTimeInfoE; int _ZN8BPrivate7Libroot16gPosixLocaleConvE; +int _ZN8BPrivate7Libroot20gGlobalLocaleBackendE; +int _ZN8BPrivate7Libroot23gGlobalLocaleDataBridgeE; int _ZN8BPrivate9hoardHeap10_sizeTableE; int _ZN8BPrivate9hoardHeap10_thresholdE; int _ZN8BPrivate9hoardHeap14_numProcessorsE; int _ZN8BPrivate9hoardHeap15fMaxThreadHeapsE; int _ZN8BPrivate9hoardHeap18_numProcessorsMaskE; -int __bss_start; int __ctype32_wctrans; int __ctype32_wctype; int __ctype_b; @@ -28,6 +28,7 @@ int __ctype_mb_cur_max; int __ctype_tolower; int __ctype_toupper; int __gABIVersion; +int __gAPIVersion; int __gCPUCount; int __gCommPageAddress; int __gRuntimeLoader; @@ -42,10 +43,10 @@ int __main_thread_id; int __printf_arginfo_table; int __printf_function_table; int __progname; +int __signgam; +int __stack_chk_guard; int __wcsmbs_gconv_fcts; int _data_offset_main_; -int _edata; -int _end; int _gSharedObjectHaikuABI; int _gSharedObjectHaikuVersion; int _nl_C_LC_COLLATE; @@ -55,11 +56,7 @@ int _nl_C_LC_MONETARY; int _nl_C_LC_NUMERIC; int _nl_C_LC_TIME; int _nl_C_locobj; -int _nl_current_LC_COLLATE; -int _nl_current_LC_CTYPE; -int _nl_current_LC_MESSAGES; -int _nl_current_LC_MONETARY; -int _nl_current_LC_NUMERIC; +int _nl_global_locale; int _obstack; int _rtDebugFlag; int _single_threaded; @@ -79,12 +76,10 @@ int opterr; int optind; int optopt; int re_syntax_options; -int signgam; int stderr; int stdin; int stdout; int sys_siglist; -int tab54; int timezone; int tzname; @@ -288,6 +283,7 @@ void _Z17HMAC_SHA256_FinalPhP15HMAC_SHA256_CTX() {} void _Z17__init_after_forkv() {} void _Z18HMAC_SHA256_UpdateP15HMAC_SHA256_CTXPKvm() {} void _Z18crypto_scrypt_smixPhmmPvS0_() {} +void _Z20__pthread_mutex_lockP14_pthread_mutexjl() {} void _Z22internal_path_for_pathPcmPKcS1_19path_base_directoryS1_jS_m() {} void _Z26get_driver_settings_stringPvPcPlb() {} void _Z36posix_spawn_file_actions_addchdir_npPP25_posix_spawn_file_actionsPKc() {} @@ -312,7 +308,7 @@ void _ZN10__cxxabiv119__foreign_exceptionD2Ev() {} void _ZN10__cxxabiv120__si_class_type_infoD0Ev() {} void _ZN10__cxxabiv120__si_class_type_infoD1Ev() {} void _ZN10__cxxabiv120__si_class_type_infoD2Ev() {} -void _ZN11LocalRWLock15StructureUnlockEv() {} +void _ZN11LocalRWLock5_WaitEbjl() {} void _ZN11LocalRWLock8_UnblockEv() {} void _ZN14parsed_element11SetCharTypeEha() {} void _ZN14parsed_element5AdoptERK16known_identifier() {} @@ -323,11 +319,17 @@ void _ZN16DoublyLinkedListI15AtExitInfoBlock31DoublyLinkedListStandardGetLinkIS0 void _ZN16DoublyLinkedListI15AtExitInfoBlock31DoublyLinkedListStandardGetLinkIS0_EED2Ev() {} void _ZN16SinglyLinkedListI10AtExitInfo31SinglyLinkedListStandardGetLinkIS0_EED1Ev() {} void _ZN16SinglyLinkedListI10AtExitInfo31SinglyLinkedListStandardGetLinkIS0_EED2Ev() {} +void _ZN17EnvironmentFilter5_InitEiPKcmPKS1_m() {} +void _ZN8BPrivate10AutoLockerI11LocalRWLockNS1_7LockingEE6UnlockEv() {} +void _ZN8BPrivate10AutoLockerI5mutex12MutexLockingE6UnlockEv() {} +void _ZN8BPrivate10AutoLockerIiNS_16UserGroupLockingEE6UnlockEv() {} void _ZN8BPrivate10hoardYieldEv() {} void _ZN8BPrivate10superblock14makeSuperblockEiPNS_11processHeapE() {} +void _ZN8BPrivate10superblock8getBlockEv() {} void _ZN8BPrivate10superblockC1EiiPNS_9hoardHeapE() {} void _ZN8BPrivate10superblockC2EiiPNS_9hoardHeapE() {} void _ZN8BPrivate10threadHeap6mallocEm() {} +void _ZN8BPrivate10threadHeap8memalignEmm() {} void _ZN8BPrivate10threadHeapC1Ev() {} void _ZN8BPrivate10threadHeapC2Ev() {} void _ZN8BPrivate11hoardUnlockER5mutex() {} @@ -370,33 +372,43 @@ void _ZN8BPrivate6SHA256C2Ev() {} void _ZN8BPrivate6SHA256D1Ev() {} void _ZN8BPrivate6SHA256D2Ev() {} void _ZN8BPrivate7Libroot13LocaleBackend11LoadBackendEv() {} +void _ZN8BPrivate7Libroot13LocaleBackend13CreateBackendEv() {} +void _ZN8BPrivate7Libroot13LocaleBackend14DestroyBackendEPS1_() {} void _ZN8BPrivate7Libroot13LocaleBackendC1Ev() {} void _ZN8BPrivate7Libroot13LocaleBackendC2Ev() {} void _ZN8BPrivate7Libroot13LocaleBackendD0Ev() {} void _ZN8BPrivate7Libroot13LocaleBackendD1Ev() {} void _ZN8BPrivate7Libroot13LocaleBackendD2Ev() {} void _ZN8BPrivate7Libroot15gPosixClassInfoE() {} -void _ZN8BPrivate7Libroot16LocaleDataBridgeC1Ev() {} -void _ZN8BPrivate7Libroot16LocaleDataBridgeC2Ev() {} +void _ZN8BPrivate7Libroot16LocaleDataBridge20ApplyToCurrentThreadEv() {} +void _ZN8BPrivate7Libroot16LocaleDataBridgeC1Eb() {} +void _ZN8BPrivate7Libroot16LocaleDataBridgeC2Eb() {} void _ZN8BPrivate7Libroot16LocaleDataBridgeD1Ev() {} void _ZN8BPrivate7Libroot16LocaleDataBridgeD2Ev() {} void _ZN8BPrivate7Libroot16gPosixToLowerMapE() {} void _ZN8BPrivate7Libroot16gPosixToUpperMapE() {} +void _ZN8BPrivate7Libroot20GetCurrentLocaleInfoEv() {} void _ZN8BPrivate7Libroot20LocaleTimeDataBridgeC1Ev() {} void _ZN8BPrivate7Libroot20LocaleTimeDataBridgeC2Ev() {} +void _ZN8BPrivate7Libroot20SetCurrentLocaleInfoEPNS0_17LocaleBackendDataE() {} void _ZN8BPrivate7Libroot21LocaleCtypeDataBridge11setMbCurMaxEt() {} -void _ZN8BPrivate7Libroot21LocaleCtypeDataBridgeC1Ev() {} -void _ZN8BPrivate7Libroot21LocaleCtypeDataBridgeC2Ev() {} -void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeC1Ev() {} -void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeC2Ev() {} +void _ZN8BPrivate7Libroot21LocaleCtypeDataBridge20ApplyToCurrentThreadEv() {} +void _ZN8BPrivate7Libroot21LocaleCtypeDataBridgeC1Eb() {} +void _ZN8BPrivate7Libroot21LocaleCtypeDataBridgeC2Eb() {} +void _ZN8BPrivate7Libroot22GetCurrentThreadLocaleEv() {} +void _ZN8BPrivate7Libroot23GetCurrentLocaleBackendEv() {} +void _ZN8BPrivate7Libroot23LocaleNumericDataBridge20ApplyToCurrentThreadEv() {} +void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeC1Eb() {} +void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeC2Eb() {} void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeD1Ev() {} void _ZN8BPrivate7Libroot23LocaleNumericDataBridgeD2Ev() {} void _ZN8BPrivate7Libroot24LocaleMessagesDataBridgeC1Ev() {} void _ZN8BPrivate7Libroot24LocaleMessagesDataBridgeC2Ev() {} void _ZN8BPrivate7Libroot24LocaleMonetaryDataBridgeC1Ev() {} void _ZN8BPrivate7Libroot24LocaleMonetaryDataBridgeC2Ev() {} -void _ZN8BPrivate7Libroot24TimeConversionDataBridgeC1Ev() {} -void _ZN8BPrivate7Libroot24TimeConversionDataBridgeC2Ev() {} +void _ZN8BPrivate7Libroot24TimeConversionDataBridgeC1Eb() {} +void _ZN8BPrivate7Libroot24TimeConversionDataBridgeC2Eb() {} +void _ZN8BPrivate7Libroot25GetLocalesFromEnvironmentEiPPKc() {} void _ZN8BPrivate8KMessage11ReceiveFromEilP17port_message_info() {} void _ZN8BPrivate8KMessage11_InitBufferEj() {} void _ZN8BPrivate8KMessage12_CapacityForEi() {} @@ -431,7 +443,10 @@ void _ZN8BPrivate9hoardHeap14moveSuperblockEPNS_10superblockEiii() {} void _ZN8BPrivate9hoardHeap16insertSuperblockEiPNS_10superblockEPNS_11processHeapE() {} void _ZN8BPrivate9hoardHeap16removeSuperblockEPNS_10superblockEi() {} void _ZN8BPrivate9hoardHeap19removeMaxSuperblockEi() {} +void _ZN8BPrivate9hoardHeap23findAvailableSuperblockEiRPNS_5blockEPNS_11processHeapE() {} void _ZN8BPrivate9hoardHeap5reuseEi() {} +void _ZN8BPrivate9hoardHeap7recycleEPNS_10superblockE() {} +void _ZN8BPrivate9hoardHeap8decStatsEiii() {} void _ZN8BPrivate9hoardHeap9freeBlockERPNS_5blockERPNS_10superblockEiPNS_11processHeapE() {} void _ZN8BPrivate9hoardHeapC1Ev() {} void _ZN8BPrivate9hoardHeapC2Ev() {} @@ -439,6 +454,8 @@ void _ZN8BPrivate9hoardLockER5mutex() {} void _ZN8BPrivate9hoardSbrkEl() {} void _ZN8DateMask10IsCompleteEv() {} void _ZN8DateMask7HasTimeEv() {} +void _ZN9__gnu_cxx20recursive_init_errorC1Ev() {} +void _ZN9__gnu_cxx20recursive_init_errorC2Ev() {} void _ZN9__gnu_cxx20recursive_init_errorD0Ev() {} void _ZN9__gnu_cxx20recursive_init_errorD1Ev() {} void _ZN9__gnu_cxx20recursive_init_errorD2Ev() {} @@ -456,6 +473,7 @@ void _ZN9__gnu_cxx29__concurrence_broadcast_errorD0Ev() {} void _ZN9__gnu_cxx29__concurrence_broadcast_errorD1Ev() {} void _ZN9__gnu_cxx29__concurrence_broadcast_errorD2Ev() {} void _ZN9__gnu_cxx30__throw_concurrence_lock_errorEv() {} +void _ZN9__gnu_cxx32__throw_concurrence_unlock_errorEv() {} void _ZN9__gnu_cxx35__throw_concurrence_broadcast_errorEv() {} void _ZN9__gnu_cxx9__freeresEv() {} void _ZNK10__cxxabiv117__class_type_info10__do_catchEPKSt9type_infoPPvj() {} @@ -494,7 +512,6 @@ void _ZNK8BPrivate8KMessage8FindDataEPKcjiPPKvPi() {} void _ZNK8BPrivate8KMessage9FindFieldEPKcPNS_13KMessageFieldE() {} void _ZNK8BPrivate8KMessage9FindFieldEPKcjPNS_13KMessageFieldE() {} void _ZNK8BPrivate8KMessage9ReplyPortEv() {} -void _ZNK8BPrivate8KMessage9_FindTypeIiEEiPKcjiPT_() {} void _ZNK9__gnu_cxx24__concurrence_lock_error4whatEv() {} void _ZNK9__gnu_cxx24__concurrence_wait_error4whatEv() {} void _ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv() {} @@ -531,7 +548,6 @@ void _ZNSt9type_infoD0Ev() {} void _ZNSt9type_infoD1Ev() {} void _ZNSt9type_infoD2Ev() {} void _ZSt10unexpectedv() {} -void _ZSt13__adjust_heapIPN17EnvironmentFilter5EntryElS1_N9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S7_T1_T2_() {} void _ZSt13get_terminatev() {} void _ZSt13set_terminatePFvvE() {} void _ZSt14get_unexpectedv() {} @@ -597,40 +613,18 @@ void _ZdaPv() {} void _ZdlPv() {} void _ZdlPvRKSt9nothrow_t() {} void _ZdlPvm() {} +void _Znam() {} void _ZnamRKSt9nothrow_t() {} +void _Znwm() {} void _ZnwmRKSt9nothrow_t() {} -void __acos() {} -void __acosf() {} -void __acosh() {} -void __acoshf() {} -void __acoshl() {} -void __acosl() {} -void __acr() {} -void __add() {} void __allocate_pthread() {} void __arch_get_stack_trace() {} void __arch_get_system_time_offset() {} void __arch_init_time() {} -void __asin() {} -void __asinf() {} -void __asinh() {} -void __asinhf() {} -void __asinhl() {} -void __asinl() {} void __asprintf() {} void __assert_fail() {} void __assert_perror_fail() {} -void __atan2() {} -void __atan2f() {} -void __atan2l() {} -void __atanf() {} -void __atanh() {} -void __atanhf() {} -void __atanhl() {} -void __atanl() {} -void __branred() {} void __btowc() {} -void __c32() {} void __cabs() {} void __cabsf() {} void __cabsl() {} @@ -655,18 +649,12 @@ void __catanh() {} void __catanhf() {} void __catanhl() {} void __catanl() {} -void __cbrt() {} -void __cbrtf() {} -void __cbrtl() {} void __ccos() {} void __ccosf() {} void __ccosh() {} void __ccoshf() {} void __ccoshl() {} void __ccosl() {} -void __ceil() {} -void __ceilf() {} -void __ceill() {} void __cexp() {} void __cexpf() {} void __cexpl() {} @@ -686,25 +674,12 @@ void __collseq_table_lookup() {} void __conj() {} void __conjf() {} void __conjl() {} -void __copysign() {} -void __copysignf() {} -void __copysignl() {} -void __cos() {} -void __cos32() {} -void __cosf() {} -void __cosh() {} -void __coshf() {} -void __coshl() {} -void __cosl() {} void __cpow() {} void __cpowf() {} void __cpowl() {} void __cproj() {} void __cprojf() {} void __cprojl() {} -void __cpy() {} -void __cpymn() {} -void __cr() {} void __creal() {} void __crealf() {} void __creall() {} @@ -724,7 +699,10 @@ void __ctanh() {} void __ctanhf() {} void __ctanhl() {} void __ctanl() {} +void __ctype_b_loc() {} void __ctype_get_mb_cur_max() {} +void __ctype_tolower_loc() {} +void __ctype_toupper_loc() {} void __cxa_allocate_dependent_exception() {} void __cxa_allocate_exception() {} void __cxa_atexit() {} @@ -734,7 +712,6 @@ void __cxa_begin_catch() {} void __cxa_call_terminate() {} void __cxa_call_unexpected() {} void __cxa_current_exception_type() {} -void __cxa_deleted_virtual() {} void __cxa_demangle() {} void __cxa_end_catch() {} void __cxa_finalize() {} @@ -747,50 +724,12 @@ void __cxa_guard_abort() {} void __cxa_guard_acquire() {} void __cxa_guard_release() {} void __cxa_init_primary_exception() {} -void __cxa_pure_virtual() {} void __cxa_rethrow() {} void __cxa_throw() {} void __cxa_throw_bad_array_new_length() {} -void __dbl_mp() {} -void __doasin() {} -void __docos() {} void __drand48_iterate() {} -void __drem() {} -void __dremf() {} -void __dreml() {} -void __dubcos() {} -void __dubsin() {} -void __dvd() {} void __erand48_r() {} -void __erf() {} -void __erfc() {} -void __erfcf() {} -void __erfcl() {} -void __erff() {} -void __erfl() {} -void __exp() {} -void __exp1() {} -void __exp10() {} -void __exp10f() {} -void __exp10l() {} -void __exp2() {} -void __exp2f() {} -void __exp2l() {} -void __exp_atable() {} -void __exp_deltatable() {} -void __expf() {} -void __expl() {} -void __expl_finite() {} -void __expm1() {} -void __expm1f() {} -void __expm1l() {} -void __fabs() {} -void __fabsf() {} -void __fabsl() {} void __fcloseall() {} -void __fdim() {} -void __fdimf() {} -void __fdiml() {} void __fe_dfl_env() {} void __fedisableexcept() {} void __feenableexcept() {} @@ -806,21 +745,6 @@ void __finite() {} void __finitef() {} void __finitel() {} void __flatten_process_args() {} -void __floor() {} -void __floorf() {} -void __floorl() {} -void __fma() {} -void __fmaf() {} -void __fmal() {} -void __fmax() {} -void __fmaxf() {} -void __fmaxl() {} -void __fmin() {} -void __fminf() {} -void __fminl() {} -void __fmod() {} -void __fmodf() {} -void __fmodl() {} void __fopen_internal() {} void __fopen_maybe_mmap() {} void __fpclassify() {} @@ -828,22 +752,8 @@ void __fpclassifyf() {} void __fpclassifyl() {} void __fpurge() {} void __freading() {} -void __frexp() {} -void __frexpf() {} -void __frexpl() {} void __fsetlocking() {} -void __fts_children() {} -void __fts_close() {} -void __fts_get_clientptr() {} -void __fts_get_stream() {} -void __fts_open() {} -void __fts_read() {} -void __fts_set() {} -void __fts_set_clientptr() {} void __fwprintf() {} -void __gamma() {} -void __gammaf() {} -void __gammal() {} void __gcclibcxx_demangle_callback() {} void __gconv_get_builtin_trans() {} void __gconv_transform_ascii_internal() {} @@ -863,6 +773,7 @@ void __get_scheduler_mode() {} void __get_secondary_architectures() {} void __get_system_info() {} void __get_system_time_offset() {} +void __get_time_locale() {} void __getc_unlocked() {} void __getdelim() {} void __getenv_reentrant() {} @@ -873,113 +784,22 @@ void __guess_architecture_for_path() {} void __guess_grouping() {} void __guess_secondary_architecture_from_path() {} void __gxx_personality_v0() {} -void __halfulp() {} -void __hdestroy() {} void __heap_after_fork_child() {} void __heap_after_fork_parent() {} void __heap_before_fork() {} void __heap_terminate_after() {} void __heap_thread_exit() {} void __heap_thread_init() {} -void __hypot() {} -void __hypotf() {} -void __hypotl() {} -void __ieee754_acos() {} -void __ieee754_acosf() {} -void __ieee754_acosh() {} -void __ieee754_acoshf() {} -void __ieee754_acoshl() {} -void __ieee754_acosl() {} -void __ieee754_asin() {} -void __ieee754_asinf() {} -void __ieee754_asinl() {} -void __ieee754_atan2() {} -void __ieee754_atan2f() {} -void __ieee754_atan2l() {} -void __ieee754_atanh() {} -void __ieee754_atanhf() {} -void __ieee754_atanhl() {} -void __ieee754_cosh() {} -void __ieee754_coshf() {} -void __ieee754_coshl() {} -void __ieee754_exp() {} -void __ieee754_exp10() {} -void __ieee754_exp10f() {} -void __ieee754_exp10l() {} -void __ieee754_exp2() {} -void __ieee754_exp2f() {} -void __ieee754_exp2l() {} -void __ieee754_expf() {} -void __ieee754_expl() {} -void __ieee754_fmod() {} -void __ieee754_fmodf() {} -void __ieee754_fmodl() {} -void __ieee754_gamma_r() {} -void __ieee754_gammaf_r() {} -void __ieee754_gammal_r() {} -void __ieee754_hypot() {} -void __ieee754_hypotf() {} -void __ieee754_hypotl() {} -void __ieee754_ilogbl() {} -void __ieee754_j0() {} -void __ieee754_j0f() {} -void __ieee754_j0l() {} -void __ieee754_j1() {} -void __ieee754_j1f() {} -void __ieee754_j1l() {} -void __ieee754_jn() {} -void __ieee754_jnf() {} -void __ieee754_jnl() {} -void __ieee754_lgamma_r() {} -void __ieee754_lgammaf_r() {} -void __ieee754_lgammal_r() {} -void __ieee754_log() {} -void __ieee754_log10() {} -void __ieee754_log10f() {} -void __ieee754_log10l() {} -void __ieee754_log2() {} -void __ieee754_log2f() {} -void __ieee754_log2l() {} -void __ieee754_logf() {} -void __ieee754_logl() {} -void __ieee754_pow() {} -void __ieee754_powf() {} -void __ieee754_powl() {} -void __ieee754_rem_pio2() {} -void __ieee754_rem_pio2f() {} -void __ieee754_remainder() {} -void __ieee754_remainderf() {} -void __ieee754_remainderl() {} -void __ieee754_scalb() {} -void __ieee754_scalbf() {} -void __ieee754_scalbl() {} -void __ieee754_sinh() {} -void __ieee754_sinhf() {} -void __ieee754_sinhl() {} -void __ieee754_sqrt() {} -void __ieee754_sqrtf() {} -void __ieee754_sqrtl() {} -void __ieee754_y0() {} -void __ieee754_y0f() {} -void __ieee754_y0l() {} -void __ieee754_y1() {} -void __ieee754_y1f() {} -void __ieee754_y1l() {} -void __ieee754_yn() {} -void __ieee754_ynf() {} -void __ieee754_ynl() {} -void __ilogb() {} -void __ilogbf() {} -void __ilogbl() {} void __init_env() {} void __init_env_post_heap() {} void __init_heap() {} void __init_once() {} void __init_pthread() {} void __init_pwd_backend() {} +void __init_stack_protector() {} void __init_time() {} void __initstate_r() {} -void __inv() {} +void __ioctl() {} void __isinf() {} void __isinff() {} void __isinfl() {} @@ -990,56 +810,15 @@ void __jrand48_r() {} void __kernel_casinh() {} void __kernel_casinhf() {} void __kernel_casinhl() {} -void __kernel_cosf() {} -void __kernel_rem_pio2() {} -void __kernel_rem_pio2f() {} -void __kernel_sinf() {} -void __kernel_tan() {} -void __kernel_tanf() {} void __lcong48_r() {} -void __ldexp() {} -void __ldexpf() {} -void __ldexpl() {} -void __lgamma() {} -void __lgamma_r() {} -void __lgammaf() {} -void __lgammaf_r() {} -void __lgammal() {} void __lgammal_r() {} void __libc_dlclose() {} void __libc_dlopen() {} void __libc_dlsym() {} void __libc_use_alloca() {} -void __llrint() {} -void __llrintf() {} -void __llrintl() {} -void __llround() {} -void __llroundf() {} -void __llroundl() {} -void __log() {} -void __log10() {} -void __log10f() {} -void __log10l() {} -void __log1p() {} -void __log1pf() {} -void __log1pl() {} -void __log2() {} -void __log2f() {} -void __log2l() {} -void __logb() {} -void __logbf() {} -void __logbl() {} -void __logf() {} -void __logf_finite() {} -void __logl() {} +void __load_image_at_path() {} void __longjmp_return() {} -void __lrint() {} -void __lrintf() {} -void __lrintl() {} -void __lround() {} -void __lroundf() {} -void __lroundl() {} -void __matherr() {} +void __look_up_in_path() {} void __mblen() {} void __mbrlen() {} void __mbrtowc() {} @@ -1050,16 +829,6 @@ void __mbstowcs() {} void __mbtowc() {} void __memrchr() {} void __mktime_fallback() {} -void __modf() {} -void __modff() {} -void __modfl() {} -void __mp_dbl() {} -void __mpatan() {} -void __mpatan2() {} -void __mpcos() {} -void __mpcos1() {} -void __mpexp() {} -void __mplog() {} void __mpn_add() {} void __mpn_add_1() {} void __mpn_add_n() {} @@ -1084,23 +853,11 @@ void __mpn_sub() {} void __mpn_sub_1() {} void __mpn_sub_n() {} void __mpn_submul_1() {} -void __mpranred() {} -void __mpsin() {} -void __mpsin1() {} -void __mpsqrt() {} -void __mptan() {} -void __mul() {} void __mutex_destroy() {} void __mutex_init() {} void __mutex_init_etc() {} void __mutex_lock() {} void __mutex_unlock() {} -void __nan() {} -void __nanf() {} -void __nanl() {} -void __nearbyint() {} -void __nearbyintf() {} -void __nearbyintl() {} void __new_fclose() {} void __new_fdopen() {} void __new_fgetpos() {} @@ -1109,26 +866,16 @@ void __new_fsetpos() {} void __new_pclose() {} void __new_popen() {} void __new_tmpfile() {} -void __nextafter() {} -void __nextafterf() {} -void __nextafterl() {} -void __nexttoward() {} -void __nexttowardf() {} -void __nexttowardl() {} void __nrand48_r() {} void __overflow() {} void __parse_invoke_line() {} void __path_search() {} -void __pow() {} -void __pow10() {} -void __pow10f() {} -void __pow10l() {} -void __powf() {} -void __powl() {} +void __ppoll() {} void __printf_fp() {} void __printf_fphex() {} void __pselect() {} void __pselect_beos() {} +void __pthread_attr_get_np() {} void __pthread_cleanup_pop_handler() {} void __pthread_cleanup_push_handler() {} void __pthread_destroy_thread() {} @@ -1150,18 +897,6 @@ void __recursive_lock_unlock() {} void __register_atfork() {} void __register_printf_function() {} void __reinit_pwd_backend_after_fork() {} -void __remainder() {} -void __remainderf() {} -void __remainderl() {} -void __remquo() {} -void __remquof() {} -void __remquol() {} -void __rint() {} -void __rintf() {} -void __rintl() {} -void __round() {} -void __roundf() {} -void __roundl() {} void __rw_lock_destroy() {} void __rw_lock_init() {} void __rw_lock_init_etc() {} @@ -1169,15 +904,6 @@ void __rw_lock_read_lock() {} void __rw_lock_read_unlock() {} void __rw_lock_write_lock() {} void __rw_lock_write_unlock() {} -void __scalb() {} -void __scalbf() {} -void __scalbl() {} -void __scalbln() {} -void __scalblnf() {} -void __scalblnl() {} -void __scalbn() {} -void __scalbnf() {} -void __scalbnl() {} void __seed48_r() {} void __set_scheduler_mode() {} void __set_stack_protection() {} @@ -1201,7 +927,6 @@ void __siginterrupt() {} void __siginterrupt_beos() {} void __sigismember() {} void __sigismember_beos() {} -void __signArctan() {} void __signal() {} void __signal_beos() {} void __signal_get_sigrtmax() {} @@ -1209,9 +934,6 @@ void __signal_get_sigrtmin() {} void __signbit() {} void __signbitf() {} void __signbitl() {} -void __significand() {} -void __significandf() {} -void __significandl() {} void __sigpause() {} void __sigpause_beos() {} void __sigpending() {} @@ -1227,24 +949,11 @@ void __sigsuspend() {} void __sigsuspend_beos() {} void __sigwait() {} void __sigwait_beos() {} -void __sin() {} -void __sin32() {} -void __sincos() {} -void __sincosf() {} -void __sincosl() {} -void __sinf() {} -void __sinh() {} -void __sinhf() {} -void __sinhl() {} -void __sinl() {} -void __slowexp() {} -void __slowpow() {} void __snprintf() {} -void __sqrt() {} -void __sqrtf() {} -void __sqrtl() {} void __srand48_r() {} void __srandom_r() {} +void __stack_chk_fail() {} +void __stack_chk_fail_local() {} void __start_watching_system() {} void __stop_watching_system() {} void __strtod_internal() {} @@ -1254,7 +963,6 @@ void __strtold_internal() {} void __strtoll_internal() {} void __strtoul_internal() {} void __strtoull_internal() {} -void __sub() {} void __swap_double() {} void __swap_float() {} void __swap_int16() {} @@ -1262,28 +970,12 @@ void __swap_int32() {} void __swap_int64() {} void __sysconf() {} void __sysconf_beos() {} -void __tanf() {} -void __tanh() {} -void __tanhf() {} -void __tanhl() {} -void __tanl() {} -void __tdelete() {} -void __tdestroy() {} void __tens() {} void __test_executable() {} -void __tfind() {} -void __tgamma() {} -void __tgammaf() {} -void __tgammal() {} +void __timegm_fallback() {} void __times() {} void __times_beos() {} void __tls_get_addr() {} -void ___tls_get_addr() {} -void __trunc() {} -void __truncf() {} -void __truncl() {} -void __tsearch() {} -void __twalk() {} void __uflow() {} void __underflow() {} void __vfscanf() {} @@ -1296,11 +988,13 @@ void __wcpcpy() {} void __wcpncpy() {} void __wcrtomb() {} void __wcscasecmp() {} +void __wcscasecmp_l() {} void __wcscat() {} void __wcschr() {} void __wcschrnul() {} void __wcscmp() {} void __wcscoll() {} +void __wcscoll_l() {} void __wcscpy() {} void __wcscspn() {} void __wcsdup() {} @@ -1309,6 +1003,7 @@ void __wcslcpy() {} void __wcslen() {} void __wcsmbs_clone_conv() {} void __wcsncasecmp() {} +void __wcsncasecmp_l() {} void __wcsncat() {} void __wcsncmp() {} void __wcsncpy() {} @@ -1330,6 +1025,7 @@ void __wcstoul_internal() {} void __wcstoull_internal() {} void __wcswidth() {} void __wcsxfrm() {} +void __wcsxfrm_l() {} void __wctob() {} void __wctomb() {} void __wmemchr() {} @@ -1356,6 +1052,7 @@ void _fseek() {} void _fstat_beos() {} void _fstat_current() {} void _get_area_info() {} +void _get_cpu_info_etc() {} void _get_image_info() {} void _get_next_area_info() {} void _get_next_image_info() {} @@ -1370,6 +1067,8 @@ void _get_team_info() {} void _get_team_usage_info() {} void _get_thread_info() {} void _getopt_internal() {} +void _getrusage_base() {} +void _getrusage_current() {} void _init() {} void _init_c_library_() {} void _itoa() {} @@ -1498,8 +1197,10 @@ void _kern_loading_app_failed() {} void _kern_lock_node() {} void _kern_map_file() {} void _kern_memory_advice() {} +void _kern_mlock() {} void _kern_mount() {} void _kern_move_partition() {} +void _kern_munlock() {} void _kern_mutex_lock() {} void _kern_mutex_sem_acquire() {} void _kern_mutex_sem_release() {} @@ -1519,6 +1220,7 @@ void _kern_open_query() {} void _kern_poll() {} void _kern_port_buffer_size_etc() {} void _kern_port_count() {} +void _kern_preallocate() {} void _kern_process_info() {} void _kern_read() {} void _kern_read_attr() {} @@ -1642,6 +1344,7 @@ void _kern_wait_for_debugger() {} void _kern_wait_for_objects() {} void _kern_wait_for_team() {} void _kern_wait_for_thread() {} +void _kern_wait_for_thread_etc() {} void _kern_write() {} void _kern_write_attr() {} void _kern_write_fs_info() {} @@ -1681,6 +1384,7 @@ void _nl_C_LC_CTYPE_width() {} void _nl_C_codeset() {} void _nl_C_name() {} void _nl_POSIX_name() {} +void _nl_current_locale() {} void _nl_postload_ctype() {} void _obstack_allocated_p() {} void _obstack_begin() {} @@ -1715,6 +1419,7 @@ void acosl() {} void acquire_sem() {} void acquire_sem_etc() {} void alarm() {} +void aligned_alloc() {} void alphasort() {} void area_for() {} void asctime() {} @@ -1789,6 +1494,9 @@ void catanh() {} void catanhf() {} void catanhl() {} void catanl() {} +void catclose() {} +void catgets() {} +void catopen() {} void cbrt() {} void cbrtf() {} void cbrtl() {} @@ -1895,6 +1603,7 @@ void debug_thread() {} void debug_vprintf() {} void debugger() {} void delete_area() {} +void delete_driver_settings() {} void delete_port() {} void delete_sem() {} void dev_for_path() {} @@ -1908,19 +1617,21 @@ void dlclose() {} void dlerror() {} void dlopen() {} void dlsym() {} +void dprintf() {} void drand48() {} void drand48_r() {} void drem() {} void dremf() {} -void dreml() {} void dup() {} void dup2() {} +void duplocale() {} void ecvt() {} void ecvt_r() {} void encrypt() {} void endgrent() {} void endpwent() {} void endspent() {} +void endutxent() {} void erand48() {} void erand48_r() {} void erf() {} @@ -1955,7 +1666,6 @@ void fabs() {} void fabsf() {} void fabsl() {} void faccessat() {} -void fastiroot() {} void fchdir() {} void fchmod() {} void fchmodat() {} @@ -1974,16 +1684,13 @@ void fdopendir() {} void fedisableexcept() {} void feenableexcept() {} void fegetenv() {} -void fegetround() {} void feholdexcept() {} void feof() {} void feof_unlocked() {} void feraiseexcept() {} void ferror() {} void ferror_unlocked() {} -void fesetenv() {} void fesetexceptflag() {} -void fesetround() {} void feupdateenv() {} void fflush() {} void fflush_unlocked() {} @@ -2048,6 +1755,7 @@ void fputws_unlocked() {} void fread() {} void fread_unlocked() {} void free() {} +void freelocale() {} void freopen() {} void frexp() {} void frexpf() {} @@ -2092,14 +1800,6 @@ void ftime() {} void ftok() {} void ftruncate() {} void ftrylockfile() {} -void fts_children() {} -void fts_close() {} -void fts_get_clientptr() {} -void fts_get_stream() {} -void fts_open() {} -void fts_read() {} -void fts_set() {} -void fts_set_clientptr() {} void ftw() {} void funlockfile() {} void futimens() {} @@ -2108,9 +1808,6 @@ void fwprintf() {} void fwrite() {} void fwrite_unlocked() {} void fwscanf() {} -void gamma() {} -void gammaf() {} -void gammal() {} void gcvt() {} void get_architecture() {} void get_architectures() {} @@ -2175,7 +1872,6 @@ void getpwnam_r() {} void getpwuid() {} void getpwuid_r() {} void getrlimit() {} -void getrusage() {} void gets() {} void getsid() {} void getspent() {} @@ -2185,6 +1881,9 @@ void getspnam_r() {} void getsubopt() {} void gettimeofday() {} void getuid() {} +void getutxent() {} +void getutxid() {} +void getutxline() {} void getw() {} void getwc() {} void getwc_unlocked() {} @@ -2224,47 +1923,69 @@ void ioctl() {} void is_computer_on() {} void is_computer_on_fire() {} void isalnum() {} +void isalnum_l() {} void isalpha() {} +void isalpha_l() {} void isascii() {} void isatty() {} void isblank() {} +void isblank_l() {} void iscntrl() {} +void iscntrl_l() {} void isdigit() {} +void isdigit_l() {} void isgraph() {} +void isgraph_l() {} void isinf() {} void isinff() {} void isinfl() {} void islower() {} +void islower_l() {} void isnan() {} void isnanf() {} void isnanl() {} void isprint() {} +void isprint_l() {} void ispunct() {} +void ispunct_l() {} void isspace() {} +void isspace_l() {} void isupper() {} +void isupper_l() {} void iswalnum() {} +void iswalnum_l() {} void iswalpha() {} +void iswalpha_l() {} void iswblank() {} +void iswblank_l() {} void iswcntrl() {} +void iswcntrl_l() {} void iswctype() {} +void iswctype_l() {} void iswdigit() {} +void iswdigit_l() {} void iswgraph() {} +void iswgraph_l() {} void iswlower() {} +void iswlower_l() {} void iswprint() {} +void iswprint_l() {} void iswpunct() {} +void iswpunct_l() {} void iswspace() {} +void iswspace_l() {} void iswupper() {} +void iswupper_l() {} void iswxdigit() {} +void iswxdigit_l() {} void isxdigit() {} +void isxdigit_l() {} void j0() {} void j0f() {} -void j0l() {} void j1() {} void j1f() {} -void j1l() {} void jn() {} void jnf() {} -void jnl() {} void jrand48() {} void jrand48_r() {} void kill() {} @@ -2304,6 +2025,7 @@ void load_driver_settings() {} void load_driver_settings_file() {} void load_image() {} void localeconv() {} +void localeconv_l() {} void localtime() {} void localtime_r() {} void lockf() {} @@ -2338,7 +2060,6 @@ void lseek() {} void madvise() {} void malloc() {} void malloc_usable_size() {} -void matherr() {} void mblen() {} void mbrlen() {} void mbrtowc() {} @@ -2367,6 +2088,7 @@ void mkstemp() {} void mkstemps() {} void mktemp() {} void mktime() {} +void mlock() {} void mmap() {} void modf() {} void modff() {} @@ -2380,6 +2102,7 @@ void msgrcv() {} void msgsnd() {} void mstats() {} void msync() {} +void munlock() {} void munmap() {} void nan() {} void nanf() {} @@ -2388,6 +2111,7 @@ void nanosleep() {} void nearbyint() {} void nearbyintf() {} void nearbyintl() {} +void newlocale() {} void next_dev() {} void nextafter() {} void nextafterf() {} @@ -2398,6 +2122,7 @@ void nexttowardl() {} void nftw() {} void nice() {} void nl_langinfo() {} +void nl_langinfo_l() {} void nrand48() {} void nrand48_r() {} void obstack_free() {} @@ -2451,6 +2176,7 @@ void pow10f() {} void pow10l() {} void powf() {} void powl() {} +void ppoll() {} void pread() {} void printf() {} void printf_size() {} @@ -2482,6 +2208,7 @@ void pthread_barrierattr_init() {} void pthread_barrierattr_setpshared() {} void pthread_cancel() {} void pthread_cond_broadcast() {} +void pthread_cond_clockwait() {} void pthread_cond_destroy() {} void pthread_cond_init() {} void pthread_cond_signal() {} @@ -2505,6 +2232,7 @@ void pthread_join() {} void pthread_key_create() {} void pthread_key_delete() {} void pthread_kill() {} +void pthread_mutex_clocklock() {} void pthread_mutex_destroy() {} void pthread_mutex_getprioceiling() {} void pthread_mutex_init() {} @@ -2524,6 +2252,8 @@ void pthread_mutexattr_setprotocol() {} void pthread_mutexattr_setpshared() {} void pthread_mutexattr_settype() {} void pthread_once() {} +void pthread_rwlock_clockrdlock() {} +void pthread_rwlock_clockwrlock() {} void pthread_rwlock_destroy() {} void pthread_rwlock_init() {} void pthread_rwlock_rdlock() {} @@ -2556,6 +2286,7 @@ void putchar() {} void putchar_unlocked() {} void putenv() {} void puts() {} +void pututxline() {} void putw() {} void putwc() {} void putwc_unlocked() {} @@ -2628,7 +2359,6 @@ void roundl() {} void sbrk() {} void scalb() {} void scalbf() {} -void scalbl() {} void scalbln() {} void scalblnf() {} void scalblnl() {} @@ -2644,6 +2374,7 @@ void seed48() {} void seed48_r() {} void seekdir() {} void select() {} +void sem_clockwait() {} void sem_close() {} void sem_destroy() {} void sem_getvalue() {} @@ -2670,7 +2401,6 @@ void set_scheduler_mode() {} void set_sem_owner() {} void set_signal_stack() {} void set_thread_priority() {} -void set_timezone() {} void setbuf() {} void setbuffer() {} void setegid() {} @@ -2700,6 +2430,7 @@ void setspent() {} void setstate() {} void setstate_r() {} void setuid() {} +void setutxent() {} void setvbuf() {} void sgetspent() {} void sgetspent_r() {} @@ -2707,9 +2438,9 @@ void shm_open() {} void shm_unlink() {} void sigaltstack() {} void siglongjmp() {} +void signgam() {} void significand() {} void significandf() {} -void significandl() {} void sigqueue() {} void sigsetjmp() {} void sigtimedwait() {} @@ -2739,31 +2470,35 @@ void srand48() {} void srand48_r() {} void srandom() {} void srandom_r() {} -void __stack_chk_fail() {} -void __stack_chk_fail_local() {} void sscanf() {} void statvfs() {} void stime() {} void stpcpy() {} void strcasecmp() {} +void strcasecmp_l() {} void strcasestr() {} void strcat() {} void strchr() {} void strchrnul() {} void strcmp() {} void strcoll() {} +void strcoll_l() {} void strcpy() {} void strcspn() {} void strdup() {} void strerror() {} +void strerror_l() {} void strerror_r() {} void strfmon() {} +void strfmon_l() {} void strftime() {} +void strftime_l() {} void strlcat() {} void strlcpy() {} void strlen() {} void strlwr() {} void strncasecmp() {} +void strncasecmp_l() {} void strncat() {} void strncmp() {} void strncpy() {} @@ -2788,6 +2523,7 @@ void strtoull() {} void strtoumax() {} void strupr() {} void strxfrm() {} +void strxfrm_l() {} void suggest_thread_priority() {} void suspend_thread() {} void swab() {} @@ -2813,9 +2549,11 @@ void tcflow() {} void tcflush() {} void tcgetattr() {} void tcgetpgrp() {} +void tcgetsid() {} void tcsendbreak() {} void tcsetattr() {} void tcsetpgrp() {} +void tcsetsid() {} void tdelete() {} void tdestroy() {} void telldir() {} @@ -2825,6 +2563,14 @@ void tfind() {} void tgamma() {} void tgammaf() {} void tgammal() {} +void thrd_create() {} +void thrd_current() {} +void thrd_detach() {} +void thrd_equal() {} +void thrd_exit() {} +void thrd_join() {} +void thrd_sleep() {} +void thrd_yield() {} void time() {} void timegm() {} void timer_create() {} @@ -2832,6 +2578,7 @@ void timer_delete() {} void timer_getoverrun() {} void timer_gettime() {} void timer_settime() {} +void timespec_get() {} void tls_address() {} void tls_allocate() {} void tls_get() {} @@ -2841,10 +2588,15 @@ void tmpnam() {} void tmpnam_r() {} void toascii() {} void tolower() {} +void tolower_l() {} void toupper() {} +void toupper_l() {} void towctrans() {} +void towctrans_l() {} void towlower() {} +void towlower_l() {} void towupper() {} +void towupper_l() {} void trunc() {} void truncate() {} void truncf() {} @@ -2867,6 +2619,7 @@ void unload_add_on() {} void unload_driver_settings() {} void unlockpt() {} void unsetenv() {} +void uselocale() {} void usleep() {} void utime() {} void utimensat() {} @@ -2901,11 +2654,13 @@ void wcpcpy() {} void wcpncpy() {} void wcrtomb() {} void wcscasecmp() {} +void wcscasecmp_l() {} void wcscat() {} void wcschr() {} void wcschrnul() {} void wcscmp() {} void wcscoll() {} +void wcscoll_l() {} void wcscpy() {} void wcscspn() {} void wcsdup() {} @@ -2914,6 +2669,7 @@ void wcslcat() {} void wcslcpy() {} void wcslen() {} void wcsncasecmp() {} +void wcsncasecmp_l() {} void wcsncat() {} void wcsncmp() {} void wcsncpy() {} @@ -2938,10 +2694,13 @@ void wcstouq() {} void wcswcs() {} void wcswidth() {} void wcsxfrm() {} +void wcsxfrm_l() {} void wctob() {} void wctomb() {} void wctrans() {} +void wctrans_l() {} void wctype() {} +void wctype_l() {} void wcwidth() {} void wmemchr() {} void wmemcmp() {} @@ -2959,13 +2718,10 @@ void writev_pos() {} void wscanf() {} void y0() {} void y0f() {} -void y0l() {} void y1() {} void y1f() {} -void y1l() {} void yn() {} void ynf() {} -void ynl() {} #include @@ -2975,6 +2731,8 @@ DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory", "find_directory@@", "1_ DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory_alpha4", "find_directory@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_fstat_current", "fstat@@", "1_ALPHA1"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_fstat_beos", "fstat@", "BASE"); +DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_getrusage_current", "getrusage@@", "1_BETA3"); +DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_getrusage_base", "getrusage@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_lstat_current", "lstat@@", "1_ALPHA1"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_lstat_beos", "lstat@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__pselect", "pselect@@", "1_ALPHA4"); diff --git a/src/system/libroot/stubbed/libroot_stubs_legacy.c b/src/system/libroot/stubbed/libroot_stubs_legacy.c index ec0ad5d566..373b3b7437 100644 --- a/src/system/libroot/stubbed/libroot_stubs_legacy.c +++ b/src/system/libroot/stubbed/libroot_stubs_legacy.c @@ -17,6 +17,7 @@ int __ctype_mb_cur_max; int __ctype_tolower; int __ctype_toupper; int __gABIVersion; +int __gAPIVersion; int __gCPUCount; int __gCommPageAddress; int __gRuntimeLoader; @@ -34,6 +35,8 @@ int __printf_arginfo_table; int __printf_function_table; int __progname; int __shtab; +int __signgam; +int __stack_chk_guard; int __terminate_func; int __ti10bad_typeid; int __ti13bad_exception; @@ -81,11 +84,7 @@ int _nl_C_LC_MONETARY; int _nl_C_LC_NUMERIC; int _nl_C_LC_TIME; int _nl_C_locobj; -int _nl_current_LC_COLLATE; -int _nl_current_LC_CTYPE; -int _nl_current_LC_MESSAGES; -int _nl_current_LC_MONETARY; -int _nl_current_LC_NUMERIC; +int _nl_global_locale; int _obstack; int _rtDebugFlag; int _single_threaded; @@ -105,7 +104,6 @@ int opterr; int optind; int optopt; int re_syntax_options; -int signgam; int stderr; int stdin; int stdout; @@ -120,10 +118,15 @@ void AddElements__Q28BPrivate13KMessageFieldPCvll() {} void AddField__Q28BPrivate8KMessagePCcUllPQ28BPrivate13KMessageField() {} void AdoptUnit__14parsed_elementRC16known_identifier() {} void Adopt__14parsed_elementRC16known_identifier() {} +void ApplyToCurrentThread__Q38BPrivate7Libroot16LocaleDataBridge() {} +void ApplyToCurrentThread__Q38BPrivate7Libroot21LocaleCtypeDataBridge() {} +void ApplyToCurrentThread__Q38BPrivate7Libroot23LocaleNumericDataBridge() {} void BufferCapacity__CQ28BPrivate8KMessage() {} void Buffer__CQ28BPrivate8KMessage() {} void ContentSize__CQ28BPrivate8KMessage() {} void CountElements__CQ28BPrivate13KMessageField() {} +void CreateBackend__Q38BPrivate7Libroot13LocaleBackend() {} +void DestroyBackend__Q38BPrivate7Libroot13LocaleBackendPQ38BPrivate7Libroot13LocaleBackend() {} void Digest__Q28BPrivate6SHA256() {} void Dump__CQ28BPrivate8KMessagePFPCce_v() {} void ElementAt__CQ28BPrivate13KMessageFieldlPl() {} @@ -135,6 +138,10 @@ void FindField__CQ28BPrivate8KMessagePCcUlPQ28BPrivate13KMessageField() {} void FindInt32__CQ28BPrivate8KMessagePCclPl() {} void FindString__CQ28BPrivate8KMessagePCclPPCc() {} void Flag__C8DateMaskUc() {} +void GetCurrentLocaleBackend__Q28BPrivate7Librootv() {} +void GetCurrentLocaleInfo__Q28BPrivate7Librootv() {} +void GetCurrentThreadLocale__Q28BPrivate7Librootv() {} +void GetLocalesFromEnvironment__Q28BPrivate7LibrootiPPCc() {} void GetNextField__CQ28BPrivate8KMessagePQ28BPrivate13KMessageField() {} void HMAC_SHA256_Final__FPUcP15HMAC_SHA256_CTX() {} void HMAC_SHA256_Init__FP15HMAC_SHA256_CTXPCvUl() {} @@ -159,10 +166,10 @@ void SendTo__Q28BPrivate8KMessagellPQ28BPrivate8KMessagexxl() {} void SendTo__Q28BPrivate8KMessagellllxl() {} void Sender__CQ28BPrivate8KMessage() {} void SetCharType__14parsed_elementUcSc() {} +void SetCurrentLocaleInfo__Q28BPrivate7LibrootPQ38BPrivate7Libroot17LocaleBackendData() {} void SetData__Q28BPrivate8KMessagePCcUlPCvl() {} void SetDeliveryInfo__Q28BPrivate8KMessagellll() {} void SetTo__Q28BPrivate13KMessageFieldPQ28BPrivate8KMessagel() {} -void SetTo__Q28BPrivate20FileDescriptorCloseri() {} void SetTo__Q28BPrivate8KMessagePCvlUl() {} void SetTo__Q28BPrivate8KMessagePvlUlUl() {} void SetTo__Q28BPrivate8KMessageUlUl() {} @@ -385,7 +392,7 @@ void _Init__17EnvironmentFilteriPCcUlPCPCcUl() {} void _LastFieldHeader__CQ28BPrivate8KMessage() {} void _ProcessChunk__Q28BPrivate6SHA256() {} void _Unblock__11LocalRWLock() {} -void _Wait__11LocalRWLockbx() {} +void _Wait__11LocalRWLockbUlx() {} void __10bad_typeid() {} void __13bad_exception() {} void __14__si_type_infoPCcRC16__user_type_info() {} @@ -403,19 +410,13 @@ void __Q28BPrivate8KMessage() {} void __Q28BPrivate8KMessageUl() {} void __Q28BPrivate9hoardHeap() {} void __Q38BPrivate7Libroot13LocaleBackend() {} -void __Q38BPrivate7Libroot16LocaleDataBridge() {} +void __Q38BPrivate7Libroot16LocaleDataBridgeb() {} void __Q38BPrivate7Libroot20LocaleTimeDataBridge() {} -void __Q38BPrivate7Libroot21LocaleCtypeDataBridge() {} -void __Q38BPrivate7Libroot23LocaleNumericDataBridge() {} +void __Q38BPrivate7Libroot21LocaleCtypeDataBridgeb() {} +void __Q38BPrivate7Libroot23LocaleNumericDataBridgeb() {} void __Q38BPrivate7Libroot24LocaleMessagesDataBridge() {} void __Q38BPrivate7Libroot24LocaleMonetaryDataBridge() {} -void __Q38BPrivate7Libroot24TimeConversionDataBridge() {} -void __acos() {} -void __acosf() {} -void __acosh() {} -void __acoshf() {} -void __acoshl() {} -void __acosl() {} +void __Q38BPrivate7Libroot24TimeConversionDataBridgeb() {} void __adjust_heap__H3ZPQ217EnvironmentFilter5EntryZlZQ217EnvironmentFilter5Entry_X01X11X11X21_v() {} void __allocate_pthread() {} void __arch_get_stack_trace() {} @@ -423,24 +424,9 @@ void __arch_get_system_time_offset() {} void __arch_init_time() {} void __ashldi3() {} void __ashrdi3() {} -void __asin() {} -void __asinf() {} -void __asinh() {} -void __asinhf() {} -void __asinhl() {} -void __asinl() {} void __asprintf() {} void __assert_fail() {} void __assert_perror_fail() {} -void __atan() {} -void __atan2() {} -void __atan2f() {} -void __atan2l() {} -void __atanf() {} -void __atanh() {} -void __atanhf() {} -void __atanhl() {} -void __atanl() {} void __bb_exit_func() {} void __bb_init_func() {} void __bb_init_trace_func() {} @@ -476,18 +462,12 @@ void __catanh() {} void __catanhf() {} void __catanhl() {} void __catanl() {} -void __cbrt() {} -void __cbrtf() {} -void __cbrtl() {} void __ccos() {} void __ccosf() {} void __ccosh() {} void __ccoshf() {} void __ccoshl() {} void __ccosl() {} -void __ceil() {} -void __ceilf() {} -void __ceill() {} void __cexp() {} void __cexpf() {} void __cexpl() {} @@ -510,15 +490,6 @@ void __collseq_table_lookup() {} void __conj() {} void __conjf() {} void __conjl() {} -void __copysign() {} -void __copysignf() {} -void __copysignl() {} -void __cos() {} -void __cosf() {} -void __cosh() {} -void __coshf() {} -void __coshl() {} -void __cosl() {} void __cp_eh_info() {} void __cp_exception_info() {} void __cp_pop_exception() {} @@ -549,7 +520,10 @@ void __ctanh() {} void __ctanhf() {} void __ctanhl() {} void __ctanl() {} +void __ctype_b_loc() {} void __ctype_get_mb_cur_max() {} +void __ctype_tolower_loc() {} +void __ctype_toupper_loc() {} void __cxa_atexit() {} void __cxa_finalize() {} void __default_terminate() {} @@ -559,9 +533,6 @@ void __deregister_frame_info() {} void __divdi3() {} void __dl__FPvRC9nothrow_t() {} void __drand48_iterate() {} -void __drem() {} -void __dremf() {} -void __dreml() {} void __dummy() {} void __dynamic_cast() {} void __eh_alloc() {} @@ -571,35 +542,10 @@ void __empty() {} void __eprintf() {} void __eq__C9type_infoRC9type_info() {} void __erand48_r() {} -void __erf() {} -void __erfc() {} -void __erfcf() {} -void __erfcl() {} -void __erff() {} -void __erfl() {} -void __exp() {} -void __exp10() {} -void __exp10f() {} -void __exp10l() {} -void __exp2() {} -void __exp2f() {} -void __exp2l() {} -void __expf() {} -void __expl() {} -void __expm1() {} -void __expm1f() {} -void __expm1l() {} -void __fabs() {} -void __fabsf() {} -void __fabsl() {} void __fcloseall() {} -void __fdim() {} -void __fdimf() {} -void __fdiml() {} void __fe_dfl_env() {} void __fedisableexcept() {} void __feenableexcept() {} -void __feraiseexcept() {} void __ffsdi2() {} void __final_insertion_sort__H1ZPQ217EnvironmentFilter5Entry_X01X01_v() {} void __find_directory() {} @@ -626,21 +572,6 @@ void __flatten_process_args() {} void __floatdidf() {} void __floatdisf() {} void __floatdixf() {} -void __floor() {} -void __floorf() {} -void __floorl() {} -void __fma() {} -void __fmaf() {} -void __fmal() {} -void __fmax() {} -void __fmaxf() {} -void __fmaxl() {} -void __fmin() {} -void __fminf() {} -void __fminl() {} -void __fmod() {} -void __fmodf() {} -void __fmodl() {} void __fopen_internal() {} void __fopen_maybe_mmap() {} void __fpclassify() {} @@ -649,22 +580,8 @@ void __fpclassifyl() {} void __fpurge() {} void __frame_state_for() {} void __freading() {} -void __frexp() {} -void __frexpf() {} -void __frexpl() {} void __fsetlocking() {} -void __fts_children() {} -void __fts_close() {} -void __fts_get_clientptr() {} -void __fts_get_stream() {} -void __fts_open() {} -void __fts_read() {} -void __fts_set() {} -void __fts_set_clientptr() {} void __fwprintf() {} -void __gamma() {} -void __gammaf() {} -void __gammal() {} void __gcc_bcmp() {} void __gconv_get_builtin_trans() {} void __gconv_transform_ascii_internal() {} @@ -689,6 +606,7 @@ void __get_scheduler_mode() {} void __get_secondary_architectures() {} void __get_system_info() {} void __get_system_time_offset() {} +void __get_time_locale() {} void __getc_unlocked() {} void __getdelim() {} void __getenv_reentrant() {} @@ -698,95 +616,12 @@ void __gmtime_r_fallback() {} void __guess_architecture_for_path() {} void __guess_grouping() {} void __guess_secondary_architecture_from_path() {} -void __hdestroy() {} void __heap_after_fork_child() {} void __heap_after_fork_parent() {} void __heap_before_fork() {} void __heap_terminate_after() {} void __heap_thread_exit() {} void __heap_thread_init() {} -void __hypot() {} -void __hypotf() {} -void __hypotl() {} -void __ieee754_acos() {} -void __ieee754_acosf() {} -void __ieee754_acosh() {} -void __ieee754_acoshf() {} -void __ieee754_acoshl() {} -void __ieee754_acosl() {} -void __ieee754_asin() {} -void __ieee754_asinf() {} -void __ieee754_asinl() {} -void __ieee754_atan2() {} -void __ieee754_atan2f() {} -void __ieee754_atan2l() {} -void __ieee754_atanh() {} -void __ieee754_atanhf() {} -void __ieee754_atanhl() {} -void __ieee754_cosh() {} -void __ieee754_coshf() {} -void __ieee754_coshl() {} -void __ieee754_exp() {} -void __ieee754_exp10() {} -void __ieee754_exp10f() {} -void __ieee754_exp10l() {} -void __ieee754_exp2() {} -void __ieee754_exp2f() {} -void __ieee754_exp2l() {} -void __ieee754_expf() {} -void __ieee754_expl() {} -void __ieee754_fmod() {} -void __ieee754_fmodf() {} -void __ieee754_fmodl() {} -void __ieee754_gamma_r() {} -void __ieee754_gammaf_r() {} -void __ieee754_gammal_r() {} -void __ieee754_hypot() {} -void __ieee754_hypotf() {} -void __ieee754_hypotl() {} -void __ieee754_ilogbl() {} -void __ieee754_j0() {} -void __ieee754_j0f() {} -void __ieee754_j1() {} -void __ieee754_j1f() {} -void __ieee754_jn() {} -void __ieee754_jnf() {} -void __ieee754_lgamma_r() {} -void __ieee754_lgammaf_r() {} -void __ieee754_lgammal_r() {} -void __ieee754_log() {} -void __ieee754_log10() {} -void __ieee754_log10f() {} -void __ieee754_log10l() {} -void __ieee754_log2() {} -void __ieee754_log2f() {} -void __ieee754_log2l() {} -void __ieee754_logf() {} -void __ieee754_logl() {} -void __ieee754_pow() {} -void __ieee754_powf() {} -void __ieee754_powl() {} -void __ieee754_remainder() {} -void __ieee754_remainderf() {} -void __ieee754_remainderl() {} -void __ieee754_scalb() {} -void __ieee754_scalbf() {} -void __ieee754_scalbl() {} -void __ieee754_sinh() {} -void __ieee754_sinhf() {} -void __ieee754_sinhl() {} -void __ieee754_sqrt() {} -void __ieee754_sqrtf() {} -void __ieee754_sqrtl() {} -void __ieee754_y0() {} -void __ieee754_y0f() {} -void __ieee754_y1() {} -void __ieee754_y1f() {} -void __ieee754_yn() {} -void __ieee754_ynf() {} -void __ilogb() {} -void __ilogbf() {} -void __ilogbl() {} void __init_after_fork__Fv() {} void __init_env() {} void __init_env_post_heap() {} @@ -794,10 +629,12 @@ void __init_heap() {} void __init_once() {} void __init_pthread() {} void __init_pwd_backend() {} +void __init_stack_protector() {} void __init_time() {} void __initstate_r() {} void __insertion_sort__H1ZPQ217EnvironmentFilter5Entry_X01X01_v() {} void __introsort_loop__H3ZPQ217EnvironmentFilter5EntryZQ217EnvironmentFilter5EntryZl_X01X01PX11X21_v() {} +void __ioctl() {} void __is_pointer__FPv() {} void __isinf() {} void __isinff() {} @@ -809,56 +646,18 @@ void __jrand48_r() {} void __kernel_casinh() {} void __kernel_casinhf() {} void __kernel_casinhl() {} -void __kernel_cosf() {} -void __kernel_sinf() {} -void __kernel_tan() {} -void __kernel_tanf() {} void __lcong48_r() {} -void __ldexp() {} -void __ldexpf() {} -void __ldexpl() {} void __lexicographical_compare_3way__H2ZPCScZPCSc_X01X01X11X11_i() {} -void __lgamma() {} -void __lgamma_r() {} -void __lgammaf() {} -void __lgammaf_r() {} -void __lgammal() {} void __lgammal_r() {} void __libc_dlclose() {} void __libc_dlopen() {} void __libc_dlsym() {} void __libc_use_alloca() {} -void __llrint() {} -void __llrintf() {} -void __llrintl() {} -void __llround() {} -void __llroundf() {} -void __llroundl() {} -void __log() {} -void __log10() {} -void __log10f() {} -void __log10l() {} -void __log1p() {} -void __log1pf() {} -void __log1pl() {} -void __log2() {} -void __log2f() {} -void __log2l() {} -void __logb() {} -void __logbf() {} -void __logbl() {} -void __logf() {} -void __logl() {} +void __load_image_at_path() {} void __longjmp_return() {} -void __lrint() {} -void __lrintf() {} -void __lrintl() {} -void __lround() {} -void __lroundf() {} -void __lroundl() {} +void __look_up_in_path() {} void __lshrdi3() {} void __make_heap__H3ZPQ217EnvironmentFilter5EntryZQ217EnvironmentFilter5EntryZl_X01X01PX11PX21_v() {} -void __matherr() {} void __mblen() {} void __mbrlen() {} void __mbrtowc() {} @@ -870,9 +669,6 @@ void __mbtowc() {} void __memrchr() {} void __mktime_fallback() {} void __moddi3() {} -void __modf() {} -void __modff() {} -void __modfl() {} void __mpn_add() {} void __mpn_add_1() {} void __mpn_add_n() {} @@ -903,13 +699,7 @@ void __mutex_init() {} void __mutex_init_etc() {} void __mutex_lock() {} void __mutex_unlock() {} -void __nan() {} -void __nanf() {} -void __nanl() {} void __ne__C9type_infoRC9type_info() {} -void __nearbyint() {} -void __nearbyintf() {} -void __nearbyintl() {} void __negdi2() {} void __new_fclose() {} void __new_fdopen() {} @@ -919,12 +709,6 @@ void __new_fsetpos() {} void __new_pclose() {} void __new_popen() {} void __new_tmpfile() {} -void __nextafter() {} -void __nextafterf() {} -void __nextafterl() {} -void __nexttoward() {} -void __nexttowardf() {} -void __nexttowardl() {} void __nrand48_r() {} void __nw__FUlPv() {} void __nw__FUlRC9nothrow_t() {} @@ -932,22 +716,19 @@ void __overflow() {} void __parse_invoke_line() {} void __partial_sort__H2ZPQ217EnvironmentFilter5EntryZQ217EnvironmentFilter5Entry_X01X01X01PX11_v() {} void __path_search() {} -void __pow() {} -void __pow10() {} -void __pow10f() {} -void __pow10l() {} -void __powf() {} -void __powl() {} +void __ppoll() {} void __printf_fp() {} void __printf_fphex() {} void __pselect() {} void __pselect_beos() {} +void __pthread_attr_get_np() {} void __pthread_cleanup_pop_handler() {} void __pthread_cleanup_push_handler() {} void __pthread_destroy_thread() {} void __pthread_getattr_np() {} void __pthread_init_creation_attributes() {} void __pthread_key_call_destructors() {} +void __pthread_mutex_lock__FP14_pthread_mutexUlx() {} void __pthread_set_default_priority() {} void __pthread_sigmask() {} void __pthread_sigmask_beos() {} @@ -969,19 +750,7 @@ void __register_frame_info_table() {} void __register_frame_table() {} void __register_printf_function() {} void __reinit_pwd_backend_after_fork() {} -void __remainder() {} -void __remainderf() {} -void __remainderl() {} -void __remquo() {} -void __remquof() {} -void __remquol() {} void __rethrow() {} -void __rint() {} -void __rintf() {} -void __rintl() {} -void __round() {} -void __roundf() {} -void __roundl() {} void __rtti_array() {} void __rtti_attr() {} void __rtti_class() {} @@ -998,15 +767,6 @@ void __rw_lock_read_lock() {} void __rw_lock_read_unlock() {} void __rw_lock_write_lock() {} void __rw_lock_write_unlock() {} -void __scalb() {} -void __scalbf() {} -void __scalbl() {} -void __scalbln() {} -void __scalblnf() {} -void __scalblnl() {} -void __scalbn() {} -void __scalbnf() {} -void __scalbnl() {} void __seed48_r() {} void __set_scheduler_mode() {} void __set_stack_protection() {} @@ -1037,8 +797,6 @@ void __signal_get_sigrtmin() {} void __signbit() {} void __signbitf() {} void __signbitl() {} -void __significand() {} -void __significandf() {} void __sigpause() {} void __sigpause_beos() {} void __sigpending() {} @@ -1054,23 +812,12 @@ void __sigsuspend() {} void __sigsuspend_beos() {} void __sigwait() {} void __sigwait_beos() {} -void __sin() {} -void __sincos() {} -void __sincosf() {} -void __sincosl() {} -void __sinf() {} -void __sinh() {} -void __sinhf() {} -void __sinhl() {} -void __sinl() {} void __sjpopnthrow() {} void __sjthrow() {} void __snprintf() {} -void __sqrt() {} -void __sqrtf() {} -void __sqrtl() {} void __srand48_r() {} void __srandom_r() {} +void __stack_chk_fail() {} void __start_cp_handler() {} void __start_watching_system() {} void __stop_watching_system() {} @@ -1088,14 +835,6 @@ void __swap_int32() {} void __swap_int64() {} void __sysconf() {} void __sysconf_beos() {} -void __tan() {} -void __tanf() {} -void __tanh() {} -void __tanhf() {} -void __tanhl() {} -void __tanl() {} -void __tdelete() {} -void __tdestroy() {} void __tens() {} void __terminate() {} void __test_executable() {} @@ -1128,28 +867,21 @@ void __tfc() {} void __tfd() {} void __tff() {} void __tfi() {} -void __tfind() {} void __tfl() {} void __tfr() {} void __tfs() {} void __tfv() {} void __tfw() {} void __tfx() {} -void __tgamma() {} -void __tgammaf() {} -void __tgammal() {} void __throw() {} void __throw_bad_cast() {} void __throw_bad_typeid() {} void __throw_type_match() {} void __throw_type_match_rtti() {} +void __timegm_fallback() {} void __times() {} void __times_beos() {} -void __trunc() {} -void __truncf() {} -void __truncl() {} -void __tsearch() {} -void __twalk() {} +void __tsearch_balance() {} void __ucmpdi2() {} void __udiv_w_sdiv() {} void __udivdi3() {} @@ -1175,11 +907,13 @@ void __wcpcpy() {} void __wcpncpy() {} void __wcrtomb() {} void __wcscasecmp() {} +void __wcscasecmp_l() {} void __wcscat() {} void __wcschr() {} void __wcschrnul() {} void __wcscmp() {} void __wcscoll() {} +void __wcscoll_l() {} void __wcscpy() {} void __wcscspn() {} void __wcsdup() {} @@ -1188,6 +922,7 @@ void __wcslcpy() {} void __wcslen() {} void __wcsmbs_clone_conv() {} void __wcsncasecmp() {} +void __wcsncasecmp_l() {} void __wcsncat() {} void __wcsncmp() {} void __wcsncpy() {} @@ -1209,6 +944,7 @@ void __wcstoul_internal() {} void __wcstoull_internal() {} void __wcswidth() {} void __wcsxfrm() {} +void __wcsxfrm_l() {} void __wctob() {} void __wctomb() {} void __wmemchr() {} @@ -1235,6 +971,7 @@ void _fseek() {} void _fstat_beos() {} void _fstat_current() {} void _get_area_info() {} +void _get_cpu_info_etc() {} void _get_image_info() {} void _get_next_area_info() {} void _get_next_image_info() {} @@ -1250,6 +987,8 @@ void _get_team_info() {} void _get_team_usage_info() {} void _get_thread_info() {} void _getopt_internal() {} +void _getrusage_base() {} +void _getrusage_current() {} void _init() {} void _init_c_library_() {} void _itoa() {} @@ -1378,8 +1117,10 @@ void _kern_loading_app_failed() {} void _kern_lock_node() {} void _kern_map_file() {} void _kern_memory_advice() {} +void _kern_mlock() {} void _kern_mount() {} void _kern_move_partition() {} +void _kern_munlock() {} void _kern_mutex_lock() {} void _kern_mutex_sem_acquire() {} void _kern_mutex_sem_release() {} @@ -1399,6 +1140,7 @@ void _kern_open_query() {} void _kern_poll() {} void _kern_port_buffer_size_etc() {} void _kern_port_count() {} +void _kern_preallocate() {} void _kern_process_info() {} void _kern_read() {} void _kern_read_attr() {} @@ -1522,6 +1264,7 @@ void _kern_wait_for_debugger() {} void _kern_wait_for_objects() {} void _kern_wait_for_team() {} void _kern_wait_for_thread() {} +void _kern_wait_for_thread_etc() {} void _kern_write() {} void _kern_write_attr() {} void _kern_write_fs_info() {} @@ -1570,6 +1313,7 @@ void _nl_C_LC_CTYPE_width() {} void _nl_C_codeset() {} void _nl_C_name() {} void _nl_POSIX_name() {} +void _nl_current_locale() {} void _nl_postload_ctype() {} void _obstack_allocated_p() {} void _obstack_begin() {} @@ -1605,6 +1349,7 @@ void acquire_sem() {} void acquire_sem_etc() {} void alarm() {} void align__Q28BPrivate9hoardHeapUl() {} +void aligned_alloc() {} void alphasort() {} void area_for() {} void asctime() {} @@ -1680,6 +1425,9 @@ void catanh() {} void catanhf() {} void catanhl() {} void catanl() {} +void catclose() {} +void catgets() {} +void catopen() {} void cbrt() {} void cbrtf() {} void cbrtl() {} @@ -1798,6 +1546,7 @@ void debug_thread() {} void debug_vprintf() {} void debugger() {} void delete_area() {} +void delete_driver_settings() {} void delete_port() {} void delete_sem() {} void dev_for_path() {} @@ -1811,19 +1560,21 @@ void dlclose() {} void dlerror() {} void dlopen() {} void dlsym() {} +void dprintf() {} void drand48() {} void drand48_r() {} void drem() {} void dremf() {} -void dreml() {} void dup() {} void dup2() {} +void duplocale() {} void ecvt() {} void ecvt_r() {} void encrypt() {} void endgrent() {} void endpwent() {} void endspent() {} +void endutxent() {} void erand48() {} void erand48_r() {} void erf() {} @@ -1878,7 +1629,6 @@ void fdopendir() {} void fedisableexcept() {} void feenableexcept() {} void fegetenv() {} -void fegetround() {} void feholdexcept() {} void feof() {} void feof_unlocked() {} @@ -1886,7 +1636,6 @@ void feraiseexcept() {} void ferror() {} void ferror_unlocked() {} void fesetexceptflag() {} -void fesetround() {} void feupdateenv() {} void fflush() {} void fflush_unlocked() {} @@ -1953,6 +1702,7 @@ void fread_unlocked() {} void free() {} void freeBlock__Q28BPrivate9hoardHeapRPQ28BPrivate5blockRPQ28BPrivate10superblockiPQ28BPrivate11processHeap() {} void free__Q28BPrivate11processHeapPv() {} +void freelocale() {} void freopen() {} void frexp() {} void frexpf() {} @@ -1997,14 +1747,6 @@ void ftime() {} void ftok() {} void ftruncate() {} void ftrylockfile() {} -void fts_children() {} -void fts_close() {} -void fts_get_clientptr() {} -void fts_get_stream() {} -void fts_open() {} -void fts_read() {} -void fts_set() {} -void fts_set_clientptr() {} void ftw() {} void funlockfile() {} void futimens() {} @@ -2015,7 +1757,6 @@ void fwrite_unlocked() {} void fwscanf() {} void gamma() {} void gammaf() {} -void gammal() {} void gcvt() {} void getNumAvailable__Q28BPrivate10superblock() {} void getNumBlocks__Q28BPrivate10superblock() {} @@ -2088,7 +1829,6 @@ void getpwnam_r() {} void getpwuid() {} void getpwuid_r() {} void getrlimit() {} -void getrusage() {} void gets() {} void getsid() {} void getspent() {} @@ -2098,6 +1838,9 @@ void getspnam_r() {} void getsubopt() {} void gettimeofday() {} void getuid() {} +void getutxent() {} +void getutxid() {} +void getutxline() {} void getw() {} void getwc() {} void getwc_unlocked() {} @@ -2147,38 +1890,63 @@ void isValid__Q28BPrivate10superblock() {} void is_computer_on() {} void is_computer_on_fire() {} void isalnum() {} +void isalnum_l() {} void isalpha() {} +void isalpha_l() {} void isascii() {} void isatty() {} void isblank() {} +void isblank_l() {} void iscntrl() {} +void iscntrl_l() {} void isdigit() {} +void isdigit_l() {} void isgraph() {} +void isgraph_l() {} void isinf() {} void isinff() {} void isinfl() {} void islower() {} +void islower_l() {} void isnan() {} void isnanf() {} void isnanl() {} void isprint() {} +void isprint_l() {} void ispunct() {} +void ispunct_l() {} void isspace() {} +void isspace_l() {} void isupper() {} +void isupper_l() {} void iswalnum() {} +void iswalnum_l() {} void iswalpha() {} +void iswalpha_l() {} void iswblank() {} +void iswblank_l() {} void iswcntrl() {} +void iswcntrl_l() {} void iswctype() {} +void iswctype_l() {} void iswdigit() {} +void iswdigit_l() {} void iswgraph() {} +void iswgraph_l() {} void iswlower() {} +void iswlower_l() {} void iswprint() {} +void iswprint_l() {} void iswpunct() {} +void iswpunct_l() {} void iswspace() {} +void iswspace_l() {} void iswupper() {} +void iswupper_l() {} void iswxdigit() {} +void iswxdigit_l() {} void isxdigit() {} +void isxdigit_l() {} void j0() {} void j0f() {} void j1() {} @@ -2225,6 +1993,7 @@ void load_driver_settings() {} void load_driver_settings_file() {} void load_image() {} void localeconv() {} +void localeconv_l() {} void localtime() {} void localtime_r() {} void lockf() {} @@ -2261,7 +2030,6 @@ void makeSuperblock__Q28BPrivate10superblockiPQ28BPrivate11processHeap() {} void malloc() {} void malloc__Q28BPrivate10threadHeapUl() {} void malloc_usable_size() {} -void matherr() {} void mblen() {} void mbrlen() {} void mbrtowc() {} @@ -2290,6 +2058,7 @@ void mkstemp() {} void mkstemps() {} void mktemp() {} void mktime() {} +void mlock() {} void mmap() {} void modf() {} void modff() {} @@ -2305,6 +2074,7 @@ void msgrcv() {} void msgsnd() {} void mstats() {} void msync() {} +void munlock() {} void munmap() {} void name__C9type_info() {} void nan() {} @@ -2314,6 +2084,7 @@ void nanosleep() {} void nearbyint() {} void nearbyintf() {} void nearbyintl() {} +void newlocale() {} void next_dev() {} void nextafter() {} void nextafterf() {} @@ -2324,6 +2095,7 @@ void nexttowardl() {} void nftw() {} void nice() {} void nl_langinfo() {} +void nl_langinfo_l() {} void nothrow() {} void nrand48() {} void nrand48_r() {} @@ -2383,6 +2155,7 @@ void pow10f() {} void pow10l() {} void powf() {} void powl() {} +void ppoll() {} void pread() {} void printf() {} void printf_size() {} @@ -2414,6 +2187,7 @@ void pthread_barrierattr_init() {} void pthread_barrierattr_setpshared() {} void pthread_cancel() {} void pthread_cond_broadcast() {} +void pthread_cond_clockwait() {} void pthread_cond_destroy() {} void pthread_cond_init() {} void pthread_cond_signal() {} @@ -2437,6 +2211,7 @@ void pthread_join() {} void pthread_key_create() {} void pthread_key_delete() {} void pthread_kill() {} +void pthread_mutex_clocklock() {} void pthread_mutex_destroy() {} void pthread_mutex_getprioceiling() {} void pthread_mutex_init() {} @@ -2456,6 +2231,8 @@ void pthread_mutexattr_setprotocol() {} void pthread_mutexattr_setpshared() {} void pthread_mutexattr_settype() {} void pthread_once() {} +void pthread_rwlock_clockrdlock() {} +void pthread_rwlock_clockwrlock() {} void pthread_rwlock_destroy() {} void pthread_rwlock_init() {} void pthread_rwlock_rdlock() {} @@ -2488,6 +2265,7 @@ void putchar() {} void putchar_unlocked() {} void putenv() {} void puts() {} +void pututxline() {} void putw() {} void putwc() {} void putwc_unlocked() {} @@ -2563,7 +2341,6 @@ void roundl() {} void sbrk() {} void scalb() {} void scalbf() {} -void scalbl() {} void scalbln() {} void scalblnf() {} void scalblnl() {} @@ -2579,6 +2356,7 @@ void seed48() {} void seed48_r() {} void seekdir() {} void select() {} +void sem_clockwait() {} void sem_close() {} void sem_destroy() {} void sem_getvalue() {} @@ -2642,6 +2420,7 @@ void setspent() {} void setstate() {} void setstate_r() {} void setuid() {} +void setutxent() {} void setvbuf() {} void sgetspent() {} void sgetspent_r() {} @@ -2649,6 +2428,7 @@ void shm_open() {} void shm_unlink() {} void sigaltstack() {} void siglongjmp() {} +void signgam() {} void significand() {} void significandf() {} void sigqueue() {} @@ -2687,24 +2467,30 @@ void statvfs() {} void stime() {} void stpcpy() {} void strcasecmp() {} +void strcasecmp_l() {} void strcasestr() {} void strcat() {} void strchr() {} void strchrnul() {} void strcmp() {} void strcoll() {} +void strcoll_l() {} void strcpy() {} void strcspn() {} void strdup() {} void strerror() {} +void strerror_l() {} void strerror_r() {} void strfmon() {} +void strfmon_l() {} void strftime() {} +void strftime_l() {} void strlcat() {} void strlcpy() {} void strlen() {} void strlwr() {} void strncasecmp() {} +void strncasecmp_l() {} void strncat() {} void strncmp() {} void strncpy() {} @@ -2729,6 +2515,7 @@ void strtoull() {} void strtoumax() {} void strupr() {} void strxfrm() {} +void strxfrm_l() {} void suggest_thread_priority() {} void suspend_thread() {} void swab() {} @@ -2754,9 +2541,11 @@ void tcflow() {} void tcflush() {} void tcgetattr() {} void tcgetpgrp() {} +void tcgetsid() {} void tcsendbreak() {} void tcsetattr() {} void tcsetpgrp() {} +void tcsetsid() {} void tdelete() {} void tdestroy() {} void telldir() {} @@ -2774,6 +2563,7 @@ void timer_delete() {} void timer_getoverrun() {} void timer_gettime() {} void timer_settime() {} +void timespec_get() {} void tls_address() {} void tls_allocate() {} void tls_get() {} @@ -2783,10 +2573,15 @@ void tmpnam() {} void tmpnam_r() {} void toascii() {} void tolower() {} +void tolower_l() {} void toupper() {} +void toupper_l() {} void towctrans() {} +void towctrans_l() {} void towlower() {} +void towlower_l() {} void towupper() {} +void towupper_l() {} void trunc() {} void truncate() {} void truncf() {} @@ -2812,6 +2607,7 @@ void unload_driver_settings() {} void unlockpt() {} void unmount() {} void unsetenv() {} +void uselocale() {} void user_group_lock__8BPrivatev() {} void user_group_unlock__8BPrivatev() {} void usleep() {} @@ -2848,11 +2644,13 @@ void wcpcpy() {} void wcpncpy() {} void wcrtomb() {} void wcscasecmp() {} +void wcscasecmp_l() {} void wcscat() {} void wcschr() {} void wcschrnul() {} void wcscmp() {} void wcscoll() {} +void wcscoll_l() {} void wcscpy() {} void wcscspn() {} void wcsdup() {} @@ -2861,6 +2659,7 @@ void wcslcat() {} void wcslcpy() {} void wcslen() {} void wcsncasecmp() {} +void wcsncasecmp_l() {} void wcsncat() {} void wcsncmp() {} void wcsncpy() {} @@ -2885,10 +2684,13 @@ void wcstouq() {} void wcswcs() {} void wcswidth() {} void wcsxfrm() {} +void wcsxfrm_l() {} void wctob() {} void wctomb() {} void wctrans() {} +void wctrans_l() {} void wctype() {} +void wctype_l() {} void wcwidth() {} void what__C9bad_alloc() {} void what__C9exception() {} @@ -2921,6 +2723,8 @@ DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory", "find_directory@@", "1_ DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory_alpha4", "find_directory@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_fstat_current", "fstat@@", "1_ALPHA1"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_fstat_beos", "fstat@", "BASE"); +DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_getrusage_current", "getrusage@@", "1_BETA3"); +DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_getrusage_base", "getrusage@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_lstat_current", "lstat@@", "1_ALPHA1"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("_lstat_beos", "lstat@", "BASE"); DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__pselect", "pselect@@", "1_ALPHA4"); diff --git a/src/system/runtime_loader/Jamfile b/src/system/runtime_loader/Jamfile index 99b87e6614..372e9e3988 100644 --- a/src/system/runtime_loader/Jamfile +++ b/src/system/runtime_loader/Jamfile @@ -51,6 +51,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { fcntl.o ctype.o + ctype_loc.o LocaleData.o memchr.o