summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: clock.h: add valid_timespec() to check timespec for validityCorinna Vinschen2019-01-186-23/+19
| | | | | | Use throughout, drop local timespec_bad() in timer.cc. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd/signalfd: return EINVAL from writeCorinna Vinschen2019-01-173-6/+21
| | | | | | | Linux returns EINVAL, "fd is attached to an object which is unsuitable for writing". If we don't handle write locally, write returns EBADF. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: implement TFD_IOC_SET_TICKS ioctlCorinna Vinschen2019-01-163-2/+34
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: implement execve semanticsCorinna Vinschen2019-01-163-15/+28
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: implement fork semanticsCorinna Vinschen2019-01-164-20/+58
| | | | | | | | | | | | | | | | | | | | | | | - Puzzeling: Commit ec98d19a08c2e4678e8a6f40fea0c9bbeaa4a2c7 changed ttstart to NO_COPY but kept all the code to handle fixup after fork. Revert to not-NO_COPY and make timerfd fork work. - On fixup_after_fork, keep timerfd timers and restart thread if they were armed in the parent. - Move timerfd timer_trackers to cygheap. Overload timer_tracker new and delete methods to handle timers accordingly. This is not exactly required for fork, but exec will be grateful. - Give up on TFD_TIMER_CANCEL_ON_SET for now. There's no easy way to recognize a discontinuous change in a clock. - Be paranoid when cleaning out ttstart. - Fix some minor issues. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork: move extern declarations to appropriate headersCorinna Vinschen2019-01-163-2/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: fix overrun computationCorinna Vinschen2019-01-161-17/+8
| | | | | | | | | | | - Drop initial overrun computation from timer_tracker::settimer. It's performed in timer_tracker::thread_func anyway. - Fix regression in returning correct overrun count narrowed down to int from timer_getoverrun. This has been introduced by changing overrun_count_curr to LONG64. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd_create: add missing typeCorinna Vinschen2019-01-161-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timers: implement timerfdCorinna Vinschen2019-01-1516-51/+591
| | | | | | | | | | | | First cut of a timerfd implementation. Still TODO: - fork/exec semantics - timerfd_settime TFD_TIMER_CANCEL_ON_SET flag - ioctl(TFD_IOC_SET_TICKS) - bug fixes Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signalfd: set st_mode in fhandler_signalfd::fstatCorinna Vinschen2019-01-152-3/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signalfd: fix commentCorinna Vinschen2019-01-151-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update config.guess, config.sub to gcc master branch versionsJeff Johnston2019-01-152-611/+626
|
* AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com>Jeff Johnston2019-01-1532-4/+13126
| | | | | | | | | | | | | | Add support for the AMD GCN GPU architecture. This is primarily intended for use with OpenMP and OpenACC offloading. It can also be used for stand-alone programs, but this is intended mostly for testing the compiler and is not expected to be useful in general. The GPU architecture is highly parallel, and therefore Newlib must be configured to use dynamic re-entrancy, and thread-safe malloc. The only I/O available is a via a shared-memory interface provided by libgomp and the gcn-run tool included with GCC. At this time this is limited to stdout, argc/argv, and the return code.
* Cygwin: gentls_offsets: Remove obsolte 'o' regex optionCorinna Vinschen2019-01-151-6/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: tlsoffsets64.h: regenerateCorinna Vinschen2019-01-151-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signalfd: drop incorrect handling of EINTR in read(2)Corinna Vinschen2019-01-151-7/+5
| | | | | | | In case sigwait_common returns EINTR, read wrongly ignores it, so read can't be interrupt by a signal. Fix that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: document POSIX rename semantics availability with W10 1809 onlyCorinna Vinschen2019-01-142-7/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: wincap: split has_posix_file_infoCorinna Vinschen2019-01-143-13/+49
| | | | | | | | | | | | | While FileRenameInformationEx is defined starting with Windows 10 1709 per MSDN, it only starts working in W10 1809, apparently. Users of 1803 report "Function not implemented". Introduce wincap_10_1809 and change the version check in wincapc::init accordingly. Split has_posix_file_info into has_posix_unlink_semantics and has_posix_rename_semantics. Enable the latter only starting with W10 1809. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: signalfd: implement non-polling selectCorinna Vinschen2019-01-149-33/+129
| | | | | | | | | | | | | | | | Allow the signal thread to recognize we're called in consequence of select on a signalfd. If the signal is part of the wait mask, don't call any signal handler and don't remove the signal from the queue, so a subsequent read (or sigwaitinfo/sigtimedwait) still gets the signal. Instead, just signal the event object at _cygtls::signalfd_select_wait for the thread running select. The addition of signalfd_select_wait to _cygtls unearthed the alignment problem of the context member again. To make sure this doesn't get lost, improve the related comment in the header file so that this (hopefully) doesn't get lost (again). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: select: always store the running thread's TLS into select_recordCorinna Vinschen2019-01-141-1/+3
| | | | | | This allows select threads to access our current tls if required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: document wctype changesCorinna Vinschen2019-01-132-0/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* update to Unicode 11.0Thomas Wolff2019-01-134-93/+159
|
* map WEOF to undefined rather than the control char categoryThomas Wolff2019-01-131-1/+1
| | | | Fixes https://cygwin.com/ml/cygwin/2018-12/msg00173.html
* Cygwin: signal: implement signalfdCorinna Vinschen2019-01-1317-4/+397
| | | | | | | | | | | | | First cut of a signalfd implementation. Still TODO: Non-polling select. This should mostly work as on Linux except for missing support for some members of struct signalfd_siginfo, namely ssi_fd, ssi_band (both SIGIO/SIGPOLL, not fully implemented) and ssi_trapno (HW exception, required HW support). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: proc fd: return EACCES for HANDLE-less fdsCorinna Vinschen2019-01-131-0/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: minor cleanupsCorinna Vinschen2019-01-133-6/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: select: fix overwriting fd sets if poll returns no fdCorinna Vinschen2019-01-132-6/+11
| | | | | | | | | | | | | | | | | There's a long-standing bug in select. If we have poll-only descriptors in the fd set, select overwrites the incoming fd sets with the polling result. If none of the fds is ready, select has to loop again. But now the fd sets are set to all zero and select hangs. Fix this by utilizing the local fd sets r, w, e as storage for the incoming fd sets and use them to initialize select_stuff. If we have to loop, overwritung the incoming fd sets doesn't matter. While at it, rename r, w, e to readfds_in, writefds_in, exceptfds_in. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fhandler_pipe: unify format directivesCorinna Vinschen2019-01-131-4/+4
| | | | | The format directives in sscanf/__small_sprintf are not matching. Fix that.
* Cygwin: posix timers: implement timer_getoverrunCorinna Vinschen2019-01-1210-13/+159
| | | | | | | - set DELAYTIMER_MAX to INT_MAX - make sure to set siginfo_t::si_overrun, as on Linux Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: some cleanupCorinna Vinschen2019-01-122-12/+12
| | | | | | | | - use int64_t instead of long long - make is_timer_tracker const - improve copyright header comment Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: convert timer_tracker::fixup_after_fork to static methodCorinna Vinschen2019-01-122-4/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: move definition of timer_tracker class to new timer.hCorinna Vinschen2019-01-122-29/+42
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: clock_nanosleep is not supposed to crash, return EFAULT insteadCorinna Vinschen2019-01-111-5/+21
| | | | | | ...in case rqtp or rmtp specified invalid addresses. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timer: convert timer_tracker to a real C++ classCorinna Vinschen2019-01-111-55/+84
| | | | | | ...with private members and all the jazz Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: af_unix_spinlock_t: add initializerKen Brown2019-01-101-1/+2
| | | | Also fix a typo.
* Cygwin: try_to_bin: don't check recycler filename all the timeCorinna Vinschen2019-01-091-33/+38
| | | | | | | | | | | | | So far we check the recycler name all the time, and the last interation also only managed to handle two ways to write the recycler. However, an adventurous user might change the case of the recycler arbitrarily. Fix this problem by keeping track of the name in a somewhat relaxed fashion. Use camel back on drive C by default, all upper case elsewhere. Only if the rename op fails do we fix the recycler name on the fly when trying to create it, and it turns out it already existed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: try_to_bin: fix rootdir handle after reopeningCorinna Vinschen2019-01-091-0/+2
| | | | | | | | | | If the first rename fails, we reopen the rootdir for creating a subdir. The rootdir handle can change its value at this point, but the code doesn't take this into account. The subsequent rename then fails with STATUS_INVALID_HANDLE. Fix this by copying the new rootdir value to pfri->RootDirectory. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: rename: use FILE_RENAME_POSIX_SEMANTICS if availableCorinna Vinschen2019-01-093-4/+36
| | | | | | starting with W10 1709 on local NTFS drives Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: rename: rename incoming flags argument to at2flagsCorinna Vinschen2019-01-091-3/+3
| | | | | | Avoid name confusion with later used flags variable Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: try_to_bin: don't reopen the fileCorinna Vinschen2019-01-081-25/+30
| | | | | | | | | | | | | | | | So far we reopened the file if it was opened case sensitive to workaround the problem that the recycler could be named in camel back or all upper case, depending on who created it. That's a problem for O_TMPFILE on pre-W10. As soon as the original HANDLE gets closed, delete-on-close is converted to full delete disposition and all useful operations on the file cease to work (STATUS_ACCESS_DENIED or STATUS_FILE_DELETED). To avoid that problem drop the reopen code and check for the exact recycler filename, either $Recycle.Bin or $RECYCLE.BIN, if the file has been opened case sensitive. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: open: workaround reopen file w/ delete disposition setCorinna Vinschen2019-01-081-0/+17
| | | | | | | | On pre-W10 systems there's no way to reopen a file by handle if the delete disposition is set. We try to get around with duplicating the handle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: open: handle O_CLOEXEC when opening file from handleCorinna Vinschen2019-01-081-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fhandler_process_fd: Fix spacingCorinna Vinschen2019-01-081-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: remove unused tmpbuf.hCorinna Vinschen2019-01-081-25/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* fcntl.h: expose AT_EMPTY_PATH with _GNU_SOURCE onlyCorinna Vinschen2019-01-071-0/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: linkat: support Linux-specific AT_EMPTY_PATH flagCorinna Vinschen2019-01-074-2/+25
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: open: support Linux-specific O_PATH flagCorinna Vinschen2019-01-078-4/+74
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: rename pipe.cc to fhandler_pipe.ccCorinna Vinschen2019-01-073-71/+71
| | | | | | move pipe syscalls to syscalls.cc Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: move fhandler_cygdrive methods into own source fileCorinna Vinschen2019-01-073-137/+159
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop redundant includes from fhandler_process_fd.ccCorinna Vinschen2019-01-061-14/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>