getlocalename_l: implement per SUS Base Specifications Issue 8 draft
commit71511d4ac8686c2220093cc01525311d9c88bc4e
authorCorinna Vinschen <corinna@vinschen.de>
Sun, 21 Jan 2024 12:23:09 +0000 (21 13:23 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 31 Jan 2024 19:11:57 +0000 (31 20:11 +0100)
tree9973f9166452e4b5d2b80625d48cade547ea0f03
parentcb54031e01a8485743cb6eb68e59f7e19548ae1a
getlocalename_l: implement per SUS Base Specifications Issue 8 draft

  #include <locale.h>
  const char *getlocalename_l(int category, locale_t locobj);

Most notably, we need a per-thread space to store the string
returned if locobj is LC_GLOBAL_LOCALE.  No errors are defined
for getlocalename_l.  So we can't use buffer allocation which
might lead to an ENOMEM error.  We have to use a "static" buffer
in the per-thread state.

Note that the feature test macro in locale.h is not quite correct.
This needs to be fixed as soon as the

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib/Makefile.in
newlib/libc/include/locale.h
newlib/libc/include/sys/reent.h
newlib/libc/locale/Makefile.inc
newlib/libc/locale/getlocalename_l.c [new file with mode: 0644]