]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
8 years agoFix stray closing brace
Corinna Vinschen [Tue, 23 Aug 2016 11:08:01 +0000 (13:08 +0200)]
Fix stray closing brace

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd/change a few #ifdef comments in locale code for clearness
Corinna Vinschen [Tue, 23 Aug 2016 10:43:40 +0000 (12:43 +0200)]
Add/change a few #ifdef comments in locale code for clearness

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRemove erroneous POSIX guards for reentrant locale functions
Corinna Vinschen [Tue, 23 Aug 2016 10:39:42 +0000 (12:39 +0200)]
Remove erroneous POSIX guards for reentrant locale functions

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoReference __global_locale only via __get_global_locale.
Corinna Vinschen [Tue, 23 Aug 2016 10:38:28 +0000 (12:38 +0200)]
Reference __global_locale only via __get_global_locale.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAvoid truncating from long double to double in sinhl().
David Wohlferd [Mon, 22 Aug 2016 07:51:12 +0000 (00:51 -0700)]
Avoid truncating from long double to double in sinhl().

This routine makes a call to fabs instead of fabsl(), causing truncation.

Clang complains (warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value).

Signed-off-by: David Wohlferd <dw@LimeGreenSocks.com>
8 years agosqrt: Fix NaN propagation for IEEE Std 754-2008
Ray Donnelly [Wed, 6 Apr 2016 01:59:53 +0000 (02:59 +0100)]
sqrt: Fix NaN propagation for IEEE Std 754-2008

The R language has some hacks specifically for mingw-w64 that
were caused by our handling of NaNs in sqrt(x). R uses a
special valued NaN to mean 'Not Available' and expects it to
be retained through various calculations. Our sqrt(x) doesn't
do this, instead it normalises such a NaN (retaining sign).

From:

http://wwwf.imperial.ac.uk/~drmii/M3SC_2016/IEEE_2008_4610935.pdf

"6.2.3 NaN propagation

An operation that propagates a NaN operand to its result and
has a single NaN as an input should produce a NaN with the
payload of the input NaN if representable in the destination
format."

There might even be a slight speed-up from this too.

Thanks to Duncan Murdoch for finding the reference.

8 years agoRemove extern declaration of __locale_cjk_lang in string/local.h
Corinna Vinschen [Sun, 21 Aug 2016 10:14:32 +0000 (12:14 +0200)]
Remove extern declaration of __locale_cjk_lang in string/local.h

Now that __locale_cjk_lang is an inline function in setlocale.h and
setlocale.h is included, the declaration doesn't make sense.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDocument nl_langinfo_l and separate POSIX from GNU extensions in release message
Corinna Vinschen [Sat, 20 Aug 2016 15:24:16 +0000 (17:24 +0200)]
Document nl_langinfo_l and separate POSIX from GNU extensions in release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoImplement missing POSIX function nl_langinfo_l
Corinna Vinschen [Sat, 20 Aug 2016 15:22:41 +0000 (17:22 +0200)]
Implement missing POSIX function nl_langinfo_l

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>
8 years agoIntroduce __current_locale_charset/__locale_charset
Corinna Vinschen [Sat, 20 Aug 2016 14:05:56 +0000 (16:05 +0200)]
Introduce __current_locale_charset/__locale_charset

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>
8 years agoOnly define __getreent inline function when building newlib or Cygwin
Corinna Vinschen [Sat, 20 Aug 2016 14:03:14 +0000 (16:03 +0200)]
Only define __getreent inline function when building newlib or Cygwin

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>
8 years agoAdd release message for commit eb61113
Corinna Vinschen [Fri, 19 Aug 2016 15:25:31 +0000 (17:25 +0200)]
Add release message for commit eb61113

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for commit a871644
Corinna Vinschen [Fri, 19 Aug 2016 14:54:56 +0000 (16:54 +0200)]
Add release message for commit a871644

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSimplify "Windows-standard-like" permissions
Corinna Vinschen [Fri, 19 Aug 2016 14:50:04 +0000 (16:50 +0200)]
Simplify "Windows-standard-like" permissions

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>
8 years agoFix outdated S_JUSTCREATED comment
Corinna Vinschen [Fri, 19 Aug 2016 14:27:07 +0000 (16:27 +0200)]
Fix outdated S_JUSTCREATED comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix html build
Thomas Preud'homme [Thu, 18 Aug 2016 14:31:28 +0000 (15:31 +0100)]
Fix html build

