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
path: root/winsup
AgeCommit message (Collapse)Author
2023-11-05Cygwin: Add /dev/disk/by-id symlinksChristian Franke
The new directory '/dev/disk/by-id' provides symlinks for each disk and its partitions: 'BUSTYPE-[VENDOR_]PRODUCT_SERIAL[-partN]' -> '../../sdX[N]'. This is based on strings provided by STORAGE_DEVICE_DESCRIPTOR. If this information is too short, a 128-bit hash of the STORAGE_DEVICE_UNIQUE_IDENTIFIER raw data is added. Administrator privileges are not required. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-10-31Cygwin: let feraiseexcept actually raise an exceptionCorinna Vinschen
The exception handling inside of Cygwin functions marked as SIGFE covers exceptions and lets the library code handle them gracefully. If these functions want to raise an exception, they have to send a signal explicitely via raise(3). That's not what we want in feraiseexcept(). It triggers a floating point exception explicitely by calling the i387 op "fwait". Being marked as SIGFE, this exception will be suppressed and the normal exception handling won't kick in. Fix this by moving feraiseexcept into the NOSIGFE realm. Fixes: 0f81b5d4bcaa ("* Makefile.in (DLL_OFILES): Add new fenv.o module.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-10-30Cygwin: cwd: avoid releasing the cwdstuff SRW Lock twiceCorinna Vinschen
cwdstuff::set has a code snippet handling the case where a process can't create a handle to a directory, e. g., due to permissions. Commit 88443b0a22589 ("cwdstuff: Don't leave from setting the CWD prematurely on init") introduced a special case to handle this situation at process initialization. It also introduces an early mutex release, which is not required, but ok, because we're in the init phase. Releasing the mutex twice is no problem since the mutexes are recursive. Fast forward to commit 0819679a7a210 ("Cygwin: cwd: use SRWLOCK instead of muto"). The mechanical change from a recursive mutex to a non-recursive SRWLOCK failed to notice that this very specific situation will release the SRWLOCK twice. Remove the superfluous release action. While at it, don't set dir to NULL, but h, since dir will get the value of h anyway later on. Setting h to NULL may not be necessary, but better safe than sorry. Reported-by: tryandbuy >tryandbuy@proton.me> Fixes: 88443b0a22589 ("cwdstuff: Don't leave from setting the CWD prematurely on init") Fixes: 0819679a7a210 ("Cygwin: cwd: use SRWLOCK instead of muto") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-10-30Cygwin: dsp: Improve minimum buffser size estimation.Takashi Yano
The commit 322c7150b25e restricts buffer size with a fixed length, however, the minimum buffer size should be varied by the sample rate. With this patch, it is estimated using sample rate, sample width and number of channels so that the buffer length is not less than 80 msec which is almost the minimum value of Win MME to work. Fixes: 322c7150b25e ("Cygwin: dsp: Avoid setting buffer that is too small.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-09-17Cygwin: dsp: Avoid setting buffer that is too small.Takashi Yano
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 Yano
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-10Cygwin: Add initial support for SOURCE_DATE_EPOCHChristian Franke
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-10Cygwin: NFS: remove recognizing native symlinks as FIFOsCorinna Vinschen
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-10Cygwin: NFS: create devices (especially FIFOs) as shortcut filesCorinna Vinschen
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-10Cygwin: NFS: fetch actual DOS attributesCorinna Vinschen
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-10Cygwin: readdir: explain why we use FileNamesInformation on NFSCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-10Cygwin: Add relnote to 3.4.10 release fileMark Geisert
Document the most recent update to include/sys/cpuset.h.
2023-09-10Cygwin: Fix __cpuset_zero_s prototypeMark Geisert
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 Vinschen
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 Vinschen
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 Vinschen
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 Yano
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 Yano
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 Yano
2023-09-05Cygwin: dsp: Reduce wait time for blocking read().Takashi Yano
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 Yano
2023-09-04Cygwin: document FIFO over NFS changeCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-04Revert "Cygwin: mknod: disable creating special files on NFS"Corinna Vinschen
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 Vinschen
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-01Cygwin: cpuinfo: Linux 6.5 additionsBrian Inglis
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 Yano
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 Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-01Cygwin: sys/cpuset.h: use internal base typesCorinna Vinschen
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 Vinschen
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 Yano
Signed-off-by: Takashi Yano <takashi.yanao@nifty.ne.jp>
2023-08-29Cygwin: execve: drop argument size limitCorinna Vinschen
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-28Cygwin: Fix segfalt when too many command line args are specified.Takashi Yano
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 Yano
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-08-27Revert "Cygwin: autoload: introduce LoadDLLfunc_pfx_only"Corinna Vinschen
This reverts commit 0e711d6cc9b5206335fe8562817b6d5e6cad876e. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-27Revert "Cygwin: select: workaround FD_WRITE network event handling"Corinna Vinschen
This reverts commit dedbbd74d0a8f3b7dfae6188321703a47bb8a2b3. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-25Cygwin: document disabling mknod/mkfifo on NFSCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-25Cygwin: mknod: disable creating special files on NFSCorinna Vinschen
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 Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-19Cygwin: pty: Fix failure to clear switch_to_nat_pipe flag.Takashi Yano
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-16Cygwin: shared: Fix access permissions setting in open_shared().Takashi Yano
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 Yano
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 Vinschen
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-11Cygwin: testsuite: Tweak lseek03 after addition of SEEK_HOLEJon Turney
After addition of SEEK_HOLE, the whence of *4* is not an invalid argument, causing the test to FAIL. See ltp commit 423e636a4c8f ("lseek03: change to fix with the lseek syscall")
2023-08-11Cygwin: testsuite: Add a small delay in kill01Jon Turney
Avoid transient failures by adding a small delay after fork()-ing to allow the child to get into a state where it can recieve signals. Also add same small delay to kill03 and kill04. kill02 has a more elaborate setup where child processes write to a pipe to indicate they have started.
2023-08-09Cygwin: fhandler_base::lseek: fix formattingCorinna Vinschen
Fixes: edfa581d3c5a ("Cygwin: lseek: implement SEEK_DATA and SEEK_HOLE for files") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-09Cygwin: add SEEK_DATA/SEEK_HOLE addition to release messageCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-09Cygwin: lseek: implement SEEK_DATA and SEEK_HOLE for filesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-09Cygwin: lseek: propagate new SEEK_DATA and SEEK_HOLE to fhandlerCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-09Cygwin: clipboard: Only SEEK_SET and SEEK_CUR are supportedCorinna Vinschen
Make sure of that, especially given the addition of SEEK_DATA and SEEK_HOLE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-08-08Cygwin: CI: XFAIL umask03Jon Turney
umask03 fails in CI due to some not understood weirdness.