summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: tcp: Support TCP_USER_TIMEOUTCorinna Vinschen2020-07-014-0/+51
| | | | | | Use TCP_MAXRTMS on newer systems, TCP_MAXRT on older systems. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tcp: Support TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVLCorinna Vinschen2020-07-015-12/+178
| | | | | | | | | | Use WSAIoctl(SIO_KEEPALIVE_VALS) on older systems. Make sure that keep-alive timeout is equivalent to TCP_KEEPIDLE + TCP_KEEPCNT * TCP_KEEPINTVL on older systems, even with TCP_KEEPCNT being a fixed value on those systems. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tcp: Support TCP_FASTOPENCorinna Vinschen2020-07-015-4/+93
| | | | | | TCP_FASTOPEN is supported since W10 1607. Fake otherwise. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tcp: fix IPPROTO_TCP option handlingCorinna Vinschen2020-07-013-11/+16
| | | | | | | | | | - Drop definitions from <cygwin/sockets.h> - Drop options only available on BSD - Fix value of TCP_MAXSEG. It was still defined as the BSD value while WinSock uses another value - Handle the fact that TCP_MAXSEG is a R/O value in WinSock Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pty, termios: Unify thoughts of read ahead beffer handling.Takashi Yano via Cygwin-patches2020-07-012-31/+26
| | | | | | | | | | | | | | | - Return value of eat_readahead() is redefined. The return values of fhandler_termios::eat_readahead() and fhandler_pty_slave:: eat_readahead() were little bit different. This patch unifies them to number of bytes eaten by eat_readahead(). - Considerration for raixget() is added to fhandler_pty_master:: accept_input() code. - Transfering contents of read ahead buffer in fhandler_pty_master::transfer_input_to_pcon() is removed since it is not necessary. - fhandler_pty_slave::eat_readahead() ckecks EOL only when ICANON is set. - Guard for _POSIX_VDISABLE is added in checking EOL.
* Cygwin: pty: Discard CSI > Pm m sequence from native windows apps.Takashi Yano via Cygwin-patches2020-07-011-0/+28
| | | | | | | | | - If vim is started from WSL (Ubuntu) which is executed in pseudo console in mintty, shift key and ctrl key do not work. Though this issue is similar to the issue resolved by commit 4527541ec66af8d82bb9dba5d25afdf489d71271, that commit is not effective for this issue. This patch fixes the issue by discarding "CSI > Pm m" in fhandler_pty_master::pty_master_fwd_thread().
* fenv support armEshan dhawan via Newlib2020-06-0923-3/+1393
| | | | Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
* Regenerate libm/machine configuration files for powerpcJeff Johnston2020-06-094-3/+6342
|
* Cygwin: pty: Fix screen distortion after less for native apps again.Takashi Yano via Cygwin-patches2020-06-054-37/+21
| | | | | | | | | | | | | - Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not enough. Moreover, it does not work as expected at all in Win10 1809. This patch essentially reverts that commit and add another fix. After all, the cause of the problem was a race issue in switch_to_pcon_out flag. That is, this flag is set when native app starts, however, it is delayed by wait_pcon_fwd(). Since the flag is not set yet when less starts, the data which should go into the output_handle accidentally goes into output_handle_cyg. This patch fixes the problem more essentially for the cause of the problem than previous one.
* hard float support for PowerPC taken from FreeBSDEshan dhawan via Newlib2020-06-0318-0/+491
| | | | Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
* Bump version to 3.1.6Corinna Vinschen2020-06-011-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pty: Fix screen distortion after using less for native apps.cygwin-3_1_5-releaseTakashi Yano via Cygwin-patches2020-06-011-8/+11
| | | | | | - If the output of non-cygwin apps is browsed using less, screen is ocasionally distorted after less exits. This frequently happens if cmd.exe is executed after less. This patch fixes the issue.
* Cygwin: pty: Revise the code which prevents undesired window title.Takashi Yano via Cygwin-patches2020-05-311-2/+7
| | | | | | | - In current pty, the window title can not be set from non-cygwin program due to the code which prevents overwriting the window title to "cygwin-console-helper.exe" in fhandler_pty_master::pty_ master_fwd_thread(). This patch fixes the issue.
* Cygwin: pty: Clean up fhandler_pty_master::pty_master_fwd_thread().Takashi Yano via Cygwin-patches2020-05-311-18/+0
| | | | - Remove the code which is not necessary anymore.
* Cygwin: console: Discard some unsupported escape sequences.Takashi Yano via Cygwin-patches2020-05-311-16/+38
| | | | | | | | | | | - If the cygwin vim is started from a non-cygwin process which is executed in pseudo console, shift key and ctrl key do not work. In this case, vim is executed under /dev/cons*. If vim outputs escape sequence which is not supported by pseudo console, the escape sequence is leaked into the parent pty. This causes unexpected results. This patch fixes the issue by discarding "CSI > Pm m". "OSC 10;? BEL/ST" and "OSC 11;? BEL/ST" are discarded as well.
* Cygwin: pty: Prevent garbage remained in read ahead buffer.Takashi Yano via Cygwin-patches2020-05-312-3/+14
| | | | | | | | | | | | | | | | - After commit 29431fcb5b14d4c5ac3b3161a076eb1a208349d9, the issue reported in https://cygwin.com/pipermail/cygwin/2020-May/245057.html occurs. This is caused by the following mechanism. Cygwin less called from non-cygwin git is executed under /dev/cons* rather than /dev/pty* because parent git process only inherits pseudo console handle. Therefore, less sets ICANON flag for /dev/cons* rather than original /dev/pty*. When pty is switched to non-cygwin git process, line_edit() is used in fhandler_pty_master::write() only to set input_available_event and read ahead buffer is supposed to be flushed in accept_input(). However, ICANON flag is not set for /dev/pty*, so accept_input() is not called unless newline is entered. As a result, the input data remains in the read ahead buffer. This patch fixes the issue.
* Cygwin: update C++ dialect to gnu++14Corinna Vinschen2020-05-303-25/+25
| | | | | | | | | | Disable -std option since gnu++14 is default anyway, but keep it available as comment. Update dynamic exception specifications deprecated with C++11 to C++11-introduced noexcept expression. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: Make cursor keys work in vim under ConEmu.Takashi Yano via Cygwin-patches2020-05-302-6/+15
| | | | | | - After commit 774b8996d1f3e535e8267be4eb8e751d756c2cec, cursor keys do not work in vim under ConEmu without cygwin-connector. This patch fixes the issue.
* Cygwin: stat: fix st_mode of fifos againKen Brown2020-05-282-1/+4
| | | | | | | This partially reverts commit f36262d56ac78f04de147746ce4a85c6155e4a23. That commit incorrectly made the st_mode of a fifo reflect the Windows permissions of the disk file underlying the fifo.
* Cygwin: pty: Prevent meaningless ResizePseudoConsole() calls.Takashi Yano via Cygwin-patches2020-05-281-9/+9
| | | | | - This patch prevents to call ResizePseudoConsole() unless the pty is resized.
* Cygwin: pty: Fix a bug in free_attached_console().Takashi Yano via Cygwin-patches2020-05-281-1/+4
| | | | | | | | - After commit 7659ff0f5afd751f42485f2684c799c5f37b0fb9, nohup does not work as expected. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin-developers/2020-May/011885.html
* Cygwin: FAQ: fix Cygwin build requirementsCorinna Vinschen2020-05-261-5/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop useless commentCorinna Vinschen2020-05-261-2/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add missing files to 'clean' build ruleCorinna Vinschen2020-05-261-1/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: revamp localtime.o build ruleCorinna Vinschen2020-05-262-5/+8
| | | | | | | | | | | | Rename localtime.c.patched to localtime.patched.c to keep the correct language suffix. Create localtime.patched.c in the build dir rather than in the source dir. Decouple the build rule for creating localtime.patched.c from the rule to build localtime.o, so we don't have to rebuild the patched source file all the time. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: convert localtime_wrapper.c to plain C sourceCorinna Vinschen2020-05-263-22/+18
| | | | | | | | That also requires a small tweak to localtime.c.patch, otherwise GCC complains about the position of the 'trydefrules' label. Also, simplify includes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: rename localtime.cc to localtime_wrapper.cCorinna Vinschen2020-05-252-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: move localtime.o build rule to end of fileCorinna Vinschen2020-05-251-7/+7
| | | | | | | otherwise a simple `make' in the cygwin dir won't build the DLL anymore. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tzcode resync: detailsMark Geisert2020-05-254-0/+486
| | | | | | Add tz_posixrules.h with data generated from most recent Cygwin tzdata package. Establish localtime.cc as primarily a wrapper around a patched copy of localtime.c. See README for more information.
* Cygwin: tzcode resync: importsMark Geisert2020-05-254-0/+3462
| | | | | Import most recent NetBSD localtime.c, private.h, and tzfile.h. An empty namespace.h suffices for Cygwin.
* Cygwin: tzcode resync: basicsMark Geisert2020-05-253-2648/+12
| | | | | | | | | Modifies winsup/cygwin/Makefile.in to build localtime.o from items in new winsup/cygwin/tzcode subdirectory. Compiler option "-fpermissive" is used to accept warnings about missing casts on the return values of malloc() calls. This patch also removes existing localtime.cc and tz_posixrules.h from winsup/cygwin as they are superseded by the subsequent patches in this set.
* Cygwin: fix declaration of __small_{v}sprintfCorinna Vinschen2020-05-252-4/+7
| | | | | | | | | | | Both functions are declared as extern "C" functions in sys/smallprint.h, but as C++ funcs in winsup.h and in the source itself. Add extern "C to definitions, remove declarations in winsup.h and include sys/smallprint.h instead. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pty: Stop counting number of slaves attached to pseudo console.Takashi Yano via Cygwin-patches2020-05-253-20/+6
| | | | | | - The number of slaves attached to pseudo console is used only for triggering redraw screen. Counting was not only needless, but also did not work as expected. This patch removes the code for counting.
* Cygwin: pty: Revise code to make system_printf() work after close.Takashi Yano via Cygwin-patches2020-05-253-3/+37
| | | | | | - After commit 0365031ce1347600d854a23f30f1355745a1765c, the issue https://cygwin.com/pipermail/cygwin-patches/2020q2/010259.html occurs. This patch fixes the issue.
* Cygwin: FIFO: add missing unlockKen Brown2020-05-221-0/+1
| | | | | There was a missing call to reader_opening_unlock on one of the error exits in fhandler_fifo::open.
* Cygwin: FIFO: Revert "take ownership on exec"Ken Brown2020-05-222-99/+40
| | | | | | | | | | | | This reverts commit 39a9cd94651d306117c47ea1ac3eab45f6098d0e. There is no need to explicitly take ownership in fixup_after_exec; if ownership transfer is needed, it will be taken care of by fhandler_fifo::close when the parent closes. Moreover, closing the parent's fifo_reader_thread can cause problems, such as the one reported here: https://cygwin.com/pipermail/cygwin-patches/2020q2/010235.html
* Cygwin: pty: Make system_printf() work after closing pty slave.Takashi Yano via Cygwin-patches2020-05-191-0/+5
| | | | | - Current pty cannot show system_printf() output after closing pty slave. This patch fixes the issue.
* Cygwin: pty: Call FreeConsole() only if attached to current pty.Takashi Yano via Cygwin-patches2020-05-192-15/+14
| | | | | | | | | - After commit 071b8e0cbd4be33449c12bb0d58f514ed8ef893c, the problem reported in https://cygwin.com/pipermail/cygwin/2020-May/244873.html occurs. This is due to freeing console device accidentally rather than pseudo console. This patch makes sure to call FreeConsole() only if the process is attached to the pseudo console of the current pty.
* Reimplement aligned_allocSzabolcs Nagy2020-05-191-32/+30
| | | | | | | | | | | | | | | | | | | | The original implementation had multiple issues: - Only worked when posix_memalign was available (Linux, RTEMS). - Violated C11 link namespace rules by calling posix_memalign. - Failed to set errno on error. These can be fixed by essentially using the same implementation for aligned_alloc as for memalign, i.e. simply calling _memalign_r (which is always available and a "more reserved name" although technically still not in the reserved link namespace, at least code written in c cannot define a colliding symbol, newlib has plenty such namespace issues so this is fine). It is not clear what the right policy is when MALLOC_PROVIDED is set, currently that does not cover aligned_alloc so it is kept that way. Tested on aarch64-none-elf
* Cygwin: termios: Set ECHOE, ECHOK, ECHOCTL and ECHOKE by default.Takashi Yano via Cygwin-patches2020-05-191-1/+2
| | | | | | | | - Backspace key does not work correctly in linux session opend by ssh from cygwin console if the shell is bash. This is due to lack of these flags. Addresses: https://cygwin.com/pipermail/cygwin/2020-May/244837.html.
* cygwin: doc: Add keywords for ACE order issuesDavid Macek via Cygwin-patches2020-05-191-5/+7
| | | | | | | | | | | | Windows Explorer shows a warning with Cygwin-created DACLs, but putting the text of the warning into Google doesn't lead to the relevant Cygwin docs. Let's copy the warning text into the docs in the hopes of helping confused users. Most of the credit for the wording belongs to Yaakov Selkowitz. Latest inquiry: <https://cygwin.com/pipermail/cygwin/2020-May/244814.html> Signed-off-by: David Macek <david.macek.0@gmail.com>
* Cygwin: FIFO: improve the interruptibility of raw_readKen Brown2020-05-111-4/+2
| | | | | | | | During a blocking read, we sleep for 1 ms after each iteration through the connected writers. Currently we do this by calling Sleep (1). Remove this call to Sleep and instead change the timeout in the cygwait call from 0 to 1, so that raw_read can be interrupted while sleeping.
* Cygwin: FIFO: code simplificationKen Brown2020-05-113-67/+44
| | | | | | | | | | | | | | | | | | | | | | | | | There are currently three functions that call NtQueryInformationFile to determine the state of a pipe instance. Do this only once, in a new fifo_client_handler::set_state () function, and call that when state information is needed. Remove the fifo_client_handler methods pipe_state and get_state, which are no longer needed. Make fhandler_fifo::get_fc_handler return a reference, for use in select.cc:peek_fifo. Make other small changes to ensure that this commit doesn't change any decisions based on the state of a fifo_client_handler. The tricky part is interpreting FILE_PIPE_CLOSING_STATE, which we translate to fc_closing. Our current interpretation, which is not changing as a result of this commit, is that the writer at the other end of the pipe instance is viewed as still connected from the point of view of raw_read and determining EOF. But it is not viewed as still connected if we are deciding whether to unblock a new reader that is trying to open.
* Cygwin: fifo: fix type of fifo_reader_id_t operatorsCorinna Vinschen2020-05-081-2/+2
| | | | | | | | fifo_reader_id_t::operator == and != have been defined without type accidentally. For some weird reason, only x86 gcc complains about this problem, not x86_64 gcc. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: add pseudo console patch to release textCorinna Vinschen2020-05-081-0/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document recent FIFO changesKen Brown2020-05-082-0/+10
|
* Cygwin: FIFO: update commentaryKen Brown2020-05-081-23/+35
| | | | | | The beginning of fhandler_fifo.cc contains a long comment giving an overview of the FIFO implementation. This is now updated to describe the support for multiple readers.
* Cygwin: FIFO: support opening multiple readersKen Brown2020-05-082-11/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although we can have multiple readers open because of dup/fork/exec, the current code does not support multiple readers opening a FIFO by explicitly calling 'open'. The main complication in supporting this is that when a blocking reader tries to open and there's already one open, it has to check whether there any writers open. It can't rely on the write_ready event, whose state hasn't changed since the first writer opened. To fix this, add two new named events, check_write_ready_evt and write_ready_ok_evt, and a new method, check_write_ready(). The first event signals the owner's reader thread to call check_write_ready(), which polls the fc_handler list to check for connected writers. If it finds none, it checks to see if there's a writer in the process and then sets/resets write_ready appropriately. When check_write_ready() finishes it sets write_ready_ok_evt to signal the reader that write_ready has been updated. The polling is done via fifo_client_handler::pipe_state(). As long as it's calling that function anyway, check_write_ready() updates the state of each handler. Also add a new lock to prevent a race if two readers are trying to open simultaneously.
* Cygwin: FIFO: allow any reader to take ownershipKen Brown2020-05-083-16/+122
| | | | | | | | | | | | | | | | | | | | | Add a take_ownership method, used by raw_read and select.cc:peek_fifo. It wakes up all fifo_reader_threads and allows the caller to become owner. The work is done by the fifo_reader_threads. For synchronization we introduce several new fhandler_fifo data members and methods: - update_needed_evt signals the current owner to stop listening for writer connections and update its fc_handler list. - shared_fc_handler() gets and sets the status of the fc_handler update process. - get_pending_owner() and set_pending_owner() get and set the reader that is requesting ownership. Finally, a new 'reading_lock' prevents two readers from trying to take ownership simultaneously.
* Cygwin: FIFO: find a new owner when closingKen Brown2020-05-082-11/+112
| | | | | | | | | | | | | | | | If the owning reader is closing, wait for another reader (if there is one) to take ownership before closing the owner's pipe handles. To synchronize the ownership transfer, add events owner_needed_evt and owner_found_evt, and add methods owner_needed and owner_found to set/reset them. Modify the fifo_reader_thread function to wake up all non-owners when a new owner is needed. Make a cosmetic change in close so that fhandler_base::close is called only if we have a write handle. This prevents strace output from being littered with statements that the null handle is being closed.