8 years agoFix html build with makeinfo 5.2
Thomas Preudhomme [Fri, 19 Aug 2016 08:10:38 +0000 (09:10 +0100)]
Fix html build with makeinfo 5.2

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.

8 years agoReinstantiate Cygwin function called `__getreent'
Corinna Vinschen [Thu, 18 Aug 2016 12:27:05 +0000 (14:27 +0200)]
Reinstantiate Cygwin function called `__getreent'

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>
8 years agoRevert "Fix __getreent function for Cygwin"
Corinna Vinschen [Thu, 18 Aug 2016 12:26:42 +0000 (14:26 +0200)]
Revert "Fix __getreent function for Cygwin"

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>
8 years agoWorkaround AzureAD shortcomings
Corinna Vinschen [Mon, 8 Aug 2016 07:45:34 +0000 (09:45 +0200)]
Workaround AzureAD shortcomings

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>
8 years agoFix __getreent function for Cygwin
Corinna Vinschen [Thu, 18 Aug 2016 08:27:14 +0000 (10:27 +0200)]
Fix __getreent function for Cygwin

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>
8 years agoFix pdf build failure wrt documentation of is*_l functions
Thomas Preudhomme [Wed, 17 Aug 2016 16:05:07 +0000 (17:05 +0100)]
Fix pdf build failure wrt documentation of is*_l functions

make pdf on arm-none-eabi targets fails to build after the reorganization in
baf0c9fcb56e5cf8f54357bf8d8646b51b236886 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.

8 years agoAdd release message for commit c02ac89
Corinna Vinschen [Wed, 17 Aug 2016 09:17:26 +0000 (11:17 +0200)]
Add release message for commit c02ac89

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd -i/--input option to locale(1)
Corinna Vinschen [Wed, 17 Aug 2016 08:58:04 +0000 (10:58 +0200)]
Add -i/--input option to locale(1)

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>
8 years agoConstify __locale_ctype_ptr and __locale_ctype_ptr_l
Corinna Vinschen [Wed, 17 Aug 2016 07:40:28 +0000 (09:40 +0200)]
Constify __locale_ctype_ptr and __locale_ctype_ptr_l

Remove _MB_CAPABLE-only _CONST in ctype.h

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoActually return pointers in locale categroy accessor functions
Corinna Vinschen [Tue, 16 Aug 2016 14:23:51 +0000 (16:23 +0200)]
Actually return pointers in locale categroy accessor functions

Commit 6e7ce50 was broken.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlways fall back to __ctype_ptr__ in isXXX_l functions.
Corinna Vinschen [Tue, 16 Aug 2016 14:22:12 +0000 (16:22 +0200)]
Always fall back to __ctype_ptr__ in isXXX_l functions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAvoid "implicit declaration of function ‘strtold_l’" in wcstold.c
Corinna Vinschen [Tue, 16 Aug 2016 14:21:19 +0000 (16:21 +0200)]
Avoid "implicit declaration of function ‘strtold_l’" in wcstold.c

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse era_info_t and alt_digits_t on _WANT_C99_TIME_FORMATS targets only
Corinna Vinschen [Tue, 16 Aug 2016 13:26:01 +0000 (15:26 +0200)]
Use era_info_t and alt_digits_t on _WANT_C99_TIME_FORMATS targets only

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>
8 years agoExpose locale category accessor functions to non-__HAVE_LOCALE_INFO__ targets.
Corinna Vinschen [Tue, 16 Aug 2016 13:24:26 +0000 (15:24 +0200)]
Expose locale category accessor functions to non-__HAVE_LOCALE_INFO__ targets.

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>
8 years ago__localeconv_l: Always define locale variable lconv
Corinna Vinschen [Tue, 16 Aug 2016 11:54:32 +0000 (13:54 +0200)]
__localeconv_l: Always define locale variable lconv

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't use locale_t in internal header
Corinna Vinschen [Tue, 16 Aug 2016 11:51:46 +0000 (13:51 +0200)]
Don't use locale_t in internal header

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRephrase release message
Corinna Vinschen [Tue, 16 Aug 2016 10:41:34 +0000 (12:41 +0200)]
Rephrase release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix typo in release message
Corinna Vinschen [Tue, 16 Aug 2016 09:22:26 +0000 (11:22 +0200)]
Fix typo in release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release text for Cygwin 2.6.0
Corinna Vinschen [Mon, 15 Aug 2016 19:26:01 +0000 (21:26 +0200)]
Add release text for Cygwin 2.6.0

