Change nl_langinfo to nl_langinfo_l using locale given as argument.
Remove outdated TRANSITION_PERIOD_HACK. The codeset is stored in
the locale for quite some time now. For !MB_CAPABLE targets, just
return "US_ASCII" as codeset.
Implement nl_langinfo by calling nl_langinfo_l. Export nl_langinfo_l
from Cygwin DLL and bump minor API version number.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The former __locale_charset always fetched the current locale's charset.
We need the per-locale charset, too, in future. Rename __locale_charset
to __current_locale_charset and change __locale_charset to take a
locale_t as parameter. Accommodate througout.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Commit 6f3943b erroneously removed the `#ifdef _COMPILING_NEWLIB'
guarding the __getreent inline function. This patch ignored the
fact that config.h is included when building applications, and the
code in question requires internal, auto-generated headers to be
available which are not exposed to user-space.
Reinstantiate defined(_COMPILING_NEWLIB) test and alternatively
check for defined (__INSIDE_CYGWIN__), otherwise we'd have to
reinstantiate the __getreent macro in cygtls.h which is really
confusing.
While testing it turned out that a low number of source codes inside
Cygwin won't see the inline __getreent due to a missing __INSIDE_CYGWIN__
definition. For malloc.cc this was actually deliberate to get different
definitions from including cygmalloc.h. Change this by defining
__INSIDE_CYGWIN__ in malloc.cc but changing the test in cygmalloc.h
to test for defined(DLMALLOC_VERSION). This might need a change if we
ever get around to replace dlmalloc with a newer, more threading-aware
malloc implementation.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Commit 97d0449 left a bit to be desired. First, the fact that any
new-style ACL couldn't be "standard ACL" anymore was very much over
the top. On one hand Admins and SYSTEM ACEs are not supposed to be
masked, but on the other hand we *must* create the CLASS_OBJ
because otherwise we don't have information about masking the
execute perms for both groups. The ACL would also fail aclcheck.
And while get_posix_access now returns the "is standard acl" flag,
it hasn't been utilized by set_created_file_access. Rather,
set_created_file_access has simply continued to check for
nentries > MIN_ACL_ENTRIES, which led to all kinds of weird group
and CLASS_OBJ perms. The new code now always manipulates CLASS_OBJ
perms if a CLASS_OBJ is present, and it always manipulates group perms
if the ACL has been marked as "standard" ACL.
Another problem (not related to commit 97d0449) is the order
get_posix_access adds missing perms. CLASS_OBJ perms are computed
*before* missing GROUP_OBJ perms have been added. Thus the CLASS_OBJ
perms could be too tight and led to additional, buggy DENY ACEs.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
HTML build fails with makeinfo 5.2 with the following error:
libgloss/doc/porting.texi:73: @menu seen before first @node
libgloss/doc/porting.texi:73: perhaps your @top node should be wrapped in
@ifnottex rather than @ifinfo?
Following the advice indeed solve the issue while still allowing pdf, dvi and
info builds to work.
This partially reverts commit 10a30e7 as far as the Cygwin version of
the __getreent function is concerned. Remove _COMPILING_NEWLIB guard
only allowing to use __getreent inline function when building newlib,
since we wan to use it in Cygwin as well.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Stefan Assmann <sassmann@redhat.com>
This reverts commit 4de8596. It worked around a problem which was
actually introduced by patch 10a30e7 a few weeks ago. Rather than
adding special code to the newlib version of __getreent, the followup
patch reinstantiates the original, Cygwin-only implementation of
__getreent.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Stefan Assmann <sassmann@redhat.com>
No real domain, no DC, no infos via NetUserGetInfo... nothing. Just nothing.
Use fixed uid 0x1000 (4096) for AzureAD user and gid 0x1001 (4097) for
AzureAD group. Note that this group is part of the user token, but it's
not the primary group. The primary group SID is, unfortunately, the
user's SID.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
So far the lib function __getreent always returned _impure_ptr. On Cygwin
this is only correct after _impure_ptr got initialized. The inline
function in include/cygwin/config.h always returns the right _reent ptr,
though.
After introducing per-thread locales, the __getreent function is called
prior to initialization of _impure_ptr (from dll_crt0_0) to access the
locale pointer, which leads to a crash.
Fix the __getreent lib function for Cygwin to return the correct _reent
pointer all the time. Rename inline function to __inline_getreent
and introduce a macro __getreent calling the inline function. Change
the lib function __getreent to call __inline_getreent on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
make pdf on arm-none-eabi targets fails to build after the reorganization in
baf0c9fcb5 to fold is*_l documentation in their
is* counterpart. This is due two issues:
1) newlib/libc/ctype/ctype.tex still including the def file for the long versions
2) missing angle brackets in .c files for some of is*_l functions
This patch fixes the issues and allows make pdf to succeeds.
The default UI language returned by GetUserDefaultUILanguage does not
necessarily reflect what the user really wants. E. g., the system could
be en_US, but the desired language is en_CA, without having a CA langpack
installed.
Changing the settings under "Languages" and changing the keyboard layout
is only affecting the so-called "Input language", while what's returned
by GetUserDefaultUILanguage is the "Display language". Changing the
latter requires installing MUI langpacks.
Thus, we introduce a way to fetch the "Input language" using the -i or
--input option.
Also clean up documentation of locale(1).
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Using era_info_t and alt_digits_t indiscriminately in strftime and
strftime_l breaks targets not wanting C99 time formats.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
These functions are used from, e.g., nl_langinfo or strftime, so
we need them for all targets. Just return "C" locale category for
non-__HAVE_LOCALE_INFO__ targets.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
- Setting the categories strings in tmp_locale short-circuits
__loadlocale. Use a new_categories array instead, just as in
_setlocale_r.
- If we have a base, copy over the *not* defined categories in
category_mask in the first place. Rearrange loop accordingly.
- Free base right in newlocale.
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
Initializing a pointer to struct __locale_t to point to a string "C"
is not such a bright idea in the long run...
Signed-off by: Corinna Vinschen <corinna@vinschen.de>