summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Copy prerequisite file for "tiny" printf implementationJozef Lawrynowicz2019-04-151-0/+661
| | | | Use newlib/libc/stdio/nano-vfprintf.c as baseline for tiny-printf.c
* Fix definition of write() to use const char * for the type of the bufferJozef Lawrynowicz2019-04-151-4/+5
|
* Cygwin: use win pid+threadid for forkables dirnameMichael Haubenwallner2019-04-121-19/+7
| | | | | | | | Rather than newest last write time of all dlls loaded, use the forking process' windows pid and windows thread id as directory name to create the forkable hardlinks into. While this may create hardlinks more often, it does avoid conflicts between dlls not having the newest last write time.
* Align comments and spaces in libgloss/arm/crt0.S and ↵Alexander Fedotov2019-04-122-75/+78
| | | | newlib/libc/sys/arm/crt0.S to ease further code alignment.
* Include code in trap.S for APCS only.Christophe Lyon2019-04-112-2/+2
| | | | | | | | | | The code in trap.S is to support the old APCS chunked stack variant, which dates back to the Acorn days, so put it under #ifndef __ARM_EABI__. * libgloss/arm/trap.S: Use __ARM_EABI rather than PREFER_THUMB. * newlib/libc/sys/arm/trap.S: Use __ARM_EABI rather than __thumb2__.
* Make more macro checks ARMv8-M baseline proof.Christophe Lyon2019-04-111-4/+4
| | | | | | | | | | | | Commit 69f4c4029183fb26d2fcae00790881620c1978a3 improved most macro checks to be ARMv8-M baseline proof, but missed a few occurrences which otherwise fail to build when using a CPU setting such as cortex-m0 or cortex-m23. This patch brings the same changes as the ones that were committed to libgloss at that time. newlib: * libc/sys/arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__.
* Improve error handling in /proc/[pid]/ virtual files.Erik M. Bray2019-04-101-7/+28
| | | | | | | | | | | | | | | | | * Changes error handling to allow /proc/[pid]/ virtual files to be empty in some cases (in this case the file's formatter should return -1 upon error, not 0). * Better error handling of /proc/[pid]/stat for zombie processes: previously trying to open this file on zombie processes resulted in an EINVAL being returned by open(). Now the file can be read, and fields that can no longer be read are just zeroed. * Similarly for /proc/[pid]/statm for zombie processes. * Similarly for /proc/[pid]/maps for zombie processes (in this case the file can be read but is zero-length, which is consistent with observed behavior on Linux.
* Cygwin: add latest signal handling fixes to release notesCorinna Vinschen2019-04-063-2/+15
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signals: setcontext: fix setting sigmaskCorinna Vinschen2019-04-051-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: follow context if changed inside SA_SIGINFO signal handlerCorinna Vinschen2019-04-051-1/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signals: make setcontext work from signal handlersCorinna Vinschen2019-04-041-0/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: fix key input for native console applicationTakashi Yano2019-04-031-0/+17
| | | | | | - After 24 bit color support patch, arrow keys and function keys do not work properly in native console applications if they are started in cygwin console. This patch fixes this issue.
* Cygwin: signals: restore sigmask from context given to signal handlerCorinna Vinschen2019-04-031-1/+2
| | | | | | | | | | | | | | | | In case SA_SIGINFO flag is given, the signal handler may change the context and the application is supposed to pick up from the changed context. So far we don't do that, so the context given to the signal handler is basically read-only, unless the signal handler calls setcontext or swapcontext. For a start, restore the thread's signal mask from the uc_sigmask value of the context given to the signal handler. If that's feasible for Cygwin, we restore the entire context from the context changed by the signal handler in a followup patch. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add a dummy interrupt handler to nios2 crt0.s.Sandra Loosemore2019-04-031-1/+13
| | | | | | The location of the handler at offset 0x20 from the start of memory, immediately after the 32-byte reset vector, matches the expectations of real hardware (e.g., a 3c120 board).
* Cygwin: winpids: Fix getting process multiple times, take 2Corinna Vinschen2019-04-023-8/+21
| | | | | | | | | | | | | | | | | | | | | | commit d1be0a59d48222d8ea6261ee3e59de2bc3d149e4, "Cygwin: winpids: Fix getting process multiple times" fixed duplicate processes in ps -W output, but it fixed the symptom, not the cause. It also didn't fix the problem that the `ps' process itself may show up twice in its own output. This patch fixes it. The spawn worker only deleted the "winpid.PID" symlink of the current process if the child is a non-Cygwin process, under the assumption that the exec'ing process exits anyway. However, the Window in which both winpid.PID symlinks point to the same cygpid.PID area is just too long. The spawn worker now also deletes its own winpid.PID symlink if the exec'ed process is a Cygwin process. Additionally the fix from d1be0a59d48222d8ea6261ee3e59de2bc3d149e4 is now performed on the calling process, too. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Add console patches to release notesCorinna Vinschen2019-03-312-0/+15
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: console: Make I/O functions thread-safeTakashi Yano2019-03-313-12/+165
| | | | | | - POSIX states I/O functions shall be thread-safe, however, cygwin console I/O functions were not. This patch makes console I/O functions thread-safe.
* Cygwin: console: fix select() behaviourTakashi Yano2019-03-313-425/+462
| | | | | | - Previously, select() would return when only one key is typed even in canonical mode. With this patch, it returns after one line is completed.
* Cygwin: console: support 24 bit colorTakashi Yano2019-03-316-34/+227
| | | | | | | - Add 24 bit color support using xterm compatibility mode in Windows 10 1703 or later. - Add fake 24 bit color support for legacy console, which uses the nearest color from 16 system colors.
* Cygwin: document ps -W duplication bug fixCorinna Vinschen2019-03-311-0/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: [gs]et_io_handle(): renamed to [gs]et_handle().Takashi Yano2019-03-3014-86/+87
| | | | | | - Unify get_io_handle() and get_handle() to get_handle(). Both of them returned same value; io_handle. - Rename set_io_handle() to set_handle().
* Cygwin: fork: reserve dynloaded dll areas earlierMichael Haubenwallner2019-03-282-6/+6
| | | | | | In dll_crt0_0, both threadinterface->Init and sigproc_init allocate windows object handles using unpredictable memory regions, which may collide with dynamically loaded dlls when they were relocated.
* Cygwin: FIFO: implement clear_readaheadKen Brown2019-03-281-1/+7
| | | | | | Make fhandler_base::clear_readahead virtual, and implement fhandler_fifo::clear_readahead. This is called by dtable::fixup_after_exec; it clears the readahead in each client.
* Cygwin: document the recent FIFO changesKen Brown2019-03-272-0/+26
|
* Cygwin: fix: seteuid32() must return EPERM if privileges are not held.J.H. van de Water2019-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Starting w/ the intro of S4U, seteuid32() calls lsaprivkeyauth(), then s4uauth(). s4uauth calls LsaRegisterLogonProcess(). LsaRegisterLogonProcess fails w/ STATUS_PORT_CONNECTION_REFUSED, if the proper privileges are not held. Because of RtlNtStatusToDosError(), this status would be mapped to ERROR_ACCESS_DENIED, which in turn would map to EACCES. Therefore it is useless to add this status to errmap[] (errno.cc), as s4auauth() should return EPERM as errno here (i.e. if process is not privileged). Hence the kludge. Before the intro of S4U, seteuid32() called lsaprivkeyauth(), then lsaauth(), then create_token(). Before the intro of Vista, the latter would have called NtCreateToken(). NtCreateToken() would have failed w/ STATUS_PRIVILEGE_NOT_HELD for a process w/o the proper privileges. In that case, calling seteuid32() would have returned EPERM (as required). Since the intro of Vista, and if the process had been started from an UNelevated shell, create_token() does NOT reach NtCreateToken()! As create_token() failed to properly set errno in that case, calling seteuid32() would return errno as set by lsaauth(), i.e. EACCES, not in agreement w/ Posix (a bug which was present for years). (lsaauth() called LsaRegisterLogonProcess() which would fail)
* Cygwin: FIFO: add support for the duplex caseKen Brown2019-03-272-11/+73
| | | | | | | | | If a FIFO is opened with O_RDWR access, create the pipe with read/write access, and make the first client have the handle of that pipe as its I/O handle. Adjust fhandler_fifo::raw_read to account for the result of trying to read from that client if there's no data.
* Cygwin: FIFO: avoid crashes when cloning a clientKen Brown2019-03-271-1/+1
| | | | | | | | | | | fhandler_fifo::clone called fhandler_base::clone on each client fhandler. But those fhandlers are actually fhandler_fifo objects, so when fhandler_base::clone calls copyto, it's actually fhandler_fifo::copyto that gets called. This can lead to mysterious crashes. Fix this by simply calling clone (which translates to fhandler_fifo::clone) on each client fhandler.
* Cygwin: FIFO: update selectKen Brown2019-03-273-15/+157
| | | | | | | | | | | | | | Add static functions peek_fifo, thread_fifo, start_thread_fifo, and fifo_cleanup to select.cc. These are based on the corresponding pipe functions, the main difference being that peek_fifo loops through the connected clients to see if any of them have data available for reading. Add the fhandler_fifo methods select_read, select_write, and select_except. Add accessor methods get_nclients, get_handle, and is_connected that are needed by peek_fifo.
* Cygwin: FIFO: update set_close_on_execKen Brown2019-03-271-0/+6
| | | | Deal with each client.
* Cygwin: FIFO: update fixup_after_forkKen Brown2019-03-271-0/+9
| | | | Fixup each client. Reset listen_client_thr and lct_termination_evt.
* Cygwin: FIFO: update clone and dupKen Brown2019-03-272-3/+30
| | | | Deal with all clients.
* Cygwin: FIFO: improve EOF detectionKen Brown2019-03-272-1/+21
| | | | | | Add a hit_eof method that tries to detect whether any clients are connected. Before concluding that there are none, it gives the listen_client thread time to update the client data.
* Cygwin: FIFO: add a spinlockKen Brown2019-03-272-9/+28
| | | | | Don't let listen_client_thread and raw_read access the client list simultaneously.
* Cygwin: FIFO: allow multiple writersKen Brown2019-03-272-32/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a 'fifo_client_handler' structure that can be used by a reader to communicate with a writer using an instance of the named pipe. An fhandler_fifo opened for reading creates a thread that does the following: - maintains a list of fifo_client_handlers - listens for_clients trying to connect - creates new pipe instances as needed so that there's always at least one available for connecting. The pipe instances are initially created in blocking mode, but they are set to be non-blocking after a connection is made. fhandler_fifo::raw_read now loops through the connected clients and reads from the first one that has data available. New fhandler_fifo methods: add_client, listen_client, listen_client_thread, check_listen_client_thread. Replace the create_pipe method by create_pipe_instance, which allows unlimited pipe instances. New helper functions: create_event, set_pipe_non_blocking.
* Cygwin: FIFO: stop using overlapped I/OKen Brown2019-03-272-114/+236
| | | | | | | | | | | | | | | | Make fhandler_fifo a derived class of fhandler_base instead of fhandler_base_overlapped. Replace the create_pipe macro, which is based on fhandler_pipe::create, by new create_pipe and open_pipe methods. These use NT functions instead of Win32 functions. Replace fifo_name by get_pipe_name, which returns a pointer to a UNICODE_STRING. Remove the fnevent macro, which would now be needed only once. Add a raw_write method, adapted from fhandler_base::raw_write. Adapt all functions to the changes above.
* Cygwin: Bump DLL version to 3.1Corinna Vinschen2019-03-271-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: winpids: Fix getting process multiple timesCorinna Vinschen2019-03-271-24/+22
| | | | | | | | | | | | | | | | | | | | | | | Switching to Cywin-only PIDs introduced a new problem when collecting Cygwin processes for `ps -W': A process can show up multiple times again, if the Cygwin procinfo has been opened for a just execing process. The execed process then shows up twice, once as Cygwin process, but with the wrong Windows PID of the execing process, once as Windows-only process. The mechanism used to exclude these stray processes didn't work with the new Cygwin pid handling anymore. To fix this * check if the incoming Windows PID is the same as the PID in the procinfo. If not, we have the PID of the execing process while procinfo was already changed, * always check if the process has already been handled, not only for processes we got a procinfo for, * simplify adding pid to pidlist since pid is now always correct. While at it, fix comments and comment formatting. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add missing includes.Andrew Stubbs2019-03-253-1/+4
| | | | | | These missing includes were causing build warnings, but also a real bug in which the "size" parameter to "write" was being passed in 32-bit, whereas it ought to be 64-bit. This led to intermittent bad behaviour.
* get and convert boot time once and use as neededBrian Inglis2019-03-251-9/+16
|
* default ps -W process start time to system boot time when inaccessible, 0, -1Brian Inglis2019-03-251-0/+11
|
* Cygwin: ctrl_c_handler: Use 64 bit timerCorinna Vinschen2019-03-242-4/+4
| | | | | | Just don't use GetTickCount for obvious reasons Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sys/cygwin.h: fix formattingCorinna Vinschen2019-03-231-3/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: strace: print windows and cygwin pid in event outputCorinna Vinschen2019-03-233-13/+42
| | | | | | | | | | | | | | strace only printed the Windows PID in event output so far. Especially now that Windows and Cygwin PID are decoupled, the strace user might like to see the Cygwin pid in event output as well. However, at process startup, the process might not have a Cygwin PID yet. To mitigate this, always print the Windows PID and only add the Cygwin pid if it exists. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: wcsxfrm_l: Only byte swap if dest size is > 0Corinna Vinschen2019-03-192-9/+15
| | | | | | | | | | | commit c0d7d3e1a2fa96db15613cbd68a68c96966bc402 removed the usage of the LCMAP_BYTEREV flag in the call to LCMapStringW to workaround a strange bug in LCMapStringW. This patch didn't take a userspace call of wcsxfrm{_l} with NULL buffer and 0 size to evaluate the required buffer size into account. This introduced a crash trying to byte swap the NULL buffer. This patch fixes that problem. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* AMD GCN: Implement circular buffering.Andrew Stubbs2019-03-181-17/+38
| | | | | | | | | | | | | | | | | | | The GCN port outputs stdout and stderr via a shared-memory interface. Previously the buffer was limited to 1000 write operations, which was enough for testing purposes, but easy to exhaust. This patch implements a new circular buffering system allowing a greater amount of output. The interface must allow hundreds of hardware threads to output simultaneously. The new limit is UINT32_MAX write operations. Unfortunately, there's no way to tell if the host side has also been updated. This code will misbehave unless the gcn-run from GCC is also updated (although it's fine the other way around), but that patch has already been committed. OK? Andrew Stubbs Mentor Graphics / CodeSourcery
* Cygwin: proc: fix /proc/version output after uname changeCorinna Vinschen2019-03-182-1/+16
| | | | | | | | 3.0.0 changed uname but missed to align /proc/version which then used the old uname function on the new uname struct. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: bump version to 3.0.5Corinna Vinschen2019-03-181-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add semihosting docs for nios2 and m68kcygwin-3_0_4-releaseJeff Johnston2019-03-142-0/+411
| | | | | | | | | | | Author: Sandra Loosemore <sandra@codesourcery.com> Date: Wed Mar 13 20:22:16 2019 -0700 Add semihosting documentation for nios2 and m68k. QEMU maintainers have asked for a specification of the nios2 semihosting interface. Since it's essentially a copy of the m68k implementation, this patch adds a document for that target as well.
* Cygwin: acls: allow converting empty acl to textCorinna Vinschen2019-03-132-2/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc: add missing LF to /proc/<PID>/stat outputCorinna Vinschen2019-03-131-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>