Move release/2.5.3 to release/2.6.0.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoImplement strto[dflu]_l/wcsto[dflu]_l
Corinna Vinschen [Wed, 10 Aug 2016 14:30:46 +0000 (16:30 +0200)]
Implement strto[dflu]_l/wcsto[dflu]_l

Implement GNU extensions strtod_l, strtof_l, strtol_l, strtold_l, strtoll_l,
strtoul_l, strtoull_l, wcstod_l, wcstof_l, wcstol_l, wcstold_l, wcstoll_l,
wcstoul_l, wcstoull_l.

Export from Cygwin, fix posix.xml.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd documentation for duplocale, freelocale, newlocale, and uselocale.
Corinna Vinschen [Mon, 15 Aug 2016 15:34:40 +0000 (17:34 +0200)]
Add documentation for duplocale, freelocale, newlocale, and uselocale.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFold documentation of is*_l funcs into documentation of non-l is* funcs
Corinna Vinschen [Mon, 15 Aug 2016 12:21:52 +0000 (14:21 +0200)]
Fold documentation of is*_l funcs into documentation of non-l is* funcs

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosetlocale/localeconv are *not* POSIX-1.2008
Corinna Vinschen [Fri, 29 Jul 2016 07:52:50 +0000 (09:52 +0200)]
setlocale/localeconv are *not* POSIX-1.2008

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agosetlocale.h: Fix current locale handling for !__HAVE_LOCALE_INFO__ targets
Corinna Vinschen [Thu, 28 Jul 2016 07:50:43 +0000 (09:50 +0200)]
setlocale.h: Fix current locale handling for !__HAVE_LOCALE_INFO__ targets

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years ago__loadlocale: Set missing val when evaluating CP874
Corinna Vinschen [Wed, 27 Jul 2016 20:27:06 +0000 (22:27 +0200)]
__loadlocale: Set missing val when evaluating CP874

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoMake sure alloca is called even when optimizing, fully init _REENT
Corinna Vinschen [Wed, 27 Jul 2016 11:52:10 +0000 (13:52 +0200)]
Make sure alloca is called even when optimizing, fully init _REENT

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoFix multiple thinkos in newlocale
Corinna Vinschen [Tue, 26 Jul 2016 21:36:04 +0000 (23:36 +0200)]
Fix multiple thinkos in newlocale

- 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>

8 years agoFix _REENT_INIT initialization of _locale
Corinna Vinschen [Tue, 26 Jul 2016 13:42:04 +0000 (15:42 +0200)]
Fix _REENT_INIT initialization of _locale

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>

8 years agoFix typo in isalnum_l doc
Corinna Vinschen [Mon, 25 Jul 2016 18:22:48 +0000 (20:22 +0200)]
Fix typo in isalnum_l doc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoGet rid of LCID, reformat type definitions in setlocale.h
Corinna Vinschen [Mon, 25 Jul 2016 10:30:25 +0000 (12:30 +0200)]
Get rid of LCID, reformat type definitions in setlocale.h

Definition of LCID results in build problems on 32 bit Cygwin

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoAdd sys/_locale.h header and fix up headers
Corinna Vinschen [Mon, 25 Jul 2016 09:47:36 +0000 (11:47 +0200)]
Add sys/_locale.h header and fix up headers

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoBump CygwinAPI minor.
Corinna Vinschen [Mon, 25 Jul 2016 09:28:48 +0000 (11:28 +0200)]
Bump CygwinAPI minor.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoImplement strfmon_l
Corinna Vinschen [Mon, 25 Jul 2016 09:26:08 +0000 (11:26 +0200)]
Implement strfmon_l

