aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-09-17Cygwin: dsp: Avoid setting buffer that is too small.Takashi Yano1-0/+2
The buffer size that is too small causes choppy sound. That is not practical at all. With this patch, the minimum value of the buffer size (i.e. fragstotal * fragsize) is restricted to 16384 bytes. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-17Cygwin: dsp: Fix a bug that app hangs if it killed during write().Takashi Yano1-1/+2
If app is killed during blocking write(), it sometimes hangs. This patch fixes the issue. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-11Reentrancy, attempt to always provide _Thread_local in <sys/reent.h>Pekka Seppänen1-0/+1
Attempt to always provide _Thread_local in <sys/reent.h> by including <sys/cdefs.h>. The C specific keyword _Thread_local is not available unless targetting a suitable C version.
2023-09-11Reentrancy, conditionally provide default __getreent() implementationPekka Seppänen1-0/+4
Conditionally provide default __getreent() implementation only if _REENT_THREAD_LOCAL is not defined. If struct _reent is replaced by dedicated thread-local objects neither the structure nor _impure_ptr is available.
2023-09-11Reentrancy, use _REENT_ERRNO()Pekka Seppänen4-14/+14
Use _REENT_ERRNO() macro to access errno. This encapsulation is required, as errno might be either _errno member of struct _reent, _tls_errno or any such implementation detail.
2023-09-10Cygwin: Add initial support for SOURCE_DATE_EPOCHChristian Franke4-4/+18
If specified, set version timestamp to this value. Enable deterministic archives for ar and ranlib. Set cygwin1.dll PE and export table header timestamps to zero. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-09-09Cygwin: NFS: remove recognizing native symlinks as FIFOsCorinna Vinschen1-15/+0
Given the downsides of NFS symlinks as FIFOs, drop the code added to recognize them as such. Fixes: 622fb0776ea3 ("Cygwin: enable usage of FIFOs on NFS") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-09Cygwin: NFS: create devices (especially FIFOs) as shortcut filesCorinna Vinschen2-4/+26
Creating real NFS symlinks for device files has a major downside: The way we store device info requires to change the symlink target in case of calling chmod(2). This falls flat in two ways: - It requires to remove and recreate the symlink, so it doesn't exist for a short period of time, and - removing fails badly if there's another open handle to the symlink. Therefore, change this to create FIFOs as shortcut files, just as on most other filesystems. Make sure to recognize these new shortcuts on NFS (for devices only) in path handling and readdir. Fixes: 622fb0776ea3 ("Cygwin: enable usage of FIFOs on NFS") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-09Cygwin: NFS: fetch actual DOS attributesCorinna Vinschen2-3/+9
MSFT NFSv3 fakes DOS attributes based on file type and permissions. Rather than just faking FILE_ATTRIBUTE_DIRECTORY for dirs, fetch the "real" DOS attributes returned by NFS. This allows to handle the "R/O" attribute on shortcut files and thus reading and creating device shortcut files on NFS. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-09Cygwin: readdir: explain why we use FileNamesInformation on NFSCorinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-09Cygwin: Add relnote to 3.4.10 release fileMark Geisert1-0/+5
Document the most recent update to include/sys/cpuset.h.
2023-09-09Cygwin: Fix __cpuset_zero_s prototypeMark Geisert1-1/+1
Add a missing "void" to the prototype for __cpuset_zero_s(). Reported-by: Marco Mason <marco.mason@gmail.com> Addresses: https://cygwin.com/pipermail/cygwin/2023-September/254423.html Signed-off-by: Mark Geisert <mark@maxrnd.com> Fixes: c6cfc99648d6 (Cygwin: sys/cpuset.h: add cpuset-specific external functions)
2023-09-08Cygwin: fix an ugly castCorinna Vinschen1-1/+4
fhandler_base::fchown casts any fhandler landing here to a fhandler_disk_file. That's ugly and dangerous. Duplicate the path_conv info into an explicitly create fhandler_disk_file instead and call fchmod on that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-08Cygwin: fix chmod on native NFS FIFOsCorinna Vinschen2-3/+12
By handling native NFS FIFOs as actual FIFOs, chmod on a FIFO suddenly called fhandler_base::fchmod, which is insufficient to handle FIFO files on any filesystem. Note that this does not fix Cygwin FIFOs on NFS or AFS yet. Fixes: 622fb0776ea3 ("Cygwin: enable usage of FIFOs on NFS") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-08Cygwin: unlink_nt: declare in winsup.hCorinna Vinschen3-6/+2
unlink_nt is used more than once so declare it in a header. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-07Cygwin: dsp: Improve response time of select()/poll().Takashi Yano3-5/+27
With this patch, the response time of select()/poll() has been improved by utilizing semaphore (select_sem) just like pipe and fifo. In addition, notification of exceptional conditions has been added. Fixes: 2c06014f12b0 ("Cygwin: dsp: Implement select()/poll().") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-06Cygwin: dsp: Implement select()/poll().Takashi Yano4-1/+187
Previously, sound device /dev/dsp did not support select()/poll(). These have been implemented with this patch. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-05Cygwin: dsp: Fix trivial editorial issue.Takashi Yano1-1/+1
2023-09-05Cygwin: dsp: Reduce wait time for blocking read().Takashi Yano1-2/+2
Previous wait time of 100msec is too long if application specifies smaller buffer. With this patch, the wait time is reduced to 1msec.
2023-09-05Cygwin: dps: Fix a bug that read() could not return -1 on error.Takashi Yano1-1/+3
2023-09-04Cygwin: document FIFO over NFS changeCorinna Vinschen2-0/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-04Revert "Cygwin: mknod: disable creating special files on NFS"Corinna Vinschen1-6/+0
This reverts commit d085592daa5f89ccc9f5b86b2ca26199e7516d61. This reenables creating Cygwin FIFOs on NFS. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-04Cygwin: enable usage of FIFOs on NFSCorinna Vinschen2-12/+48
FIFOs on NFS were never recogized as such in path handling. stat(2) indicated native FIFOs as FIFOs but the path handling code didn't set the matching values in the inner symlink checking code, so the followup behaviour was wrong. Basically for the same reason, Cygwin-created FIFOs were just treated as symlinks with weird content by stat(2) as well as path handling. Add code to enable both types of FIFOs on NFS as Cygwin FIFOs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-03Cygwin: CI: Also deploy documentation for release tagsJon Turney1-4/+20
2023-09-03Cygwin: CI: Add documentation preview deploy stepJon Turney1-1/+21
2023-09-03Cygwin: CI: Simplify and reduce the number of steps in cross-build jobJon Turney1-19/+23
2023-09-02Cygwin: CI: Take note of the testsuite statusJon Turney1-1/+1
2023-09-01Cygwin: cpuinfo: Linux 6.5 additionsBrian Inglis1-1/+1
add AMD 0x8000001f EAX 14 debug_swap SEV-ES full debug state swap Signed-off-by: Brian Inglis <Brian.Inglis@Shaw.ca>
2023-09-01Cygwin: Implement sound mixer device.Takashi Yano8-687/+892
This patch adds implementation of OSS-based sound mixer device. This allows applications to change the sound playing volume. NOTE: Currently, the recording volume cannot be changed. Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-01Cygwin: document latest sys/cpuset.h fixCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-01Cygwin: sys/cpuset.h: use internal base typesCorinna Vinschen1-12/+12
Use __size_t and __pid_t instead of size_t and pid_t to avoid further dependencies to external headers. Reported-by: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-01Cygwin: sys/cpuset.h: add cpuset-specific external functionsCorinna Vinschen3-14/+25
The latest incarnation of sys/cpuset.h broke building coreutils. The reason is the inclusion of stdlib.h and string.h and hence premature requests for datatypes not yet defined in the include chain. Avoid this by defining __cpuset_alloc and __cpuset_free as external functions, now defined in sched.cc. Linux is doing this too, just using different names for the functions. Redefine __cpuset_zero_s to use __builtin_memset only on compilers supporting it, otherwise using a simple loop. Drop the stdlib.h and string.h includes. Fixes: 3f2790e04439 ("Cygwin: Make gcc-specific code in <sys/cpuset.h> compiler-agnostic") Reported-by: Denis Excoffier <cygwin@Denis-Excoffier.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-01Cygwin: dsp: Fix a few trivial bugs.Takashi Yano2-2/+4
Signed-off-by: Takashi Yano <takashi.yanao@nifty.ne.jp>
2023-08-29libc/stdlib/nano-mallocr.c, typo in variable namePekka Seppänen1-1/+1
Nano malloc uses `size' in assertation whereas the correct variable would be `s'. Given this has existed ever since nano malloc support was added, based on the context ("returned payload area of desired size does not exceed the actual allocated chunk") I presume that indeed `s' (user input) and not `r->size' (computed) shall be used.
2023-08-29Cygwin: execve: drop argument size limitCorinna Vinschen6-24/+38
Before commit 44f73c5a6206 ("Cygwin: Fix segfalt when too many command line args are specified.") we had no actual argument size limit, except for the fact that the child process created another copy of the argv array on the stack, which could result in a stack overflow and a subsequent SEGV. Commit 44f73c5a6206 changed that by allocating the additional argv array via malloc, and it introduced a new SC_ARG_MAX limit along the lines of the typical Linux limit. However, this new limit is artificial. Cygwin allocates all argument and environment data on the cygheap. We only run out of ARG_MAX space if we're out of memory resources. Change argument size handling accordingly: - Drop the args size check from child_info_spawn::worker. - Return -1 from sysconf (SC_ARG_MAX), i. e., the argument size limit is undefined. - Change argv handling in class av, so that a failing cmalloc is not fatal. This allows the parent process to return E2BIG if it's out of cygheap resources. - In the child, add a check around the new malloc call, so that it doesn't result in a SEGV if the child process gets unexpectedly into an ENOMEM situation at this point. In this (unlikely) case, proceed with the original __argv array instead. Add comment to explain why. Fixes: 44f73c5a6206 ("Cygwin: Fix segfalt when too many command line args are specified.") Tested-by: Takashi Yano <takashi.yano@nifty.ne.jp> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-29newlib: fix 'sed' for sys headers path prefixAlexey Lapshin2-4/+4
Precisely remove the prefix from the filepath.
2023-08-29Cygwin: Fix segfalt when too many command line args are specified.Takashi Yano5-7/+18
Previously, the number of command line args was not checked for cygwin process. Due to this, segmentation fault was caused if too many command line args are specified. https://cygwin.com/pipermail/cygwin/2023-August/254333.html Since char *argv[argc + 1] is placed on the stack in dll_crt0_1(), STATUS_STACK_OVERFLOW occurs if the stack does not have enough space. With this patch, char *argv[] is placed in heap instead of stack and ARG_MAX is increased from 32000 to 2097152 which is default value of Linux. The argument length is also compared with ARG_MAX and spawnve() returns E2BIG if it is too long. Reported-by: Ed Morton Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-28Cygwin: termios: Refactor the function is_console_app().Takashi Yano1-10/+8
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-27Revert "Cygwin: autoload: introduce LoadDLLfunc_pfx_only"Corinna Vinschen1-27/+0
This reverts commit 0e711d6cc9b5206335fe8562817b6d5e6cad876e. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-27Revert "Cygwin: select: workaround FD_WRITE network event handling"Corinna Vinschen2-28/+3
This reverts commit dedbbd74d0a8f3b7dfae6188321703a47bb8a2b3. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-25Cygwin: document disabling mknod/mkfifo on NFSCorinna Vinschen1-0/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-25Cygwin: mknod: disable creating special files on NFSCorinna Vinschen1-0/+6
This simply doesn't work (yet?) but leaves unusable files behind. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-25Cygwin: doc: add new API calls in 3.5Corinna Vinschen1-0/+8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-24libgloss: add Xtensa portAlexey Lapshin33-10/+2257
Supported esp32 and esp32s2 boards: https://github.com/espressif/esp-toolchain-docs/blob/main/gcc/build-and-run-native-app.md
2023-08-19Cygwin: pty: Fix failure to clear switch_to_nat_pipe flag.Takashi Yano3-4/+16
After the commit fbfea31dd9b9, switch_to_nat_pipe is not cleared properly when non-cygwin app is terminated in the case where the pseudo console is disabled. This is because get_winpid_to_hand_over() sometimes returns PID of cygwin process even though it should return only PID of non-cygwin process. This patch fixes the issue by adding a new argument which requests only PID of non-cygwin process to get_console_process_id(). Fixes: fbfea31dd9b9 ("Cygwin: pty: Avoid cutting the branch the pty master is sitting on.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-17newlib: add Xtensa portAlexey Lapshin42-255/+3646
2023-08-16Cygwin: shared: Fix access permissions setting in open_shared().Takashi Yano2-4/+5
After the commit 93508e5bb841, the access permissions argument passed to open_shared() is ignored and always replaced with (FILE_MAP_READ | FILE_MAP_WRITE). This causes the weird behaviour that sshd service process loses its cygwin PID. This triggers the failure in pty that transfer_input() does not work properly. This patch resumes the access permission settings to fix that. Fixes: 93508e5bb841 ("Cygwin: open_shared: don't reuse shared_locations parameter as output") Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signedd-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-16Cygwin: pty: Add missing pinfo check in transfer_input().Takashi Yano1-1/+3
The commit 10d083c745dd has a bug that lacks a check for pinfo pointer value for master_pid. This causes segmentation fault if the process whose pid is master_pid no longer exists. This patch fixes the issue. Fixes: 10d083c745dd ("Cygwin: pty: Inherit typeahead data between two input pipes.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-15Cygwin: cXXrtomb, mbrtcXX: use function-specific internal stateCorinna Vinschen1-3/+21
As described in the previous commit b5111e46424b ("struct _reent: add state for unicode functions") every unicode conversion function has to use their own state object, if the state parameter is NULL. Fixes: 4f258c55e87f ("Cygwin: Add ISO C11 functions c16rtomb, c32rtomb, mbrtoc16, mbrtoc32.") Fixes: c49bc478b4a7 ("Cygwin: Add ISO C2X functions c8rtomb, mbrtoc8") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-15struct _reent: add state for unicode functionsCorinna Vinschen1-0/+16
C23 requires that the unicode functions c16rtomb, c8rtomb, mbrtoc16, mbrtoc32 and mbrtoc8 use their own internal state object. c32rtomb only needs an internal state if the lib supports encoding with shift states, but that's the case for newlib and Cygwin. Only Cygwin implements these functions so add the states objects only for Cygwin for now. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>