Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-09-08dlopen: on x/lib search x/bin if exe is in x/binnewlib-snapshot-20160923Michael Haubenwallner
On 09/02/2016 11:03 AM, Corinna Vinschen wrote: > On Sep 2 10:46, Michael Haubenwallner wrote: >> On 09/01/2016 03:32 PM, Corinna Vinschen wrote: >>> You could just use the global variable program_invocation_name. If in >>> doubt, use the Windows path global_progname and convert it to full POSIX >>> via cygwin_conv_path. >> >> Patch updated, using global_progname now. > > Looks good and you're right to do it this way since I just noticed > that program_invocation_name may return a relative pathname. Yep. > Btw., in other calls which require the full POSIX path we use > mount_table->conv_to_posix_path instead of cygwin_conv_path (see > e. g. fillout_pinfo()). It's a bit faster. Maybe something for a > followup patch. No problem - attached. This renders the original patch 4/4 valid again. > Note for some later improvement: I really wonder why we don't store > the absolute POSIX path of the current executable globally yet... Same here. Thanks! /haubi/ >From f7255edd33cb4abe34f27188aab8dccdfa5dd2a0 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> Date: Wed, 31 Aug 2016 18:05:11 +0200 Subject: [PATCH 3/4] dlopen: on x/lib search x/bin if exe is in x/bin citing https://cygwin.com/ml/cygwin-developers/2016-08/msg00020.html > Consider the file /usr/bin/cygz.dll: > - dlopen (libz.so) success > - dlopen (/usr/bin/libz.so) success > - dlopen (/usr/lib/libz.so) fails * dlfcn.c (dlopen): For dlopen("x/lib/N"), when the application executable is in "x/bin/", search for "x/bin/N" before "x/lib/N".
2016-09-08dlopen (pathfinder): try each basename per dirMichael Haubenwallner
Rather than searching all search dirs per one basename, search for all basenames within per one search dir. pathfinder.h (check_path_access): Interchange dir- and basename-loops.
2016-09-08dlopen: switch to new pathfinder classMichael Haubenwallner
Instead of find_exec, without changing behaviour use new pathfinder class with new allocator_interface around tmp_pathbuf and new vstrlist class. * pathfinder.h (pathfinder): New file. * vstrlist.h (allocator_interface, allocated_type, vstrlist): New file. * dlfcn.cc (dlopen): Avoid redundant GetModuleHandleExW with RTLD_NOLOAD and RTLD_NODELETE. Switch to new pathfinder class, using (tmp_pathbuf_allocator): New class. (get_full_path_of_dll): Drop.
2016-08-31Fix typo in strerror doccygwin-2_6_0-releaseCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-31strace: Don't print exception info for SetThreadName exceptionCorinna Vinschen
The new functionality to set the thread name for debugging purposes creates exception debugging events. These are printed out when running strace. Since these exceptions have nothing to do with real exceptions but are, like breakpoint execptions, expected and non-fatal, don't print exception info for them. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-31Fix passwd getting error 1265 when running on newer WindowsCorinna Vinschen
On Windows 8.1 and later, the NetUserChangePassword call apparently doesn't accept the usual "\\server" string anymore, but requires to use the "domain" instead, otherwise it emits en error code 1265, ERROR_DOWNGRADE_DETECTED. Since this is accepted by pre-8.1 as well, use the domain indiscriminately when calling NetUserChangePassword from passwd(1). While at it, do some minor cleanup in passwd.c. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-30Add release message for commit 3d3ab82Yaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-08-29Fix off_t typedef on Cygwin64Yaakov Selkowitz
While both long and long long are 64-bits on x86_64, they are distinct types, and long was used prior to commit 477463a2011ba81907a753df9ce7a71b6563db54. Changing this breaks the linking of previously compiled C++ functions with off_t arguments on 64-bit Cygwin with newly compiled code, as the mangling of long (l) and long long (x) differ. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-08-25Change return type from locale_t to struct __locale_t * as wellCorinna Vinschen
Complements commit 14228e2. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25Drop duplicate _ctype_ declaration from ctype_.hCorinna Vinschen
It's already defined in ctype.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25Drop global __ctype_ptr__ entirely in favor of using locale_t::ctype_ptrCorinna Vinschen
Keep __ctype_ptr__ available on Cygwin only, for backward compatibility with existing apps referencing it via the ctype macros. Otherwise initialize __global_locale.ctype_ptr and __C_locale.ctype_ptr and use them throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25Fix formattingCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25Fix SetThreadName with current gdbJon Turney
Wrap SetThreadName()'s call to RaiseException() in __try/__except/__endtry, so that if the attached debugger doesn't know about MS_VC_EXCEPTION (e.g. current gdb and probably strace as well) and continues exception processing, we ignore it, rather than dying due an unhandled exception. Also remove an unnecessary cast in the RaiseException() invocation. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-08-25Use struct __locale_t * for reentrent locale functionsCorinna Vinschen
This fixes a build problem since locale_t is only defined if __POSIX_VISIBLE >= 200809. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-25Add strerror_l prototype, change str[n]casecmp_l feature testsBrian Inglis
strerror_l prototype was missing. str[n]casecmp_l feature tests in string.h vs. strings.h were transposed.
2016-08-24Avoid crash when calling __localeconv_l with __C_localeCorinna Vinschen
__C_locale is const. Thus, overwriting the lconv values in __localeconv_l will try to write to a R/O region. Given the lconv values in __C_locale are initialized, there's no reason to write them in __localeconv_l at all. Just return &__C_locale.lconv. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-24Include winsup.h prior to including other headersCorinna Vinschen
Otherwise _GNU_SOURCE is not set when needed in sys/features.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-24Use #if __GNU_VISIBLE, not #ifdef __GNU_VISIBLECorinna Vinschen
sys/features.h always defines __GNU_VISIBLE, either as 0 or 1. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23strerror_l: Fix copy-and-paste typoEric Blake
Signed-off-by: Eric Blake <eblake@redhat.com>
2016-08-23Clarify Cygwin's support for Win32 pathsKen Brown
See https://www.cygwin.com/ml/cygwin/2016-08/msg00431.html.
2016-08-23Add missing LF in release textCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Mention strerror_l in libc/string/strings.texCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Add __get_C_locale inline function and fix new locale code for !_MB_CAPABLE ↵Corinna Vinschen
targets Only access "C" locale using the new __get_C_locale inline function. Enable __global_locale for !_MB_CAPABLE targets. Accommodate !_MB_CAPABLE targets in new locale code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Export and document strerror_l, strptime_l, wcsftime_l from CygwinCorinna Vinschen
Bump Cygwin API minor number. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Implement GNU extension strptime_lCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Implement GNU extension wcsftime_lCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Implement missing POSIX-1.2008 function strerror_lCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Add missing declarations of str{n}casecmp_l to strings.h.Corinna Vinschen
Per glibc, both funcs are defined as GNU visible in strings.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Send thread names to debuggerJon Turney
GDB since commit 24cdb46e [1] can report and use these names. Add utility function SetThreadName(), which sends a thread name to the debugger. Use that: - to set the default thread name for main thread and newly created pthreads. - in pthread_setname_np() for user thread names. - for helper thread names in cygthread::create() - for helper threads which are created directly with CreateThread. Note that there can still be anonymous threads, created by system or injected DLLs. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24cdb46e9f0a694b4fbc11085e094857f08c0419
2016-08-23Add pthread_getname_np and pthread_setname_npJon Turney
This patch adds pthread_getname_np and pthread_setname_np. These were added to glibc in 2.12[1] and are also present in some form on NetBSD and several UNIXes. The code is based on NetBSD's implementation with changes to better match Linux behaviour. Implementation quirks: * pthread_setname_np with a NULL pointer segfaults (as linux) * pthread_setname_np returns ERANGE for names longer than 16 characters (as linux) * pthread_getname_np with a NULL pointer returns EFAULT (as linux) * pthread_getname_np with a buffer length of less than 16 returns ERANGE (as linux) * pthread_getname_np truncates the thread name to fit the buffer length. This guarantees success even when the default thread name is longer than 16 characters, but means there is no way to discover the actual length of the thread name. (Linux always truncates the thread name to 16 characters) * Changing program_invocation_short_name changes the default thread name (on linux, it has no effect on the default thread name) I'll leave it up to you to decide if any of these matter. This is implemented via class pthread_attr to make it easier to add pthread_attr_[gs]etname_np (present in NetBSD and some UNIXes) should it ever be added to Linux (or we decide we want it anyway). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS
2016-08-23Fix stray closing braceCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Add/change a few #ifdef comments in locale code for clearnessCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Remove erroneous POSIX guards for reentrant locale functionsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-23Reference __global_locale only via __get_global_locale.Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-22Avoid truncating from long double to double in sinhl().David Wohlferd
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>
2016-08-22sqrt: Fix NaN propagation for IEEE Std 754-2008Ray Donnelly
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.
2016-08-21Remove extern declaration of __locale_cjk_lang in string/local.hCorinna Vinschen
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>
2016-08-20Document nl_langinfo_l and separate POSIX from GNU extensions in release messageCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-20Implement missing POSIX function nl_langinfo_lCorinna Vinschen
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>
2016-08-20Introduce __current_locale_charset/__locale_charsetCorinna Vinschen
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>
2016-08-20Only define __getreent inline function when building newlib or CygwinCorinna Vinschen
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>
2016-08-19Add release message for commit eb61113Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-19Add release message for commit a871644Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-19Simplify "Windows-standard-like" permissionsCorinna Vinschen
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>
2016-08-19Fix outdated S_JUSTCREATED commentCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-19Fix html buildThomas Preud'homme
2016-08-19Fix html build with makeinfo 5.2Thomas Preudhomme
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.
2016-08-18Reinstantiate Cygwin function called `__getreent'Corinna Vinschen
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>
2016-08-18Revert "Fix __getreent function for Cygwin"Corinna Vinschen
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>
2016-08-18Workaround AzureAD shortcomingsCorinna Vinschen
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>