Use latest code from FreeBSD

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoRename __get_locale_XXX to __get_XXX_locale to use unified naming scheme
Corinna Vinschen [Mon, 25 Jul 2016 09:24:59 +0000 (11:24 +0200)]
Rename __get_locale_XXX to __get_XXX_locale to use unified naming scheme

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoMove lconv into struct __locale_t and implement __localeconv_l
Corinna Vinschen [Mon, 25 Jul 2016 09:23:36 +0000 (11:23 +0200)]
Move lconv into struct __locale_t and implement __localeconv_l

Based on FreeBSD, just don't export symbol yet, unless required.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoImplement per-locale string functions
Corinna Vinschen [Sun, 24 Jul 2016 18:00:34 +0000 (20:00 +0200)]
Implement per-locale string functions

strcasecmp_l, strcoll_l, strncasecmp_l, strxfrm_l,
wcscasecmp_l, wcscoll_l, wcstrncasecmp_l, wcstrxfrm_l,
strftime_l.

Add missing CHEWOUT_FILES from previous patch.

TODO: strfmon_l.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoImplement all per-locale ctype functions
Corinna Vinschen [Sun, 24 Jul 2016 13:44:43 +0000 (15:44 +0200)]
Implement all per-locale ctype functions

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoMove localeconv, duplocale, freelocale, newlocale, uselocale into separate files
Corinna Vinschen [Sat, 23 Jul 2016 19:40:50 +0000 (21:40 +0200)]
Move localeconv, duplocale, freelocale, newlocale, uselocale into separate files

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoinclude/locale.h: Fix POSIX guards
Corinna Vinschen [Sat, 23 Jul 2016 12:19:52 +0000 (14:19 +0200)]
include/locale.h: Fix POSIX guards

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoRemove non-working __part_load_locale function and any related code
Corinna Vinschen [Sat, 23 Jul 2016 12:19:25 +0000 (14:19 +0200)]
Remove non-working __part_load_locale function and any related code

Add TODO markers in case somebody wants to pick this up again

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoposix.xml: Note duplocale, freelocale, newlocale, uselocale as implemented
Corinna Vinschen [Sat, 23 Jul 2016 12:01:15 +0000 (14:01 +0200)]
posix.xml: Note duplocale, freelocale, newlocale, uselocale as implemented

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoFix memory handling in functions called from loadlocale
Corinna Vinschen [Sat, 23 Jul 2016 11:30:21 +0000 (13:30 +0200)]
Fix memory handling in functions called from loadlocale

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoImplement newlocale, freelocale, duplocale, uselocale
Corinna Vinschen [Fri, 22 Jul 2016 20:54:07 +0000 (22:54 +0200)]
Implement newlocale, freelocale, duplocale, uselocale

Add global const __C_locale for reference purposes.

Bump Cygwin API minor number and DLL major version number to 2.6.0.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoUse __get_global_locale function where appropriate
Corinna Vinschen [Fri, 22 Jul 2016 20:40:45 +0000 (22:40 +0200)]
Use __get_global_locale function where appropriate

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoRearrange struct __locale_t pointers into an array
Corinna Vinschen [Fri, 22 Jul 2016 17:57:56 +0000 (19:57 +0200)]
Rearrange struct __locale_t pointers into an array

This allows looping through the structs and buffers.  Also
rearrange definitions to follow order of LC_xxx values.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoChange loadlocale to fill a __locale_t given as parameter
Corinna Vinschen [Thu, 21 Jul 2016 18:49:42 +0000 (20:49 +0200)]
Change loadlocale to fill a __locale_t given as parameter

Don't use global variables.  This allows to call loadlocale from
the yet to be created newlocale().

Rename _thr_locale_t to __locale_t (these locales are not restricted
to threads so the name is misleading).

Along these lines, fix _set_ctype to take a __locale_t as parameter.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoConsolidate wctomb/mbtowc calls for POSIX-1.2008
Corinna Vinschen [Wed, 20 Jul 2016 20:05:59 +0000 (22:05 +0200)]
Consolidate wctomb/mbtowc calls for POSIX-1.2008

