summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* hash.c: #include <reent.h>Ken Brown2019-07-261-0/+1
| | | | | | This is needed for the prototypes of _stat64 and _fstat64 on Cygwin. Fixes: commit 279805b2 "hash functions: use reentrant stat functions".
* [arm] remove libc/sys/arm/sys/param.hRichard Earnshaw2019-07-261-25/+0
| | | | | | | The Arm sys/param.h does not define anything differently to the generic sys/param.h, but fails to define some things that that file provides. There does not appear to be any reason to keep this version and we should revert to using the common version.
* Port ndbm - Remove Declaration of dbm_forderVaibhav Gupta2019-07-251-3/+0
|
* Cygwin: Fix the address of myselfCorinna Vinschen2019-07-252-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing an independent Cygwin PID introduced a regression: The expectation is that the myself pinfo pointer always points to a specific address right in front of the loaded Cygwin DLL. However, the independent Cygwin PID changes broke this. To create myself at the right address requires to call init with h0 set to INVALID_HANDLE_VALUE or an existing address: void pinfo::init (pid_t n, DWORD flag, HANDLE h0) { [...] if (!h0 || myself.h) [...] else { shloc = SH_MYSELF; if (h0 == INVALID_HANDLE_VALUE) <-- !!! h0 = NULL; } The aforementioned commits changed that so h0 was always NULL, this way creating myself at an arbitrary address. This patch makes sure to set the handle to INVALID_HANDLE_VALUE again when creating a new process, so init knows that myself has to be created in the right spot. While at it, fix a potential uninitialized handle value in child_info_spawn::handle_spawn. Fixes: b5e1003722cb ("Cygwin: processes: use dedicated Cygwin PID rather than Windows PID") Fixes: 88605243a19b ("Cygwin: fix child getting another pid after spawnve") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Don't change pgid to ctty pgid under debuggerCorinna Vinschen2019-07-251-1/+5
| | | | | | | | | | | | | _pinfo::set_ctty sets myself's pgid to the ctty pgid if the process has been started from a non-Cygwin process. This isn't the right thing to do when started from GDB. GDB starts the application via standard Windows means, not via Cygwin fork/exec, so it's treated as being a non-Cygwin parent. But we want the app running in it's own process group. So skip this step when running under a debugger Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* Cygwin: Export newlib ndbm functionsCorinna Vinschen2019-07-244-1/+25
| | | | Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* hash functions: use reentrant stat functionsCorinna Vinschen2019-07-241-6/+6
| | | | | | | _stat64 and _fstat64 are not exported from Cygwin. Use the reentrant analogues, like everywhere else. Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* MSP430: Remove .init/.fini sectionsJozef Lawrynowicz2019-07-245-157/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .init/.fini sections are not required for msp430-elf, and add unnecessary code bloat to the CRT library. These sections are specified as "unused" by the MSP430 EABI. .init existed to call __crt0_run_{init,preinit}_array which run through the functions in .{init,preinit}_array. __crt0_run_{init,preinit}_array are already dynamically included like the other crt0 functions, so these can be placed before the call to main, which ensures they are still called if needed. With these functions moved, .init has no purpose and can be removed. .fini existed to call __crt0_run_fini_array. However, the "__msp430_fini" symbol which marks the start of .fini has never been used, so no termination routines have ever been run for msp430. On returning from main(), _exit() is called which just loops forever. So there is no current expectation that __crt0_run_fini_array will get called by the CRT code. Further work is to ensure functions registered with atexit can be optionally called during program termination, and then __crt0_run_fini_array can be registered with atexit during program initialization. The mechanisms for supporting the "-minrt" option have also been removed. "-minrt" enabled a "minimum runtime environment" by removing calls to functions which run global static initializers and constructors. Since this behaviour is now dynamic, and these functions are only included when needed, the minrt versions of the CRT object files are no longer required.
* Cygwin: document the last bug fixKen Brown2019-07-241-0/+3
|
* Cygwin: fhandler_termios::tcsetpgrp: check that argument is non-negativeKen Brown2019-07-241-0/+5
| | | | | | | | | | | | | | | | | | Return -1 with EINVAL if pgid < 0. Previously tcsetpgrp() would blindly go ahead and set the pgid of the controlling terminal to a negative value, causing later calls to various functions to fail. For example, gdb has code like the following: tcsetpgrp (0, getpgid (inf->pid)); If getpgid (inf->pid) fails (returns -1), then this code would set the pgid of fd 0 to -1, so that some later calls to getpgid() would also return -1. This caused the problem reported here: https://cygwin.com/ml/cygwin/2019-07/msg00166.html.
* Regenerate newlib/libc/search/Makefile.in for ndpm portCorinna Vinschen2019-07-241-20/+42
| | | | Signed-off-by: Corinna Vinschen <corinna-cygwin@cygwin.com>
* fix compile errors for efgcvt.cuchan-nos2019-07-241-15/+18
|
* Port ndbmVaibhav Gupta2019-07-243-0/+311
|
* Stack Pointer and Stack Limit initialization refactored.Alexander Fedotov2019-07-234-178/+454
| | | | | | | | | SP initialization changes: 1. set default value in semihosting case as well 2. moved existing SP & SL init code for processor modes in separate routine and made it as "hook" 3. init SP for processor modes in Thumb mode as well Add new macro FN_RETURN, FN_EH_START and FN_EH_END.
* Cygwin: fix one more check for positive virtual_ftype_t valuesKen Brown2019-07-222-6/+1
| | | | Also drop more comments referring to numerical virtual_ftype_t values.
* Cygwin: change virtual_ftype_t to not rely on negative valuesCorinna Vinschen2019-07-229-36/+31
| | | | | | | | | | | | | So far negative values were denoting files, positive values denoting directories. We should prefer a less error prone method. Redefine virtual_ftype_t to contain only positive values and replace checks for negativ or positive values with inline functions virt_ftype_isfile() and virt_ftype_isdir(). Drop outdcated comments referring to numerical virtual_ftype_t values. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix /proc/PID/fd return value in error caseCorinna Vinschen2019-07-221-2/+2
| | | | | | | | | | | | commit 2607639992f6 "Improve error handling in /proc/[pid]/ virtual files." changed the return value of the /proc/PID formatting functions to return -1 instead of 0 in the error case to allow a filesize of 0. The patch neglected to change this behaviour for /proc/PID/fd content. This patch fixes that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add release notes for 3.0.8Ken Brown2019-07-221-0/+16
|
* Cygwin: socket files are not lnk special filesKen Brown2019-07-222-3/+5
| | | | | | | | | | | | | Change path_conv::is_lnk_special() so that it returns false on socket files. is_lnk_special() is called by rename2() in order to deal with special files (FIFOs and symlinks, for example) whose Win32 names usually have a ".lnk" suffix. Socket files do not fall into this category, and this change prevents ".lnk" from being appended erroneously when such files are renamed. Remove a now redundant !pc.issocket() from fhandler_disk_file::link().
* Cygwin: remove path_conv::is_fs_device()Ken Brown2019-07-221-2/+2
| | | | It is used only once.
* Cygwin: remove path_conv::is_auto_device()Ken Brown2019-07-222-2/+1
| | | | | | | It is used only once, and the name is supposed to suggest "device that is not based on the filesystem". This intended meaning is clearer if we just replace is_auto_device() by its definition at the place where it's used.
* Cygwin: fhandler_*: remove isdevice() and is_auto_device()Ken Brown2019-07-222-4/+1
| | | | | | isdevice() is used only in the definition of is_auto_device(). And the latter is used only once, in a context where isdevice() always returns true.
* Cygwin: unbreak the build with GCC 7Ken Brown2019-07-192-4/+15
| | | | | | The recent port to GCC 8 used the 'nonstring' attribute, which is unknown to GCC 7. Define and use an 'ATTRIBUTE_NONSTRING' macro instead.
* Cygwin: fix GCC 8.3 'local external declaration' errorsKen Brown2019-07-171-3/+2
| | | | Move external declarations out of function definition.
* Cygwin: fix GCC 8.3 'asm volatile' errorsKen Brown2019-07-171-2/+2
| | | | | | Remove the volatile qualifier, which is no longer allowed outside of the function body. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89585 for discussion.
* Cygwin: suppress GCC 8.3 errors with -Warray-boundsKen Brown2019-07-161-0/+2
|
* Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncationKen Brown2019-07-163-5/+5
|
* Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccessKen Brown2019-07-164-6/+6
|
* Cygwin: sigpending: don't report pending signals for other threadsCorinna Vinschen2019-07-122-2/+10
| | | | | | | | The sigpending mechanism failed to check if the pending signal was a process-wide signal, or a signal for the curent thread. Fix that by adding a matching conditional to wait_sig's __SIGPENDING code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: return full sigset_t from sig_sendCorinna Vinschen2019-07-125-12/+12
| | | | | | | | | | | | | | | So far sig_send's return type is int. The problem with this is that sig_send returns a sigset_t on __SIGPENDING, and sigset_t is defined as long type. So the function only returns the lower 32 bit of sigset_t, which is fine on 32 bit, but casts away the pending RT signals on 64 bit. Fix this by changing the return type of sig_send to sigset_t, so as not to narrow down the sigset when returning from handling __SIGPENDING. Make sure to cast correctly in all invocations of sig_send. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Set errno in expm1{,f} / log1p{,f}Jeff Johnston2019-07-094-6/+14
| | | | | | | | | | | | | 2019-07-09 Joern Rennecke <joern.rennecke@riscy-ip.com> * libm/common/s_expm1.c ("math_config.h"): Include. (expm1): Use __math_oflow to set errno. * libm/common/s_log1p.c ("math_config.h"): Include. (log1p): Use __math_divzero and __math_invalid to set errno. * libm/common/sf_expm1.c ("math_config.h"): Include. (expm1f): Use __math_oflow to set errno. * libm/common/sf_log1p.c ("math_config.h"): Include. (log1pf): Use __math_divzero and __math_invalid to set errno.
* Cygwin: Fix return value of sched_getaffinityMark Geisert2019-06-284-11/+31
| | | | | | Have sched_getaffinity() interface like glibc's, and provide an undocumented internal interface __sched_getaffinity_sys() like the Linux kernel's sched_getaffinity() for benefit of taskset(1).
* sched: Move Cygwin cpuset definitions into Cygwin-specific headerCorinna Vinschen2019-06-273-20/+28
| | | | | | This avoids build breakage on RTEMS. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: honor the O_PATH flag when opening a FIFOKen Brown2019-06-271-1/+10
| | | | | Previously fhandler_fifo::open would treat the FIFO as a reader and would block, waiting for a writer.
* or1k: Avoid write outside setjmp buf & shrink bufMartin Erik Werner2019-06-272-29/+32
| | | | | | | | | | | | Update the offsets used to save registers into the stejmp jmp_buf structure in order to: * Avoid writing the supervision register outside the buffer and thus clobbering something on the stack. Previously the supervision register was written at offset 124 while the buffer was of length 124. * Shrink the jmp_buf down to the size actually needed, by avoiding holes at the locations of omitted registers.
* Cygwin: Build cygwin-console-helper with correct compilerMark Geisert2019-06-271-1/+1
|
* Cygwin: Use correct string conversionMark Geisert2019-06-271-2/+2
| | | | | Correct the string conversion calls so both argv elements get converted at full precision.
* or1k: Correct longjmp return valueMartin Erik Werner2019-06-271-1/+1
| | | | | | | | | | | Invert equality check instruction to correct the return value handling in longjmp. The return value should be the value of the second argument to longjmp, unless the argument value was 0 in which case it should be 1. Previously, longjmp would set return value 1 if the second argument was non-zero, and 0 if it was 0, which was incorrect.
* Cygwin: FIFO: fix a thinko in raw_writeKen Brown2019-06-251-1/+0
| | | | Remove a line that has no effect.
* Tweak release messageKen Brown2019-06-251-1/+1
|
* Cygwin: timerfd: avoid a deadlockKen Brown2019-06-253-1/+28
| | | | | | | | | Add a function timerfd_tracker::enter_critical_section_cancelable, which is like enter_critical_section but honors a cancel event. Call this when a timer expires while the timerfd thread is in its inner loop. This avoids a deadlock if timerfd_tracker::dtor has entered its critical section and is trying to cancel the thread. See https://cygwin.com/ml/cygwin/2019-06/msg00096.html.
* Arm: Use lrdimon-v2m_nano when semihosting v2 and nano selected respectivelyAlexander Fedotov2019-06-251-1/+1
|
* Support calculation of pointer size for __int20__ type in _intsup.hJozef Lawrynowicz2019-06-251-0/+4
| | | | | | | | | GCC r272640 modifies the MSP430 target to use "__int20__" for PTRDIFF_TYPE (and therefore INTPTR_TYPE) instead of "__int20". To support the calculation of pointer size in newlib/libc/include/sys/_intsup.h, definitions for __int20__ need to be added.
* Cygwin: Implement sched_[gs]etaffinity()Mark Geisert2019-06-2411-5/+389
| | | | | | | | | This patch set implements the Linux syscalls sched_getaffinity, sched_setaffinity, pthread_getaffinity_np, and pthread_setaffinity_np. Linux has a straightforward view of the cpu sets used in affinity masks. They are simply long (1024-bit) bit masks. This code emulates that view while internally dealing with Windows' distribution of available CPUs among processor groups.
* Cygwin: FIFO: minor cleanupKen Brown2019-06-232-7/+7
| | | | | | Don't use a label with the same name as a variable. Also fix indentation in fhandler.h.
* Cygwin: FIFO: slightly change the use of write_readyKen Brown2019-06-231-1/+2
| | | | | | | Make it a manual reset event. It's only used once to allow a reader to open, and there's no reason to ever reset it. Defensively set it when a client connection is recorded, even though it should be set by the writer that connected.
* Cygwin: FIFO: remove fifo_client_handler::connect_evtKen Brown2019-06-232-16/+15
| | | | | It's not needed. Instead just create and use an event in fhandler_fifo::listen_client_thread.
* Cygwin: FIFO: simplify raw_readKen Brown2019-06-231-19/+31
| | | | | | Call NtReadFile directly instead of calling fhandler_base::raw_read. In addition to being simpler, this gives us access to the return value from NtReadFile.
* Cygwin: FIFO: improve termination of the listen_client threadKen Brown2019-06-232-15/+55
| | | | | | | | | Add a method fifo_client_handler::pipe_state that queries Windows for the state of a pipe instance. Use this to help terminate the listen_client thread cleanly. If the last client handler is useless, delete it instead of declaring it invalid.
* Cygwin: FIFO: avoid deadlock when closingKen Brown2019-06-231-0/+3
| | | | | | | | fhandler_fifo::close could be called from a signal handler or another thread at a time when another function is holding the fifo_client lock. This could prevent the listen_client thread from acting on the thread termination event. Avoid a deadlock by calling fifo_client_unlock at the beginning of fhandler_fifo::close.