Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-18Cygwin: align renameat2 to Linux behaviourCorinna Vinschen
In contrast to rename default behaviour, Linux' renameat2 returns -1 with errno set to EEXIST, if oldfile and newfile refer to the same file, and the RENAME_NOREPLACE flag is set. Follow suit, given this is a Linux-only function anyway. Fixes: f665b1cef30f ("cygwin: Implement renameat2") Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-18Cygwin: fix errno values set by readlinkatCorinna Vinschen
readlinkat(fd, "", ...) is supposed to return ENOENT per POSIX, but Cygwin returns EBADF. At the same time, we have to maintain the special feature of glibc that readlinkat(fd, "", ...) operates on fd, if fd is pointing at a symlink opened with O_PATH|O_NOFOLLOW. And, while fixing that, readlinkat(fd, path, ...) *still* has to set errno to EBADF, if fd is an invalid descriptor *and* path is a relative path. This required to change the evaluation order in the helper function gen_full_path_at. Last but not least, in case of the aforementioned glibc-like special handling for symlink descriptors, we have to make sure that errors from gen_full_path_at are not spilled into that special handling. Fixes: 6cc05784e16a ("Cygwin: readlinkat: allow pathname to be empty") Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-18Cygwin: fix return value of ilogbl(NaN)Corinna Vinschen
Fixes: 792e51b72149 ("Add missing long double functions to Cygwin") Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-18Cygwin: add release text for previous commitCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-18Cygwin: cygheap: fix fork error after heap has grownDavid McFarland
2f9b8ff0 introduced a problem where forks would sometimes fail with: child_copy: cygheap read copy failed, 0x0..0x80044C750, done 0, windows pid 14032, Win32 error 299 When cygheap_max was > CYGHEAP_STORAGE_INITIAL, commit_size would be set to allocsize(cygheap_max), which is an address, not a size. VirtualAlloc would be called to commit commit_size bytes, which would fail, and then child_copy would be called with zero as the base address. Fixes: 2f9b8ff00cce ("Cygwin: decouple cygheap from Cygwin DLL") Signed-off-by: David McFarland <corngood@gmail.com>
2023-04-14Cygwin: pty: Fix reading CONIN$ when stdin is not a pty.Takashi Yano
Previously, the pty master sends inputs to the pipe for cygwin app even when pseudo console is activated if stdin is not the pty. This causes the problem that key input is not sent to non cygwin app even if the app opens CONIN$. This patch sets switch_to_nat_pipe to true regardless whether stdin is the pty or not to allow that case. https://cygwin.com/pipermail/cygwin/2023-April/253424.html Reported-by: Wladislav Artsimovich <cygwin@frost.kiwi> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-03-29Cygwin: dirname: fix handling of leading slashesCorinna Vinschen
Per https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/xbd_chap04.html: "A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash." So more than 2 leading slashes are supposed to be folded into one, which our dirname neglected. Fix that. Fixes: 24e8fc6872a3b ("* cygwin.din (basename): Export.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-16Cygwin: kill(1): don't print spurious error messageCorinna Vinschen
Make kill -V and kill -l exit immediately, thus stopping to print "not enough arguments" accidentally. Fixes: ef48a2cad3704 ("* kill.cc (prog_name) New global variable.") Fixes: c49fa762631f9 ("* Makefile.in (kill.exe): Add as a specific target.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-16Cygwin: signals: drop accidental spaces from real-time signal namesCorinna Vinschen
The signal names for the real-time signals contain spaces from the beginning of their availability. Fix that. Fixes: 61522196c715 ("* Merge in cygwin-64bit-branch.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-14Cygwin: Fix type mismatch on sys/cpuset.hMark Geisert
Addresses https://cygwin.com/pipermail/cygwin/2023-March/253220.html Take the opportunity to follow FreeBSD's and Linux's lead in recasting macro inline code as calls to static inline functions. This allows the macros to be type-safe. In addition, added a lower bound check to the functions that use a cpu number to avoid a potential buffer underrun on a bad argument. h/t to Corinna for the advice on recasting. Fixes: 362b98b49af5 ("Cygwin: Implement CPU_SET(3) macros")
2023-03-07Cygwin: ctty: Add missing fixup_after_{exec,fork}() call.Takashi Yano
Previously, fixup_after_{exec,fork}() calls for CTTY were missing. This patch fixes that. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-02-25Cygwin: dsp: Fix SNDCTL_DSP_{POST,SYNC} ioctl() behaviour.Takashi Yano
Previously, SNDCTL_DSP_POST and SNDCTL_DSP_SYNC were implemented wrongly. Due to this issue, module-oss of pulseaudio generates choppy sound when SNDCTL_DSP_POST is called. This patch fixes that. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-02-14Cygwin: dumper: also link with libzstd, as libbfd may require itJon Turney
Also allow that linkage to be dynamic, as libzstd-devel doesn't currently provide a static library.
2023-02-14bump DLL version to 3.4.7Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-09Cygwin: get_posix_access: Make mode_t parameter mandatorycygwin-3.4.6Corinna Vinschen
Avoid the mistake fixed in the preceeding commit by passing the mode_t argument by reference. This also affects a couple other functions calling get_posix_access in turn. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-09Cygwin: chmod: don't drop default ACEs from directory ACLsCorinna Vinschen
commit bc444e5aa4ca introduced a call to get_posix_access() with a NULL pointer for the mode_t parameter because the value is not needed later on... entirely ignoring the fact that the mode_t bits are checked for the object being a directory. In turn, the get_posix_access() call never checked for default ACEs and returned only the standard ACEs. Thus, every chmod call on a directory dropped the default ACEs from its permissions, as well as the default NULL deny-ACE used to store specific bits. It got also impossible to set the sgid bit on directories. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-09Cygwin: mkdir: use correct default permissions filtered by umaskCorinna Vinschen
Older coreutils created directories with mode bits filtered through umask. Newer coreutils creates directories with full permissions, 0777 by default. This new coreutils behaviour uncovered the fact that default ACEs for newly created directories were not filtered by umask starting with commit bc444e5aa4ca. Fix it by applying umask on the default ACEs. Fixes: bc444e5aa4ca ("Reapply POSIX ACL change.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-06setlocale: create LC_ALL string when changing localeCorinna Vinschen
This patch is for the sake of gnulib. gnulib implements some form of a thread-safe setlocale variant called setlocale_null_r, which is supposed to return the locale strings in a thread-safe manner. This only succeeds if the system's setlocale already handles this thread-safe, otherwise gnulib adds some locking on its own. Newlib's setlocale always writes the global string array holding the LC_ALL value anew on each invocation of setlocale(LC_ALL, NULL). Since that doesn't allow to call setlocale(LC_ALL, NULL) in a thread-safe manner, so locking in gnulib is required. And here's the problem... The lock is decorated as dllexport when building for Cygwin. This collides with the default behaviour of ld to export all symbols. If it finds one decorated symbol, it will only export this symbol to the DLL import lib. Change setlocale so that it writes the global string array holding the LC_ALL value at the time the locale gets changed. On setlocale(LC_ALL, NULL), just return the pointer to the global LC_ALL string array, just as in GLibc. The burden of doing so is negligibly for all targets, but adds thread-safety for gnulib's setlocal_null_r() function, and gnulib can drop the lock entirely when building for Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-25Cygwin: dsp: Fix hang on close() if another thread calls write().Takashi Yano
fhandler_dev_dsp (OSS) has a problem that waitforallsent(), which is called from close(), falls into infinite loop if another thread calls write() accidentally after close(). This patch fixes the issue. Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-01-23Cygwin: mount: differ allowed server name chars from allowed share name charsCorinna Vinschen
The list of invalid chars for server names differs from the list of invalid chars for share names. Apart from that, we don't allow control chars in both kinds of names. Fixes: 6338d2f24a60 ("Cygwin: mount: allow any valid character in UNC paths") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-22Cygwin: mount: allow any valid character in UNC pathsCorinna Vinschen
The current code only allows server and share names to start with ASCII chars [a-zA-Z0-9],, which is not correct. Rather, check for a valid share character. Fixes: 1fd5e000ace55 ("import winsup-2000-02-17 snapshot") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-22Cygwin: fsync: Fix EINVAL for block device.Takashi Yano
The commit af8a7c13b516 has a problem that fsync returns EINVAL for block device. This patch treats block devices as a special case. https://cygwin.com/pipermail/cygwin/2023-January/252916.html Fixes: af8a7c13b516 ("Cygwin: fsync: Return EINVAL for special files.") Reported-by: Yano Ray <yanorei@hotmail.co.jp> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-01-22Cygwin: tape: tapes are character devices, not block devicesCorinna Vinschen
Fixes: 727a81f4d93f ("* devices.h (device::exists_func): Redefine field.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-19Cygwin: bump DLL version to 3.4.6Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-19Cygwin: Add 3.4.5 release messagecygwin-3.4.5Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-19Cygwin: fix build of cygcheck and straceCorinna Vinschen
adding <target>_LDFLAGS overrides AM_LDFLAGS and thus fails to build cygcheck and strace statically. Fix it. Fixes: 8d318bf142f7 ("Cygwin: disable high-entropy VA for cygcheck and strace") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-19bump DLL version to 3.4.5Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-19Cygwin: dsp: Fix a problem that fcntl() does not take effect.cygwin-3.4.4Takashi Yano
Previously, fhandler_dev_dsp (OSS) has a problem that fcntl() does not take effect at all. This patch fixes the issue. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp> Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-18Cygwin: open_shared: always bump next_addressCorinna Vinschen
The new loop in open_shared has a subtil performance problem. Next_address is bumped only if mapping at this address failed. Every subsequent call to open_shared has a high probability having to call MapViewOfFileEx twice, because next_address is still set to the address of the last successful mapping. Avoid this by bumping next_address every time. While at it, fix a comment. Conflict: Missing backport of 31302b267b86 ("Cygwin: drop fixed addresses for standard shared regions") Fixes: dc0fe7742b8c ("Cygwin: open_shared: try harder allocating a shared region") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-17Cygwin: disable high-entropy VA for cygcheck and straceCorinna Vinschen
It's not a good idea to enable high-entropy VA for tools loading the Cygwin DLL dynamically. The addresses used by HEVA tend to collide with fixed address areas managed by Cygwin. Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-17Cygwin: open_shared: try harder allocating a shared regionCorinna Vinschen
For fixed regions (cygwin/user/myself/shared console), try fixed address first. Fallback to non-fixed region. Don't even try fixed address if the Cygwin DLL gets dynamically loaded. For non-fixed regions, try to allocate in a loop within the area from SHARED_REGIONS_ADDRESS_LOW to SHARED_REGIONS_ADDRESS_HIGH. Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-17Cygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESSCorinna Vinschen
Fix comments accordingly. This is in preparation for a change in open_shared, handling shared regions more cleanly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-17Cygwin: open_shared: don't reuse shared_locations parameter as outputCorinna Vinschen
For ages, open_shared uses the shared_locations parameter as output to indicate if the mapping for a shared region has been created or just opened. Split this into two parameters. Use the shared_locations parameter as input only, return the creation state of the mapping in a bool reference parameter. Conflict: Simple collision due to missing backport of 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-16Cygwin: /proc/cpuinfo: always print trailing empty line, as on LinuxCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-16Cygwin: /proc/cpuinfo: Always print topology infoCorinna Vinschen
vmstat from proc-ps-4.0.x prints "Unable to create system stat structure" if the /proc/cpuinfo output fails to contain topology info. While Linux always prints topology info if the kernel has been built with CONFIG_SMP, Cygwin only prints topology info if the CPU is known to be multi-core (i. e., the HT feature flag is set). Fix that by printing topology info all the time, even for single-core CPUs. Fixes: e0d48debedfa ("Fix /proc/cpuinfo topology and cache size info") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-10Cygwin: cygheap: Initialize myself_pinfo before child_copy().Takashi Yano
After the commit 30add3e6b3e3, the problem: https://cygwin.com/pipermail/cygwin/2022-December/252759.html occurs rarely. It seems that myself_pinfo should be initialized where the timing before child_copy() and after cygheap allocation. This patch moves the initialization there. Fixes: 30add3e6b3e3 ("Cygwin: exec: don't access cygheap before it's initialized") Reported-by: Brian Inglis <Brian.Inglis@Shaw.ca> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-01-10Cygwin: /proc/<PID>/status: avoid crash computing signal infoCorinna Vinschen
The code computing the mask of pending signals used the per-queued signal TLS pointer without checking it for NULL. Fix this by using the process-wide signal mask in that case. Fixes: 195169186bfd5 ("Cygwin: wait_sig: allow to compute process-wide mask of pending signals") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-09Cygwin: reinstantiate exporting _allocaCorinna Vinschen
This basically reverts commit 1556b96b1b3b03112f271dfe30e043ed538354fd. Turns out that _alloca is actually used, for instance, by clang.
2022-12-22Cygwin: devices: Make generic console devices invisible from pty.Takashi Yano
The devices /dev/conin,conout,console were wrongly visible from ptys, though they are inaccessible. This is because fhandler_console::exists() returns true due to existing invisible console. This patch makes these devices invisible from ptys. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2022-12-22Cygwin: console: Fix hangup of less on quit after the window is resized.Takashi Yano
https://cygwin.com/pipermail/cygwin/2022-December/252737.html If the less is started from non-cygwin shell and window size is changed, it will hang-up when quitting. The cause of the proglem is that less uses longjump() in signal handler. If the signal handler is called while cygwin is acquiring the mutex, cygwin loses the chance to release mutex. With this patch, the mutex is released just before calling kill_pgrp() and re-acquired when kill_pgrp() returns. Reported-by: Gregory Mason <grmason@epic.com> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2022-12-21Cygwin: path_conv: make sure sym.path_flags is always initializedCorinna Vinschen
Commit c1023ee353705 introduced a split between mount flags and path flags. It didn't initialize symlink_info::path_flags in path_conv::check, because that's done in symlink_info::check. However, there are two code paths expecting symlink_info::path_flags being already initialized and both skip symlink_info::check. Make sure symlink_info::path_flags is initalized to 0 early in path_conv::check. Fixes: c1023ee353705 ("Cygwin: path_conv: decouple path_types from mount types") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-16bump DLL version to 3.4.4Jon Turney
2022-12-16Cygwin: Update 3.4.3 release notecygwin-3.4.3Jon Turney
2022-12-16Revert "Cygwin: x86_64: add wmemset assembler entry point"Jon Turney
This reverts commit 188d5f6c9ad5cbbd6f0fcb9aaf15bc9870597910.
2022-12-14Cygwin: path handling: never substitute virtual drive with target pathCorinna Vinschen
Move the drive substitution code after the call to GetFinalPathNameByHandleW into a local function revert_virtual_drive and add code to handle non-remote virtual drives, i. e., those created with the subst command. (Try to) make sure that virtual drives are never treated like symlinks. Fixes: 19d59ce75d53 ("Cygwin: path_conv: Rework handling native symlinks as inner path components") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-14Cygwin: add release message for latest path handling patchCorinna Vinschen
5ba5e09b9d39 ("Cygwin: path handling: never substitute virtual drive with target path") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-13Cygwin: Makefile: build new-cygwin1.dll in a single stepCorinna Vinschen
The complicated build routine was only required because we needed the .cygheap section at the end of the file, and the debug sections broke this. Now that the cygheap is out of the way, we really don't have to do this anymore, and the build can just generate a DLL with integrated debug info. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-13Cygwin: Makefile: only regenerate cygwin_version.c if it changesCorinna Vinschen
Make sure to create a new cygwin_version.c if it either doesn't exist yet, or if it would be different from the former file. This avoids unnecessary DLL rebuilding. Fixes: 97eb64b909bc ("Cygwin: uname: generate default release string from git as well") Fixes: 4949a82cde98 ("Cygwin: uname: fix building in non-git source dir") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-11bump DLL version to 3.4.3Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-11Cygwin: add 3.4.2 release notescygwin-3.4.2Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>