- Remove charset parameter from low level __foo_wctomb/__foo_mbtowc calls.
- Instead, create array of function for ISO and Windows codepages to point
  to function which does not require to evaluate the charset string on
  each call.  Create matching helper functions.  I.e., __iso_wctomb,
  __iso_mbtowc, __cp_wctomb and __cp_mbtowc are functions returning the
  right function pointer now.
- Create __WCTOMB/__MBTOWC macros utilizing per-reent locale and replace
  calls to __wctomb/__mbtowc with calls to __WCTOMB/__MBTOWC.
- Drop global __wctomb/__mbtowc vars.
- Utilize aforementioned changes in Cygwin to get rid of charset in other,
  calling functions and simplify the code.
- In Cygwin restrict global cygheap locale info to the job performed
  by internal_setlocale.  Use UTF-8 instead of ASCII on the fly in
  internal conversion functions.
- In Cygwin dll_entry, make sure to initialize a TLS area with a NULL
  _REENT->_locale pointer.  Add comment to explain why.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoPOSIX-1.2008 per-thread locales, groundwork part 2
Corinna Vinschen [Tue, 19 Jul 2016 14:48:07 +0000 (16:48 +0200)]
POSIX-1.2008 per-thread locales, groundwork part 2

Move all locale category structure definitions into setlocale.h and remove
other headers in locale subdir.  Create inline accessor functions for
current category struct pointers and use throughout.  Use pointers to
"C" locale category structs by default in __global_locale.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoPOSIX-1.2008 per-thread locales, groundwork part 1
Corinna Vinschen [Wed, 13 Jul 2016 14:51:33 +0000 (16:51 +0200)]
POSIX-1.2008 per-thread locales, groundwork part 1

Introduce first cut of struct _thr_locale_t used for the locale_t definition.
Introduce global instance called __global_locale used by default.
Introduce internal inline functions __get_global_locale, __get_locale_r,
__get_current_locale.

Remove usage of global variables in favor of accessor functions pointing to
__global_locale for now.  Include all local headers in locale subdir from
setlocale.h to get single include for internal locale access.

Introduce __CTYPE_PTR macro to replace direct access to __ctype_ptr__
and use throughout in isxxx functions.

Signed-off by: Corinna Vinschen <corinna@vinschen.de>

8 years agoDo not include wctype.h in wchar.h with _GNU_SOURCE
Yaakov Selkowitz [Fri, 12 Aug 2016 18:44:26 +0000 (13:44 -0500)]
Do not include wctype.h in wchar.h with _GNU_SOURCE

_GNU_SOURCE generally enables all features, but in this case the POSIX
requirement to #include <wctype.h> for these is preferred.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoDefine va_list in stdio.h and wchar.h
Yaakov Selkowitz [Fri, 12 Aug 2016 08:16:52 +0000 (03:16 -0500)]
Define va_list in stdio.h and wchar.h

This typedef, along with that of FILE in wchar.h, were XSI prior to
inclusion in POSIX.1-2008.

Fixes: https://sourceware.org/ml/newlib/2016/msg00640.html
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoRemove unused import/rexec.c accidentally imported by commit b6e90a06
Corinna Vinschen [Fri, 12 Aug 2016 12:52:09 +0000 (14:52 +0200)]
Remove unused import/rexec.c accidentally imported by commit b6e90a06

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoInclude wctype.h in wchar.h as an XSI extension
Yaakov Selkowitz [Thu, 11 Aug 2016 21:33:43 +0000 (16:33 -0500)]
Include wctype.h in wchar.h as an XSI extension

However, note that this inclusion is obsolescent in SUSv4 and therefore
may be removed in the next revision.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: wctype.h
Yaakov Selkowitz [Thu, 11 Aug 2016 19:16:24 +0000 (14:16 -0500)]
Feature test macros overhaul: wctype.h

iswblank was first introduced in C99.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agokill(pid, sig) before waitpid() returns -1 for sig != 0
Erik Bray [Thu, 11 Aug 2016 13:57:53 +0000 (15:57 +0200)]
kill(pid, sig) before waitpid() returns -1 for sig != 0

