<commit_before>uClibc attempts to fully (and rigorously) support "The Open Group Base
Specifications Issue 6 IEEE Std 1003.1, 2003 Edition" (aka SuSv3).  However, as
with any standard, they sometimes require things that are either impossible or
are Completely Stupid(tm).  Therefore, we cannot claim full compliance, and
there may be some areas of uClibc that differ from the requirements of this
specification.  This document attempts to list these differences and, when
completed, will contain a full list of all relevant differences between uClibc
and the requirements of the SuSv3.


*) The uClibc setlocale() function is not threadsafe.

    SuSv3 states that "The locale state is common to all threads
    within a process.".  But it does not explicitly mention
    setlocale() as a function that need not be thread-safe.
    Making setlocale() threadsafe would require an absurd amount
    of locking (i.e. inside each and every ctype call such as
    isalpha()).  Furthermore, we consider calling setlocale()
    from N threads concurrently while using string functions to
    be a terribly dumb thing to do.  Therefore, we have decided
    that setlocale() shall not be threadsafe.  If you are
    multi-threaded, and you wish to change the global locale
    state, please take care to prevent all other threads from
    using any locale or ctype functions until the setlocale()
    call has finished.




----------------------------------------------------------------
heukelum -- heukelum at freemail dot nl writes:

Hi everyone,

I think uClibc is a great project! And, since I found the file
docs/uClibc_vs_SuSv3.txt in the source tarball which mentioned only
fmtmsg as a missing function compared to the SUSv3, I got curious about
the length of the list denoted by "<others?>". So I built the
20040305-snapshot using allyesconfig, extracted the symbols from the
(dynamic) libraries, and compared that list to the SUSv3 header files...

The largest source of omissions was the mathematical interface
(183/355), followed by optional interfaces (134/355). The result: only
38 non-mathematical interfaces are missing compared to the minimal
SUSv3! Naming only one function as missing was over-enthousiastic, but
the result was better than I anticipated.

A compact list of omissions is appended.
I hope this was a helpful exercise ;)

Greetings,
         Alexander

P.S. uClibc was compiled with thread support, but did not provide the
interfaces pthread_cleanup_push and pthread_cleanup_pop.



Omissions from obligatory interfaces:
-------------------------------------
stdlib.h: _Exit, a64l, l64a, lcong48, lldiv, mkstemp, posix_openpt;
         mktemp, ecvt, fcvt
ndbm.h: [all=9] dbm_*
utmpx.h: [all=6] *utx* (but functions without "x" do exist!)
nl_types.h: [all] catclose, catgets, catopen
unistd.h: getwd, ualarm
inttypes.h: imaxdiv
fmtmsg.h: fmtmsg
string.h: strerror_r
setjmp.h: setsigjmp
monetary.h: strfmon<commit_msg>a64l/l64a are now in uClibc, mkstemp and mktemp already were<commit_after>uClibc attempts to fully (and rigorously) support "The Open Group Base
Specifications Issue 6 IEEE Std 1003.1, 2003 Edition" (aka SuSv3).  However, as
with any standard, they sometimes require things that are either impossible or
are Completely Stupid(tm).  Therefore, we cannot claim full compliance, and
there may be some areas of uClibc that differ from the requirements of this
specification.  This document attempts to list these differences and, when
completed, will contain a full list of all relevant differences between uClibc
and the requirements of the SuSv3.


*) The uClibc setlocale() function is not threadsafe.

    SuSv3 states that "The locale state is common to all threads
    within a process.".  But it does not explicitly mention
    setlocale() as a function that need not be thread-safe.
    Making setlocale() threadsafe would require an absurd amount
    of locking (i.e. inside each and every ctype call such as
    isalpha()).  Furthermore, we consider calling setlocale()
    from N threads concurrently while using string functions to
    be a terribly dumb thing to do.  Therefore, we have decided
    that setlocale() shall not be threadsafe.  If you are
    multi-threaded, and you wish to change the global locale
    state, please take care to prevent all other threads from
    using any locale or ctype functions until the setlocale()
    call has finished.




----------------------------------------------------------------
heukelum -- heukelum at freemail dot nl writes:

Hi everyone,

I think uClibc is a great project! And, since I found the file
docs/uClibc_vs_SuSv3.txt in the source tarball which mentioned only
fmtmsg as a missing function compared to the SUSv3, I got curious about
the length of the list denoted by "<others?>". So I built the
20040305-snapshot using allyesconfig, extracted the symbols from the
(dynamic) libraries, and compared that list to the SUSv3 header files...

The largest source of omissions was the mathematical interface
(183/355), followed by optional interfaces (134/355). The result: only
38 non-mathematical interfaces are missing compared to the minimal
SUSv3! Naming only one function as missing was over-enthousiastic, but
the result was better than I anticipated.

A compact list of omissions is appended.
I hope this was a helpful exercise ;)

Greetings,
         Alexander

P.S. uClibc was compiled with thread support, but did not provide the
interfaces pthread_cleanup_push and pthread_cleanup_pop.



Omissions from obligatory interfaces:
-------------------------------------
stdlib.h: _Exit, lcong48, lldiv, posix_openpt;
          ecvt, fcvt
ndbm.h: [all=9] dbm_*
utmpx.h: [all=6] *utx* (but functions without "x" do exist!)
nl_types.h: [all] catclose, catgets, catopen
unistd.h: getwd, ualarm
inttypes.h: imaxdiv
fmtmsg.h: fmtmsg
string.h: strerror_r
setjmp.h: setsigjmp
monetary.h: strfmon
{'fraction_non_alphanumeric': 0.08577725038142058, 'fraction_numerical': 0.015934904221054418, 'mean_word_length': 3.531490015360983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2098224', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1613, 'n_words': 812}