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
path: root/winsup
AgeCommit message (Collapse)Author
2017-04-19strace: Fix "over-optimization" flaw in strace.Daniel Santos
Recent versions of gcc are optimizing away the TLS buffer allocated in main, so we need to tell gcc that it's really used. RtlSecureZeroMemory accomplishes this while also inlining the memset. Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
2017-04-19cygwin doc: install-html: install docbook.cssCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-19cygwin doc: install-html: link index.html instead of copyingCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-18newlib: remove __infinity{f,ld} constantsCorinna Vinschen
previous commit 4c90db7bc89e7fa1077025fefdd58269dc71a6ac introduced a compile time error because libm/common/s_infconst.c used the remove __fmath, __dmath, and __ldmath union types. Since this is very old, and unused for a very long time, just drop the file and thus the __infinity constants entirely. Exception: Cygwin exports __infinity from the beginning. There's a very, VERY low probability that any existing executable or lib still uses this constant, but we just keep it in for backward compat, nevertheless. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-10Avoid decimal point localization in /proc/loadavgJon Turney
Explicitly format the contents of /proc/loadavg to avoid the decimal point getting localized according to LC_NUMERIC. Using anything other than '.' is wrong and breaks top. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-04-06mkvers.sh: Remove "function" to avoid dash objecting to bash-ism.Mark Geisert
2017-04-04Make ldd stop after any non-continuable exceptionJon Turney
Ensure that ldd always stops when the exception is flagged as non-continuable. Also arrange for ldd to exit with a non-zero exit code if something went wrong which prevented us from listing all dynamic dependencies. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-04-04Cygwin: Export reallocarrayCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-04Bump Cygwin to 2.8.1Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-28Add latest changes to Cygwin release informationCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-28Change CURR_SHARED_MAGIC to account for getloadavg patchCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-28Implement getloadavg()Jon Turney
v2: autoload PerfDataHelper functions Keep loadavg in shared memory Guard loadavg access by a mutex Initialize loadavg to the current load v3: Shared memory version bump isn't needed if we are only extending it Remove unused autoload Mark inititalized flags as NO_COPY for correct behaviour in fork child Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-28declaration of ppoll() by poll.h should be guarded by _GNU_SOURCEJon Turney
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-27Recognize Netapp mode supporting reparse pointsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygwin: Do not generate surrogate chars on netappCorinna Vinschen
Just like Samba, Netapp FSes seem to dislike invalid surrogate usage in filenames. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24Document cygserver changesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: Speed up non-debug scenarioCorinna Vinschen
_log/_vlog were always called so we always had a function call hit even if we're not debugging. Expand on the debugging macros so the decision to call _log/_vlog is done in the caller already. Also, make a log level difference between syscall_printf and system_printf. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: Small code cleanupCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: Revamp thread sleep handlingCorinna Vinschen
The current implementation is a very simple approach to implement a statically sized sleep queue. The problem is that this code requires a certain amount of synchronization because the slots in the queue are used dynamically. To top it off, the Event objects used for sync'ing are created and destroyed on demand. This is complicated, slow, and error prone. There's also a blatant bug here: The number of slots in the queue was wrongly computed in size. It was too small if XSI IPC was used a lot. Make the code more robust. Let the queue have the right size. Every slot is now used for a specific IPC object. All sync objects (switched to Semaphores) are only created when first required, but never destroyed. This reduces the usage of a critical section to the creation of a new sync object. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: raise number of worker threads on demandCorinna Vinschen
The number of threads in the worker pool is fixed so far. This is a problem in XSI IPC scenarions with an unknown number of consumers. It doesn't make sense to make the pool very big for a start, but when the need arises, we need to make sure we can serve the request even if all other worker threads are in a wait state. This patch changes threaded_queue to just add another worker thread if all current workers are busy. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: Only print basename of source in debug output to raise readabilityCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24cygserver: Seralize debug output to stdout to raise readabilityCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-22dlfcn: Remove stray debug outputnewlib-snapshot-20170323Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-22Rename <sys/_locale.h> to <xlocale.h>Yaakov Selkowitz
The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin. While, like on some of those systems, it is automatically included by <locale.h> with the proper feature test macros, its presence under this particular name is still presumed in real-world software. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-03-21Cygwin: dlfcn: Fix reference countingCorinna Vinschen
The original dll_init code was living under the wrong assumption that dll_dllcrt0_1 and in turn dll_list::alloc will be called for each LoadLibrary call. The same wrong assumption was made for cygwin_detach_dll/dll_list::detach called via FreeLibrary. In reality, dll_dllcrt0_1 gets only called once at first LoadLibrary and cygwin_detach_dll once at last FreeLibrary. In effect, reference counting for DLLs was completely broken after fork: parent: l1 = dlopen ("lib1"); // LoadLibrary, LoadCount = 1 l2 = dlopen ("lib1"); // LoadLibrary, LoadCount = 2 fork (); // LoadLibrary in the child, LoadCount = 1! child: dlclose (l1); // FreeLibrary actually frees the lib x = dlsym (l2); // SEGV * Move reference counting to dlopen/dlclose since only those functions have to keep track of loading/unloading DLLs in the application context. * Remove broken accounting code from dll_list::alloc and dll_list::detach. * Fix error handling in dlclose. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-14Add release message for commit 973f766f6Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-14Revert "Add release message for commit 973f766f6"Corinna Vinschen
This reverts commit 125852d77b65fe2155d0d5fa97e53fc9e2b29984. Accidentally commited too much.
2017-03-14Add release message for commit 973f766f6Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12Extend 2.8.0 release textCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12Implement fhandler_dev_null::write to workaround a problem with NULCorinna Vinschen
Windows NUL device returns only the lower 32 bit of the number of bytes written. Implement a fake write function to ignore the underlying NUL device. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12Return value from write is ssize_t, not intCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-11getrandom: it's MIN, not MAXYaakov Selkowitz
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10Belatedly bump Cygwin DLL version to 2.8.0Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10Drop now unused child_info_fork::from_mainCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10fork: Don't copy _main_tls->local_clib from *_impure_ptrCorinna Vinschen
So far we copy *_impure_ptr into _main_tls->local_clib if the child process has been forked from a pthread. But that's not required. The local_clib area of the new thread is on the stack and the stack gets copied from the parent anyway (in frok::parent). So we only have to make sure _main_tls is pointing to the right address and do the simple post-fork thread init. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10_dll_crt0: Drop incorrect check for being started from parent main threadCorinna Vinschen
This test was broken from the start. It leads to creating a completely new stack for the main thread of the child process when started from the main thread of the parent. However, the main thread of a process can easily running on a completely different stack, if the parent's main thread was created by calling fork() from a pthread. For an example, see https://cygwin.com/ml/cygwin/2017-03/msg00113.html Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10errno: Stop using _impure_ptr->_errno completelyCorinna Vinschen
We use errno AKA _REENT->_errno since the last century and only set _impure_ptr->_errno for backward compat. Stop that. Also, remove the last check for _impure_ptr->_errno in Cygwin code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10Drop redundant brackets in call to _reclaim_reentCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-08Implement dladdr() (partially)Jon Turney
Note that this always returns with dli_sname and dli_saddr set to NULL, indicating no symbol matching addr could be found. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-08yield: Don't lower thread priority, it leads to starvationCorinna Vinschen
...and it's not required anymore to have the same effect as the original code post-XP. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-08Cygwin: Emit correct errno EAGAIN if we can't create another threadCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-07Export timingsafe_bcmp and timingsafe_memcmpJon Turney
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-07Document pthread_cond_wait change in release notesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-07Cygwin: pthread_cond_wait: Do as Linux and BSD do.Corinna Vinschen
POSIX states as follows about pthread_cond_wait: If a signal is delivered to a thread waiting for a condition variable, upon return from the signal handler the thread resumes waiting for the condition variable as if it was not interrupted, or it returns zero due to spurious wakeup. Cygwin so far employs the latter behaviour, while Linux and BSD employ the former one. Align Cygwin behaviour to Linux and BSD. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-03cwdstuff: Don't leave from setting the CWD prematurely on initCorinna Vinschen
There are certain, very obscure scenarios, which render the Windows CWD handle inaccessible for reopening. An easy one is, the handle can be NULL if the permissions of the CWD changed under the parent processes feet. Originally we just set errno and returned, but in case of init at process startup that left the "posix" member NULL and subsequent calls to getcwd failed with EFAULT. We now check for a NULL handle and change the reopen approach accordingly. If that doesn't work, try to duplicate the handle instead. If duplicating fails, too, we set the dir handle to NULL and carry on. This will at least set posix to some valid path and subsequent getcwd calls won't fail. A NULL dir handle is ok, because we already do this for virtual paths. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-02-28Preserve order of dlopen'd modules in dll_list::topsortnewlib-snapshot-20170228David Allsopp
This patch alters the behaviour of dll_list::topsort to preserve the order of dlopen'd units. The load order of unrelated DLLs is reversed every time fork is called, since dll_list::topsort finds the tail of the list and then unwinds to reinsert items. My change takes advantage of what should be undefined behaviour in dll_list::populate_deps (ndeps non-zero and ndeps and deps not initialised) to allow the deps field to be initialised prior to the call and appended to, rather than overwritten. All DLLs which have been dlopen'd have their deps list initialised with the list of all previously dlopen'd units. These extra dependencies mean that the unwind preserves the order of dlopen'd units. The motivation for this is the FlexDLL linker used in OCaml. The FlexDLL linker allows a dlopen'd unit to refer to symbols in previously dlopen'd units and it resolves these symbols in DllMain before anything else has initialised (including the Cygwin DLL). This means that dependencies may exist between dlopen'd units (which the OCaml runtime system understands) but which Windows is unaware of. During fork, the process-level table which FlexDLL uses to get the symbol table of each DLL is copied over but because the load order of dlopen'd DLLs is reversed, it is possible for FlexDLL to attempt to access memory in the DLL before it has been loaded and hence it fails with an access violation. Because the list is reversed on each call to fork, it means that a subsequent call to fork puts the DLLs back into the correct order, hence "even" invocations of fork work! An interesting side-effect is that this only occurs if the DLLs load at their preferred base address - if they have to be rebased, then FlexDLL works because at the time that the dependent unit is loaded out of order, there is still in memory the "dummy" DONT_RESOLVE_DLL_REFERENCES version of the dependency which, as it happens, will contain the correct symbol table in the data section. For my tests, this initially appeared to be an x86-only problem, but that was only because the two DLLs on x64 should have been rebased. Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-02-24Add 2.7.1 release fileCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-02-24Generate output with Unix line endings even from Mingw64 utilsCorinna Vinschen
This affects cygcheck and strace. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-02-24Bump Cygwin version to 2.7.1Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-02-16fix parallel build for version.cc and winver.oMichael Haubenwallner
Creating both version.cc and winver.o at once really should run once only.