This is a followup to a report back in 2011 about essentially the same issue:

https://cygwin.com/ml/cygwin/2011-04/msg00031.html

The same test program in that report demonstrates the issue, but with
kill sending any non-zero signal.  To reiterate, the problem here is
POSIX compliance with respect to sending signals to zombie processes.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
claims:

  Existing implementations vary on the result of a kill() with pid
  indicating an inactive process (a terminated process that has not been
  waited for by its parent). Some indicate success on such a call
  (subject to permission checking), while others give an error of
  [ESRCH].  Since the definition of process lifetime in this volume of
  POSIX.1-2008 covers inactive processes, the [ESRCH] error as described
  is inappropriate in this case. In particular, this means that an
  application cannot have a parent process check for termination of a
  particular child with kill().  (Usually this is done with the null
  signal; this can be done reliably with waitpid().)

In response to the originally issue, this was fixed *specifically* for
the case of kill(pid, 0).  But my reading of the above is that kill()
should return 0 in this case regardless of the signal (modulo
permissions, etc.).  On Linux, for example, when calling kill with pid
of a zombie process the kernel will happily deliver the signal to the
relevant task_struct; it will just never be acted on since the task
will never run again.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFeature test macros overhaul: wchar.h, part 2
Yaakov Selkowitz [Wed, 10 Aug 2016 19:47:35 +0000 (14:47 -0500)]
Feature test macros overhaul: wchar.h, part 2

Many wchar.h functions were never properly guarded; these changes should
make the header fully compliant.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoarc: Fix strcmp for big endian without barrel shifter
Anton Kolesov [Thu, 21 Jul 2016 10:19:34 +0000 (13:19 +0300)]
arc: Fix strcmp for big endian without barrel shifter

strcmp.S contained invalid guard for code that used barrel-shifter optional
instruction - it was checking for !ARC601 instead of whether barrel shifter
is present. While it is true that ARC601 doesn't have barrel shifter, so
does some other ARC EM configurations.

2016-07-21  Anton Kolesov  <Anton.Kolesov@synopsys.com>

* libc/machine/arc/strcmp.S: Fix big endian without barrel shifter.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
8 years agoarc: Add align keyword.
Claudiu Zissulescu [Tue, 28 Jun 2016 13:12:16 +0000 (15:12 +0200)]
arc: Add align keyword.

libgloss/
2016-06-28  Claudiu Zissulescu  <claziss@synopsys.com>

* arc/crt0.S: Add align keyword.

8 years agoarc: Use prefetch instead of prealloc.
Claudiu Zissulescu [Tue, 26 Apr 2016 13:27:31 +0000 (15:27 +0200)]
arc: Use prefetch instead of prealloc.

Prealloc instruction may not be present in all HS variants. Hence, use
prefetch instead of prealloc.

newlib/
2016-04-26  Claudiu Zissulescu  <claziss@synopsys.com>

* libc/machine/arc/memset-archs.S: Use prefetch.

8 years agoarc: Use unaligned loads/stores for memcopy.
Claudiu Zissulescu [Tue, 26 Apr 2016 13:25:06 +0000 (15:25 +0200)]
arc: Use unaligned loads/stores for memcopy.

newlib/
2016-04-26  Claudiu Zissulescu  <claziss@synopsys.com>

* libc/machine/arc/memcpy-archs.S: Add and enable memcpy using
unaligned loads/stores.

8 years agortems: define _POSIX_CLOCK_SELECTION feature
Gedare Bloom [Mon, 1 Aug 2016 19:55:58 +0000 (14:55 -0500)]
rtems: define _POSIX_CLOCK_SELECTION feature

Enable definition of clock_nanosleep() since it was added to RTEMS.

Signed-off-by: Joel Sherrill <joelemail@rtems.org>
8 years agortems: add sys/mman.h
Gedare Bloom [Mon, 1 Aug 2016 19:55:57 +0000 (14:55 -0500)]
rtems: add sys/mman.h

This file was copied verbatim from FreeBSD and is in sync
with the FreeBSD svn version used by rtems-libbsd.

