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
2024-01-23Cygwin: Don't terminate via dumperHEADmastermainJon Turney
A process which is exiting due to a core dumping signal doesn't propagate the correct exist status after dumping core, because 'dumper' itself forcibly terminates the process. Use 'dumper -n' to avoid killing the dumped process, so we continue to the end of signal_exit(), to exit with the 128+signal exit status. Busy-wait in exec_prepared_command() in an attempt to reliably notice the dumper attaching, so we don't get stuck there. Also: document these important facts for custom uses of error_start.
2024-01-23Cygwin: seekdir: don't set errnoCorinna Vinschen
Commit 3f3bd1010455 ("* Throughout, use __try/__except/__endtry blocks [...]") introduced setting EINVAL, marked as "Diagnosis". The reason for this is lost in time and space, but looks very much like a debug helper which was supposed to be removed before release. It's rather pointless, so remove it. Fixes: 3f3bd1010455 ("* Throughout, use __try/__except/__endtry blocks [...]") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-19Cygwin: remove warnings from testsuite buildCorinna Vinschen
- drop unused variable - remove deprectated usage of std::pointer_to_unary_function. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-18Cygwin: replace all `fgrep' with `grep -F'Corinna Vinschen
Unfortunately fgrep is now deprecated in a very pushy way. Make sure to use grep -F instead all around, even in docs and comments/ Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-17Cygwin: copy doc changes from commit 241b50a7abe2 to release notesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-16Cygwin: Update documentation for cygwin_stackdumpJon Turney
2024-01-16Cygwin: Treat api_fatal() similarly to a core-dumping signalJon Turney
Provide the same debugging opportunities for api_fatal() as we do for a core-dumping signal: 1) Break into any attached debugger 2) Start JIT debugger (if configured) (keeping these under DEBUGGING doesn't seem helpful) 3) Write a coredump (if rlim_core > 1MB) 4) Write a stackdump (if that failed, or 0 < rlim_core <= 1MB)
2024-01-16Cygwin: Define and use __WCOREFLAGJon Turney
Also fix a typo in description of exit status
2024-01-16Cygwin: Disable writing core dumps by default.Jon Turney
Change the default core limit from unlimited to 0 (disabled)
2024-01-16Cygwin: Make 'ulimit -c' control writing a coredumpJon Turney
Pre-format a command to be executed on a fatal error to run 'dumper' (using an absolute path). Factor out executing a pre-formatted command, so we can use that for invoking the JIT debugger in try_to_debug() (if error_start is present in the CYGWIN env var) and to invoke dumper when a fatal error occurs. On a fatal error, if the core file size limit is greater than 1MB, invoke dumper to write a core dump. Otherwise, if that limit is greater than 0, write a .stackdump file, as previously. Adjust and clarify the associated documentation. Also: Fix so that the error_start JIT debugger is now invoked, even when ulimit -c is zero. Also: Fix uses of console_printf() inside exec_prepared_command(). It's output is written via the Windows console device, so needs to use Windows-style line endings. Also: consistently return non-zero from try_to_debug() if we debugged. Future work: Truncate or remove the file written, if it exceeds the maximum size set by the ulimit. Future work: Using the words "fatal error" could probably be improved on. This means exiting on one of the "certain signals whose default action is to cause the process to terminate and produce a core dump file".
2024-01-15Cygwin: introduce close_range(2)Christian Franke
This function closes or sets the close-on-exec flag for a specified range of file descriptors. It is available on FreeBSD and Linux. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-15Cygwin: api docs: add missing fallocateCorinna Vinschen
Also add notes in terms of fallocate quirks. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-12Cygwin: Clarifications in 3.5 changes docJon Turney
2024-01-11Cygwin: path.cc: fix comment starting with // but ending in */Corinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-10Cygwin: Fix a stray '\n' in cygcheck manpageJon Turney
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2024-01-08Cygwin: check remote drives for being SSDs as wellCorinna Vinschen
This enables automatic sparse file support for remote SSDs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-06Cygwin: fallocate(2): fix debug outputCorinna Vinschen
Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-06Cygwin: fallocate(2): fix offset and length sanity checkCorinna Vinschen
- len must not be <= 0 - offset + len must not exceed off_t (max. file size) Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-06Cygwin: posix_fallocate(3): fix offset and length sanity checkCorinna Vinschen
- len must not be <= 0 - offset + len must not exceed off_t (max. file size) Fixes: 7636b5859062 ("* autoload.cc (NtSetInformationFile): Define.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-04Cygwin: fallocate(2): drop useless zeroing pointerCorinna Vinschen
The out pointer is only used if data_chunk_count is > 0, so there's no reason to set it to NULL in the error case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: drop stray fs_info::check_ssd declarationCorinna Vinschen
This is just a leftover from development Fixes: 8b01c5d6903f ("Cygwin: fs_info: check for SSD") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: doc: add missing change to posix_spawnpCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: sparse support: enable automatic sparsifying of files on SSDsCorinna Vinschen
Given that SSDs don't have a seek penalty, we can enable automatic sparsifying of files on SSDs, even if the "sparse" mount option is not set. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: fs_info: check for SSDCorinna Vinschen
During fs_info::update, check for the file being on an SSD. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: ntdll.h: add missing NtQueryVolumeInformationFile definitionsCorinna Vinschen
In preparation of using the FileFsSectorSizeInformation info class, add a couple of missing definitions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: ntdll.h: add missing POBJECT_NAME_INFORMATIONCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: revert autoloading of DiscardVirtualMemoryCorinna Vinschen
Commit a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions") erroneously removed DiscardVirtualMemory from the list of autloaded functions. DiscardVirtualMemory is not available on Windows 8.1. Fixes: a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-29Cygwin: Add '--names-only' flag to cygcheckJon Turney
Add '--names-only' flag to cygcheck, to output just the bare package names.
2023-11-28Cygwin: fallocate(2): handle FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGECorinna Vinschen
Split fhandler_disk_file::fallocate into multiple methods, each implementing a different aspect of fallocate(2), thus adding FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE handling. For more correctly implementing posix_fallocate(3) semantics, make sure to re-allocate holes in the given range if the file is sparse. While at it, change the way checking when to make a file sparse. The rule is now, make file sparse if the hole created by the action spans at least one sparse block, taking the allocation granularity of sparse files into account. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: pwrite(2): sparsify fileCorinna Vinschen
write(2) sparsifies a file after an lseek far enough beyond EOF. Let pwrite(2) sparsify as well if offset is far enough beyond EOF. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fallocate(2): fix evaluating return valueCorinna Vinschen
fallocate is not supposed to return an errno code, it has to return -1 and set errno. Fixes: dd90ede40510 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: open(2): reset sparseness on O_TRUNCated filesCorinna Vinschen
open(2) implements O_TRUNC by just reducing the size of the file to 0, to make sure EAs stay available. Turns out, file sparseness is not removed this way either, so add code to do just that. Fixes: 603ef545bdbd ("* fhandler.cc (fhandler_base::open): Never open files with FILE_OVERWITE/FILE_OVERWRITE_IF.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: introduce fallocate(2)Corinna Vinschen
First cut of the new, Linux-specific fallocate(2) function. Do not add any functionality yet, except of basic handling of FALLOC_FL_KEEP_SIZE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fcntl.h: Use cdefs.h macrosCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fhandler: rename ftruncate method to fallocateCorinna Vinschen
also, take mode flags parameter instead of just a bool. Introduce __FALLOC_FL_TRUNCATE mode flag as internal flag to indictae being called from ftruncate(2). This is in preparation of an upcoming change introducing the Linx-specific fallocate(2) call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: posix_fallocate: return ENODEVCorinna Vinschen
The fhandler method ftruncate returns either EISDIR if it has been called on directories, or EINVAL if called on files other than regular files. This matches what ftruncate(2) is supposed to return, but it doesn't match posix_fallocate(3), which is supposed to return ENODEV in both cases. To accomplish that, return ENODEV from fhandler_base::ftruncate() and convert it to EINVAL in ftruncate(2). In posix_fallocate(3), convert EISDIR to ENODEV. Fixes: 7636b58590621 ("* autoload.cc (NtSetInformationFile): Define.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-25Cygwin: lseek: check for file sparseness, not for mount point sparsenessCorinna Vinschen
The code introducing the lseek(2) code for the GNU extensions SEEK_DATA and SEEK_HOLE accidentally checks if the mount point has the "sparse" flag set and, if not, emulates SEEK_DATA/SEEK_HOLE per the Linux specs. However, the mount point "sparse" flag only determines whether files should be made sparse or not. Files may be sparse independently of that, obviously. Fix that by checking for the FILE_ATTRIBUTE_SPARSE_FILE attribute instead. Fixes: edfa581d3c5a ("Cygwin: lseek: implement SEEK_DATA and SEEK_HOLE for files") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-21Cygwin: /dev/disk: Append '#N' if the same name appears more than onceChristian Franke
No longer drop ranges of identical link names. Append '#0, #1, ...' to each name instead. Enhance charset allowed in label names. No longer ignore null volume serial numbers. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-20Cygwin: /dev/disk/by-uuid: Fix NTFS serial number print formatChristian Franke
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-17Cygwin: Document /dev/disk/by-* subdirectoriesChristian Franke
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-17Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinksChristian Franke
The new directories '/dev/disk/by-label' and '/dev/disk/by-uuid' provide symlinks for each disk related volume label and serial number: 'VOLUME_LABEL' -> '../../sdXN' 'VOLUME_SERIAL' -> '../../sdXN' Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-17Cygwin: Add /dev/disk/by-drive and /dev/disk/by-voluuid symlinksChristian Franke
The new directory '/dev/disk/by-drive' provides symlinks for each disk related drive letter: 'x' -> '../../sdXN' The new directory '/dev/disk/by-voluuid' provides symlinks for each disk related storage volume: 'MBR_SERIAL-OFFSET' -> '../../sdXN' 'VOLUME_GUID' -> '../../sdXN' Both directories provide Windows specific information and do not exist on Linux. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-14Cygwin: rand(3): implement in terms of random(3)Corinna Vinschen
This makes rand(3) ISO C compliant and adds locking to avoid race conditions. Reported-by: Bruno Haible <bruno@clisp.org> Fixes: 8a0efa53e4491 ("import newlib-2000-02-17 snapshot") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-14Fix profiler error() definition and usageMark Geisert
Minor updates to profiler and gmondump, which share some code: - fix operation of error() so it actually works as intended - resize 4K-size auto buffer reservations to BUFSIZ (==1K) - remove trailing '\n' from 2nd arg on error() calls everywhere - provide consistent annotation of Windows error number displays Fixes: 9887fb27f6126 ("Cygwin: New tool: profiler") Fixes: 087a3d76d7335 ("Cygwin: New tool: gmondump") Signed-off-by: Mark Geisert <mark@maxrnd.com>
2023-11-13Add release text for random(3) fixCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-13Cygwin: random: drop unused function srandomdev()Corinna Vinschen
Also drop includes only required for srandomdev(). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-13Cygwin: random: make random(3) functions thread-safeCorinna Vinschen
Add locking to the random(3) family of functions to gain thread-safety per POSIX. Use NetBSD version of the file as role-model. Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-08Cygwin: /dev/disk/by-id: Remove leading spaces from identify fieldsChristian Franke
Various drives align the serial number to the right of the fixed length field. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-07Cygwin: Document /dev/disk/by-id and /dev/disk/by-partuuidChristian Franke
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-07Cygwin: Add /dev/disk/by-partuuid symlinksChristian Franke
The new directory '/dev/disk/by-partuuid' provides symlinks for each MBR or GPT disk partition: 'MBR_SERIAL-OFFSET' -> '../../sdXN' 'GPT_GUID' -> '../../sdXN' Signed-off-by: Christian Franke <christian.franke@t-online.de>