aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-22Cygwin: ptsname_r: always return an error number on failureKen Brown2-1/+4
Return EBADF on a bad file descriptor. Previously 0 was returned, in violation of the requirement in https://man7.org/linux/man-pages/man3/ptsname_r.3.html that an error number should be returned on failure. We are intentionally deviating from Linux, on which ENOTTY is returned. Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00245.html
2021-01-22Cygwin: normalize_posix_path: fix error handling when .. is encounteredKen Brown2-1/+7
When .. is in the source path and the path prefix exists but is not a directory, return ENOTDIR instead of ENOENT. This fixes a POSIX compliance issue for realpath(3): https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00214.html
2021-01-22Cygwin: Move post-dir unlink checkBen Wijen2-20/+28
Move post-dir unlink check from fhandler_disk_file::rmdir to _unlink_nt_post_dir_check If a directory is not removed through fhandler_disk_file::rmdir we can now make sure the post dir check is performed.
2021-01-20Cygwin: console: Fix "Bad file descriptor" error in script command.Takashi Yano via Cygwin-patches3-7/+105
- After the commit 72770148, script command exits occasionally with the error "Bad file descriptor" if it is started in console on Win7 and non-cygwin process is executed. This patch fixes the issue.
2021-01-20Cygwin: pty: Reduce buffer size in get_console_process_id().Takashi Yano via Cygwin-patches1-2/+2
- The buffer used in get_console_process_id(), introduced by commit 72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7. Therefore, the buffer size has been reduced.
2021-01-19Cygwin: pty: Lessen the side effect of workaround for rlwarp.Takashi Yano via Cygwin-patches1-4/+12
- This patch lessens the side effect of the workaround for rlwrap introduced by commit 4e16b033.
2021-01-19Cygwin: spawn.cc: Fix typo in comment by commit 974e6d76.Takashi Yano via Cygwin-patches1-1/+1
2021-01-19Cygwin: rmdir: handle /dev in fhandler_dev::rmdirCorinna Vinschen3-2/+8
The isdev_dev check in rmdir is unclean. Create a virtual method fhandler_dev::rmdir to handle this transparently. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-01-18Cygwin: document a recent bug fixKen Brown1-0/+3
This documents commit aec64798, "Cygwin: add flag to indicate reparse points unknown to WinAPI".
2021-01-18Cygwin: pty: Set input_available_event only for cygwin pipe.Takashi Yano via Cygwin-patches1-1/+2
- cat exits immediately in the following senario. 1) Execute env CYGWIN=disable_pcon script 2) Execute cmd.exe 3) Execute cat in cmd.exe. This is caused by setting input_available_event for the pipe for non-cygwin app. This patch fixes the issue.
2021-01-18Cygwin: pty: Make master thread functions be static.Takashi Yano via Cygwin-patches2-56/+128
- The functions pty_master_thread() and pty_master_fwd_thread() should be static (i.e. should not access class member) because the instance is deleted if the master is dup()'ed and the first master is closed. In this case, because the dup()'ed instance still exists, these master threads are also still alive even though the instance has been deleted. As a result, accesing class members in these functions causes accessi violation. Addresses: https://cygwin.com/pipermail/cygwin-developers/2021-January/012030.html
2021-01-18Cygwin: pty: Prevent pty from changing code page of parent console.Takashi Yano via Cygwin-patches6-11/+155
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console is in legacy mode. This patch avoids this by creating a new invisible console for the first pty started in console device.
2021-01-18cxx.cc: Fix dynamic initialization for static local variablesBen Wijen2-11/+1
The old implementation for __cxa_guard_acquire did not return 1, therefore dynamic initialization was never performed. If concurrent-safe dynamic initialisation is ever needed, CXX ABI must be followed when re-implementing __cxa_guard_acquire (et al.)
2021-01-18syscalls.cc: Use EISDIRBen Wijen1-1/+1
This is the non-POSIX value returned by Linux since 2.1.132.
2021-01-18syscalls.cc: Fix num_linksBen Wijen1-2/+3
NtQueryInformationFile on fh_ro needs FILE_READ_ATTRIBUTES to succeed.
2021-01-18Cygwin: Add Ben Wijen to list of contributorsCorinna Vinschen1-0/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-01-18Cygwin: pty: Make close_pseudoconsole() be a static member function.Takashi Yano via Cygwin-patches3-13/+18
- The function close_pseudoconsole() should be static so that it can be safely called in spawn.cc even after the fhandler_pty_slave instance has been deleted. That is, there is a problem with the current code. This patch fixes the issue.
2021-01-18Cygwin: console: Revise the code to switch xterm mode.Takashi Yano via Cygwin-patches4-62/+127
- If application changes the console mode, mode management introduced by commit 10d8c278 will be corrupted. For example, stdout of jansi v2.0.1 or later is piped to less, jansi resets the xterm mode flag ENABLE_VIRTUAL_TERMINA_PROCESSING when jansi is terminated. This causes garbled output in less because less needs this flag enabled. This patch fixes the issue.
2021-01-18Cygwin: pty: Add workaround for rlwrap 0.40 or later.Takashi Yano via Cygwin-patches1-0/+5
- The workaround for rlwrap introduced by commit 8199b0cc does not take effect for rlwrap 0.40 or later. This patch add a workaround for rlwrap 0.40 or later as well.
2021-01-12Cygwin: fstatat: call fstat64 instead of fstatKen Brown2-1/+7
This fixes a bug on 32-bit Cygwin that was introduced in commit 84252946, "Cygwin: fstatat, fchownat: support the AT_EMPTY_PATH flag". Add a comment explaining why fstat should not be called. Addresses: https://cygwin.com/pipermail/cygwin/2021-January/247399.html
2021-01-05RTEMS: Add <poll.h> and <sys/poll.h>Sebastian Huber3-0/+137
Add the POSIX header file <poll.h> which is used by the GCC 11 Ada runtime support. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2020-12-18Bump up newlib version to 4.1.0newlib-4.1.0Jeff Johnston115-1134/+1140
2020-12-18fixes to make compilation succeedsPaul Zimmermann2-1/+2
2020-12-17Update gamma functions from code in picolibcJeff Johnston4-28/+47
- fixes issue with inf sign when x is -0
2020-12-17fhandler_proc.cc(format_proc_cpuinfo): report Intel SGX bitsBrian Inglis1-0/+2
Update to Linux next 5.10 cpuinfo flags for Intel SDM 36.7.1 Software Guard Extensions, and 38.1.4 SGX Launch Control Configuration. Launch control restricts what software can run with enclave protections, which helps protect the system from bad enclaves.
2020-12-16RISC-V: Add semihosting supportCraig Blackmore22-1/+697
2020-12-16Add declarations for __ieee754_tgamma functions to fdlibm.hJeff Johnston1-0/+2
2020-12-16Cygwin: pty: Revise the workaround for rlwrap.Takashi Yano via Cygwin-patches1-2/+2
- Previous workaround has a problem that screen is distorted if up arrow key is pressed at the first line after running "rlwrap cmd". This patch fixes the issue.
2020-12-16Cygwin: pty: Check response for CSI6n more strictly.Takashi Yano via Cygwin-patches1-2/+6
- Previous code to read response for CSI6n allows invalid response such as "CSI Pl; Pc H" other than correct response "CSI Pl; Pc R". With this patch, the response is checked more strictly.
2020-12-15Cygwin: Make sure newer apps get uname_x even when loading uname dynamicallyCorinna Vinschen2-0/+10
if an application built after API version 334 loads uname dynamically, it actually gets the old uname, rather than the new uname_x. Fix this by checking the apps API version in uname and call uname_x instead, if it's a newer app. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-12-14arm: Fix memchr() for Armv8-RSebastian Huber1-0/+4
The Cortex-R52 processor is an Armv8-R processor with a NEON unit. This fix prevents conflicting architecture profiles A/R errors issued by the linker. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2020-12-14Cygwin: pty: Add a workaround for rlwrap.Takashi Yano via Cygwin-patches1-0/+5
- If rlwrap is used with non-cygwin apps, it fails to setup pseudo console. This patch adds a workaround for this issue.
2020-12-14Cygwin: pty: Revise the code for timeout in term_has_pcon_cap().Takashi Yano via Cygwin-patches1-3/+3
- Sometimes timeout period in term_has_pcon_cap() may not be enough when the machine slows down for some reason. This patch eases the issue. In the new code, effective timeout period is expected to be extended as a result due to slowing-down the wait loop as well when the machine gets into busy.
2020-12-14Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.Takashi Yano via Cygwin-patches2-3/+1
- This patch skips unnecessary term_has_pcon_cap() call if pseudo console is disabled.
2020-12-11Fix error in powf for x close to 1 and large yFabian Schriever1-1/+1
This patch fixes the error found by Paul Zimmermann (see https://homepages.loria.fr/PZimmermann/papers/#accuracy) regarding x close to 1 and rather large y (specifically he found the case powf(0x1.ffffeep-1,-0x1.000002p+27) which returns +Inf instead of the correct value). We found 2 more values for x which show the same faulty behaviour, and all 3 are fixed with this patch. We have tested all combinations for x in [+1.fffdfp-1, +1.00020p+0] and y in [-1.000007p+27, -1.000002p+27] and [1.000002p+27,1.000007p+27].
2020-12-11Bump newlib release to 4.0.0Jeff Johnston115-1136/+1151
2020-12-10cygwin: use CREATE_DEFAULT_ERROR_MODE in spawnJeremy Drake via Cygwin-patches1-0/+7
This allows native processes to get Windows-default error handling behavior (such as invoking the registered JIT debugger).
2020-12-07Cygwin: dtable::dup_worker: update comment and debug outputKen Brown1-4/+1
The comment and debug output became obsolete in commit 23771fa1f7 when dup_worker started calling fhandler_base::clone instead of build_fh_pc and fhandler_base::operator=.
2020-12-07Cygwin: Allow to set SO_PEERCRED zero (v2)Mark Geisert1-3/+7
The existing code errors as EINVAL any attempt to set a value for SO_PEERCRED via setsockopt() on an AF_UNIX/AF_LOCAL socket. But to enable the workaround set_no_getpeereid behavior for Python one has to be able to set SO_PEERCRED to zero. Ergo, this patch. Python has no way to specify a NULL pointer for 'optval'. This v2 of patch allows the original working (i.e., allow NULL,0 for optval,optlen to mean turn off SO_PEERCRED) in addition to the new working described above. The sense of the 'if' stmt is reversed for readability.
2020-12-07Cygwin: Launch cygmagic with bash, not shMark Geisert1-2/+2
On some systems /bin/sh is not /bin/bash and cygmagic has bash-isms in it. So even though cygmagic has a /bin/bash shebang, it also needs to be launched with bash from within Makefile.in.
2020-12-07Fix trace output for getdomainname()Anton Lavrentiev via Cygwin-patches1-1/+1
2020-12-04winsup/doc/Makefile.in: create man5 dir and install proc.5Brian Inglis1-0/+4
2020-12-04specialnames.xml: add proc(5) Cygwin man pageBrian Inglis1-0/+2094
2020-12-02Cygwin: Fix remaining warnings building path testsuiteCorinna Vinschen4-11/+11
2020-12-02Cygwin: Fix building of utils testsuiteJon Turney2-1/+5
Avoid referencing undefined max_mount_entry.
2020-12-02Cygwin: add flag to indicate reparse points unknown to WinAPICorinna Vinschen2-4/+16
https://cygwin.com/pipermail/cygwin/2020-December/246938.html reports a problem where, when adding a Cygwin default symlink to $PATH since Cygwin 3.1.5, $PATH handling appears to be broken. 3.1.5 switched to WSL symlinks as Cygwin default symlinks. A piece of code in path handling skips resolving reparse points if they are the last component in the path. Thus a reparse point in $PATH is not resolved but converted to Windows path syntax verbatim. If you do this with a WSL symlink, certain WinAPI functions fail. The underlying $PATH handling fails to recognize the reparse point in $PATH and returns with STATUS_IO_REPARSE_TAG_NOT_HANDLED. As a result, the calling WinAPI function fails, most prominently so CreateProcess. Fix this problem by adding a PATH_REP_NOAPI bit to path_types and a matching method path_conv::is_winapi_reparse_point(). Right now this flag is set for WSL symlinks and Cygwin AF_UNIX sockets (new type implemented as reparse points). The aforementioned code skipping repare point path resolution calls is_winapi_reparse_point() rather than is_known_reparse_point(), so now path resolution is only skipped for reparse points known to WinAPI. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-12-02Cygwin: path.h: add comments to briefly explain path_typesCorinna Vinschen1-5/+5
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-12-02Cygwin: testsuite: libltp: fix warnings showing up with -WallCorinna Vinschen4-12/+19
This libltp is old as old dirt and still using K&R style. If it's really to be used again at all, it needs a serious refresh. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-12-01Cygwin: /proc/sys FS: don't export NFS and DFS as block devicesCorinna Vinschen1-4/+1
Network filesystems are not block devices. Apparently this code hasn't been executed anyway, given how network filesystems are hidden behind \Device\Mup. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-11-30Cygwin: Fix access to block devices below /proc/sys.Christian Franke1-10/+19
Use fhandler_dev_floppy instead of fhandler_procsys for such devices. The read()/write() functions from fhandler_procsys do not ensure sector aligned transfers and lseek() fails always. Signed-off-by: Christian Franke <franke@computer.org>