Signed-off-by: Joel Sherrill <joelemail@rtems.org>
8 years agoWorkaround for filesystems with broken FileAllInformation info class (NcFsd)
Corinna Vinschen [Thu, 4 Aug 2016 09:13:57 +0000 (11:13 +0200)]
Workaround for filesystems with broken FileAllInformation info class (NcFsd)

See discussion starting at https://cygwin.com/ml/cygwin/2016-07/msg00350.html

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix console clear screen if buffer is full
Corinna Vinschen [Wed, 3 Aug 2016 12:34:01 +0000 (14:34 +0200)]
Fix console clear screen if buffer is full

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix console clear screen in case of partial scrolling
Corinna Vinschen [Mon, 1 Aug 2016 10:35:51 +0000 (12:35 +0200)]
Fix console clear screen in case of partial scrolling

Commit d7586cb incorrectly checked only for the new cursor position
beyond the old cursor position to decide if we have to correct for user
scrolling.  Since this situation is handled just fine if the cursor is
still visible, only perform the subsequent correction if the cursor is
not in the visible console window.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoOpen process with PROCESS_QUERY_INFORMATION to fetch maps
Corinna Vinschen [Mon, 1 Aug 2016 09:52:30 +0000 (11:52 +0200)]
Open process with PROCESS_QUERY_INFORMATION to fetch maps

Commit ba58e5f lowered permission requirements when opening threads
and processes to {PROCESS,THREAD}_QUERY_LIMITED_INFORMATION.  However,
when creating the /proc/<PID>/maps file, the call to VirtualQueryEx
requires PROCESS_QUERY_INFORMATION access

Note: It seems PROCESS_QUERY_LIMITED_INFORMATION is sufficient starting
with Windows 8.1, but this is neither documented on MSDN, nor is it a
safe bet.  It may have to do with a fixed implementation of the UAC
trust levels.  Let's better follow the docs for now.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix clear screen behaviour of console when user scrolled up or down
Corinna Vinschen [Fri, 29 Jul 2016 10:07:46 +0000 (12:07 +0200)]
Fix clear screen behaviour of console when user scrolled up or down

We must call SetConsoleCursorPosition prior to SetConsoleWindowInfo,
otherwise the scroll bars will not be updated by the OS.  Make sure
to scroll the console window by just the right amount to have the
new cursor position one line after the used console buffer area at
the top of the console window, no matter the scroll state.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix buffer scrolling when performing a "clear screen"
Corinna Vinschen [Wed, 27 Jul 2016 18:39:24 +0000 (20:39 +0200)]
Fix buffer scrolling when performing a "clear screen"

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't raise SIGTTIN from poll/select
Corinna Vinschen [Tue, 26 Jul 2016 18:03:07 +0000 (19:03 +0100)]
Don't raise SIGTTIN from poll/select

SIGTTIN should be raised when read() is made on a tty in a backgrounded
process, but not when it's tested with poll()/select().

I guess poll()/select() does need to call bg_check(), in order to detect the
error conditions that notices (that is, if bg_check() returns bg_eof or
bg_error, then fd is ready as an error condition exists) so add an optional
parameter to fhandler_base::bg_select() to indicate that signals aren't
desired.

See https://cygwin.com/ml/cygwin-developers/2016-07/msg00004.html

8 years agoRemove redundant macro and function called `__getreent'
Corinna Vinschen [Wed, 27 Jul 2016 12:00:30 +0000 (14:00 +0200)]
Remove redundant macro and function called `__getreent'

Just rely on the inline version in include/cygwin/config.h

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoposix.xml: Add missing unimplemented functions from POSIX-1.2013
Corinna Vinschen [Sat, 23 Jul 2016 11:56:52 +0000 (13:56 +0200)]
posix.xml: Add missing unimplemented functions from POSIX-1.2013

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoChange "nodomain+nobody" to "no+body"
Corinna Vinschen [Fri, 22 Jul 2016 07:41:23 +0000 (09:41 +0200)]
Change "nodomain+nobody" to "no+body"

Per https://cygwin.com/ml/cygwin-apps/2016-07/msg00059.html

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoHandle WinFSP nobody account
Corinna Vinschen [Wed, 29 Jun 2016 15:12:38 +0000 (17:12 +0200)]
Handle WinFSP nobody account

Per discussion started at
https://cygwin.com/ml/cygwin/2016-06/msg00347.html

S-1-0-65534 == uid/gid 65534 == nodomain+nobody

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix typo
Corinna Vinschen [Mon, 18 Jul 2016 20:03:37 +0000 (22:03 +0200)]
Fix typo

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for commit 71df3bf
Corinna Vinschen [Mon, 18 Jul 2016 20:03:00 +0000 (22:03 +0200)]
Add release message for commit 71df3bf

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agotruncl: Fix setting rounding bits in FPU control word
Corinna Vinschen [Mon, 18 Jul 2016 20:00:17 +0000 (22:00 +0200)]
truncl: Fix setting rounding bits in FPU control word

Mingw-w64, which is the source of this code, uses different
definitions of the rounding bits FE_TONEAREST and friends.
They immediately reflect the bit values in the FPU control word,
while on Cygwin they are shifted down to become the values 0-3.

Fix the bit computing expression to account for the difference.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agomath.h: fix guards on basic M_ constants
Yaakov Selkowitz [Fri, 15 Jul 2016 14:06:53 +0000 (09:06 -0500)]
math.h: fix guards on basic M_ constants

MAXFLOAT, M_PI, and friends date back to at least XPG4v2, so this guard
was incorrect even prior to the feature test macros overhaul.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoPut previous doc in correct section
Eric Blake [Thu, 14 Jul 2016 19:26:29 +0000 (13:26 -0600)]
Put previous doc in correct section

SSIZE_MAX was a bug fix, not a huge change.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAdd release message for commit fe9e3b4
Corinna Vinschen [Thu, 14 Jul 2016 18:55:04 +0000 (20:55 +0200)]
Add release message for commit fe9e3b4

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoTransform all special chars in relative Windows path string
Corinna Vinschen [Thu, 14 Jul 2016 18:52:04 +0000 (20:52 +0200)]
Transform all special chars in relative Windows path string

get_nt_native_path handles the transposition of chars not allowed
in Windows pathnames.  However, it never starts transposition at
the start of the string, which is wrong for relative paths.  Fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix 32-bit SSIZE_MAX
Eric Blake [Wed, 13 Jul 2016 20:35:43 +0000 (14:35 -0600)]
Fix 32-bit SSIZE_MAX

POSIX requires that SSIZE_MAX have the same type as ssize_t, but
on 32-bit, we were defining it as a long even though ssize_t
resolves to an int.  It also requires that SSIZE_MAX be usable
via preprocessor #if, so we can't cheat and use a cast.

If this were newlib, I'd have had to hack _intsup.h to probe the
qualities of size_t (via gcc's __SIZE_TYPE__), similar to how we
already probe the qualities of int8_t and friends, then cross our
fingers that ssize_t happens to have the same rank (most systems
do, but POSIX permits a system where they differ such as size_t
being long while ssize_t is int).  Unfortunately gcc gives us
neither __SSIZE_TYPE__ nor __SSIZE_MAX__.  On the other hand, our
limits.h is specific to cygwin, so we can just shortcut to the
correct results rather than being generic to all possible ABI.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAdd release message for commit 82e0649
Corinna Vinschen [Thu, 14 Jul 2016 17:11:45 +0000 (19:11 +0200)]
Add release message for commit 82e0649

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agomachine/_types.h: __blkcnt_t should be signed
Ray Donnelly [Thu, 14 Jul 2016 11:40:47 +0000 (12:40 +0100)]
machine/_types.h: __blkcnt_t should be signed

[1] states: "blkcnt_t and off_t shall be signed integer types."

This causes pacman to fail when the size requirement
of the net update operation is negative, instead it
calculated a huge positive number.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

8 years agoImprove description of Cygwin ldd utility
Jon Turney [Sat, 2 Jul 2016 15:45:02 +0000 (16:45 +0100)]
Improve description of Cygwin ldd utility

Improve the description of Cygwin ldd utility to give a bit more detail
about how it does what it does

Also add a security warning (modelled after the one in the Linux manpage)
that it may end up executing the file it is applied to.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This page took 0.067921 seconds and 5 git commands to generate.