aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-03-15Cygwin: kill(1): Align list options to latest Linux kill(1)Corinna Vinschen1-14/+91
- Don't print all RT signals, just the allowed patterns - Add -L/--table option to print a table of signals with signal numbers Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-15Cygwin: kill(1): align real-time signal naming to Linux kill(1)Corinna Vinschen1-2/+43
Allow RT<N>, RTMIN+<N> and RTMAX-<N> for RT signals. Translate RT signal numbers to an "RT<N>" string. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-15Cygwin: kill(1): don't print spurious error messageCorinna Vinschen2-2/+7
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-15Cygwin: signals: drop accidental spaces from real-time signal namesCorinna Vinschen1-31/+31
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: doc: Update postinstall/preremove scriptsJon Turney2-7/+22
setup >=2.925 indicates to postinstall and preremove scripts the Start Menu suffix to use via the CYGWIN_START_MENU_SUFFIX env var. It also indicates, via the CYGWIN_SETUP_OPTIONS env var, if the option to disable Start Menu shortcut creation is supplied. Update the Cygwin documentation postinstall and preremove scripts to take these env vars into consideration.
2023-03-14Cygwin: Fix type mismatch on sys/cpuset.hMark Geisert2-42/+101
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-08libgloss/epiphany: Fix move instruction in crt0.SSebastian Huber1-1/+1
This patch relates to bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=30212
2023-03-07Cygwin: ctty: Remove old 'kludge' code.Takashi Yano2-18/+0
Remove old 'kludge' code which does not seem necessary anymore. The comment of the 'kludge' is as follows. * syscalls.cc (setsid): On second thought, in the spirit of keeping things kludgy, set ctty to -2 here as a special flag, and... (open): ...only eschew setting O_NOCTTY when that case is detected. Fixes: c38a2d837303 Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-03-07Cygwin: ctty: Replace ctty constant with more descriptive macros.Takashi Yano13-39/+48
This patch replaces ctty constants with more descriptive macros (CTTY_UNINITIALIZED and CTTY_RELEASED) rather than -1 and -2 as well as checking sign with CTTY_IS_VALID(). Fixes: 3b7df69aaa57 (Cygwin: ctty: Add comments for the special values: -1 and -2.) Suggested-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-03-07Cygwin: console: Suppress unnecessary open_shared_console() calls.Takashi Yano1-1/+1
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-03-07Cygwin: ctty: Add missing fixup_after_{exec,fork}() call.Takashi Yano2-0/+12
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-03-03Cygwin: is_unicode_equiv: fix commentCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-03Cygwin: glob: fix conversion from UTF-32 to multibyteCorinna Vinschen1-2/+2
The conversion function g_Ctoc missed to drop the flag values from the wint_t value. That wasn't noticable with the original version because it used a 64 bit Char type and the flags were in the upper 32 bit region. So the flag values were silently dropped when wcrtomb was called. After converting Char to wint_t, we have to do drop the flags explicitely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-03arm: Restrict processor mode change when in hypervisor modeSrinath Parvathaneni2-14/+14
If a CPU implements EL2 as its highest exception level then programs using newlib may start in hypervisor mode. In that state it is not trivial to switch into the various EL1 modes to configure the individual exception stacks, so do not try.
2023-03-03arm: Fix the SP used in setting stack limit for standalone application.Srinath Parvathaneni2-4/+2
Move the instruction that saves SP before the mode check so that applications that start in USER mode correctly set the stack limit.
2023-03-01Cygwin: define CHARCLASS_NAME_MAXCorinna Vinschen1-3/+2
CHARCLASS_NAME_MAX isn't defined yet, accidentally. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: add collating symbols support to release messageCorinna Vinschen2-5/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: fnmatch: support collating symbols in [. .] bracketsCorinna Vinschen1-130/+158
This requires quite a few changes in how fnmatch operates. It always operates on wint_t strings now, just like regex and glob, and it always keeps a pointer on the character inside the string, rather than operating on a single character. As a result, just drop the ifdef's for Cygwin. The code is non-portable now anyway... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: mbsnrtowci: like mbsnrtowcs, just for wint_tCorinna Vinschen2-0/+61
Deviation from standard: If the input is broken, the output will be broken. I. e., we just copy the current byte over into the wint_t destination and try to pick up on the next byte. This is in line with the way fnmatch works. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: wcichr: add wint_t replacement for wcschrCorinna Vinschen1-0/+13
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: add wcipcpy and wcipncpy helper functionsCorinna Vinschen2-6/+33
wint_t replacements for wcpcpy and wcpncpy Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-03-01Cygwin: wcitoascii: move to wchar.h as inline functionCorinna Vinschen2-6/+8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-28Cygwin: fnmatch: drop static variableCorinna Vinschen1-11/+2
fnmatch calls fnmatch1 with a static mbstate_t. This breaks calling fnmatch from multiple threads. Fix it by folding fnmatch1 into fnmatch and moving all mbstates to local variables. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-28Cygwin: __wscollate_range_cmp: fix incorrect commentCorinna Vinschen1-2/+2
The comment that the first arg must be the pattern was added during development, before it turned out that __wscollate_range_cmp can be implemented in an order independent way. Better explain why this function uses pointers to strings. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-27nano-mallocr: Prevent NULL pointer de-reference in free_listHenrik Nilsson via Newlib1-5/+14
The existing code checked if there was a chunk in free_list and that the tail was not the next chunk. The check if there is a chunk is not needed since it's already known but the case of a single chunk in free_list needs to be handled differently.
2023-02-26Cygwin: fetch-lc-def-codesets-from-linux: fix locale name handlingCorinna Vinschen1-12/+11
As the former call to `locale -av' has the unwanted side effect to shorten the locale name to <= 15 chars, don't use it. Use `locale -a' instead and fetch the codeset from another call to `locale' for each locale. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-26Cygwin: locale: fix devanagari modifierCorinna Vinschen4-6/+6
Effectively revert commit 57bac33359db. The fact that the devanagari modifier was called devanagar (missing the trailing 'i') is a result of `locale -av' shortening the locale name to a maximum of 15 characters. D'oh. I guess we need a better way to do this... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-26Cygwin: introduce /proc/codesets and /proc/localesCorinna Vinschen4-225/+387
So far locale(1) had to have knowledge how to construct, thus duplicating the effort how Cygwin handles locale strings. Move locale list and codeset list generation into Cygwin by providing /proc/codesets and /proc/locales files. /proc/locales does not list aliases, those are still handled in locale(1). locale(1) opens the files and ueses that info for printing, like any other application can do now. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: fetch-lc-def-codesets-from-linux: speed upCorinna Vinschen1-34/+12
Drop shell read loop in favor of performing the locale output evaluation inside a single awk invocation. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: locale(1): redefine rule for adding a @euro localeCorinna Vinschen1-9/+8
The @euro locale is only useful, if the locale uses the EUR currency and the codeset of the base locale is ISO-8859-1, or the locale is el_GR. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: locale: Set default charset from Linux locale -> codeset mappingCorinna Vinschen2-122/+376
Generate lc_def_codeset.h header containing the default mapping from locale to codeset on Linux. Use this mapping in __set_charset_from_locale in the first place. For every locale not covered by this table, just map Windows codepages to equivalent codesets used on Linux/Unix, getting rid of LCIDs entirely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: locale: new script creating linux default codeset mappingCorinna Vinschen1-0/+48
New script creating a mapping table from locale to default codeset for this locale. We use that in Cygwin now to generate the own default codeset mapping based on Linux locale names. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: locale: fix devanagar modifierCorinna Vinschen2-2/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25ctype_cp.h/ctype_iso.h: clean whitespaceCorinna Vinschen2-43/+43
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: fully support KOI8-T codesetCorinna Vinschen4-7/+51
Commit 89eb4bce152f was pretty half-hearted, missing the codepage character type tables and wctomb/mbtowc mappings. Fixes: 89eb4bce152f ("Cygwin: support KOI8-T codeset") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: locale(1): fix typoCorinna Vinschen1-1/+1
Windows locales need a dash instead of an underscore. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-25Cygwin: dsp: Fix SNDCTL_DSP_{POST,SYNC} ioctl() behaviour.Takashi Yano1-4/+11
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-24Cygwin: convert Windows locale handling from LCID to ISO5646 stringsCorinna Vinschen5-214/+243
Since Windows Vista, locale handling is converted from using numeric locale identifiers (LCID) to using ISO5646 locale strings. In the meantime Windows introduced new locales which don't even have a LCID attached. Those were unusable in Cygwin because locale information for these locales required to call the new locale functions taking a locale string. Convert Cygwin to drop LCIDs and use Windows ISO5646 locales instead. The last place using LCIDs is the __set_charset_from_locale function. Checking numerically is easier and uslay faster than checking strings. However, this function is clearly a TODO
2023-02-24Cygwin: support KOI8-T codesetCorinna Vinschen5-25/+55
Used on Linux as default codeset for Tajik. There's no matching Windows codepage, so fake it as CP103. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-24Cygwin: locale(1): drop using LCID, use Windows locale namesCorinna Vinschen1-130/+190
LCIDs are deprecated since Windows Vista. Worse, lots of new locales have been added in the meantime which have no LCID attached. They are only available by locale name. As first step, rearrange the locale(1) tool to use Windows locale names, rather than LCIDs, so we can now enumerate *all* locales available in more recent Windows versions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-22Fix libgloss/newlib build to conditionally use top include dirJeff Johnston8-3/+67
- conditionally use -idirafter option for arm
2023-02-22RISC-V: Use the new libm code if possibleHau Hsu1-0/+5
Set __OBSOLETE_MATH_DEFAULT to 0 if 'd' extension is supported (i.e. __riscv_flen == 64). Base on the comment for __OBSOLETE_MATH_DEFAULT: > ... it assumes that the toolchain has ISO C99 support (hexfloat > literals, standard fenv semantics), the target has IEEE-754 conforming > binary32 float and binary64 double (not mixed endian) representation, > standard SNaN representation, double and single precision arithmetics > has similar latency and it has no legacy SVID matherr support, only > POSIX errno and fenv exception based error handling. Signed-off-by: Hau Hsu <hau.hsu@sifive.com>
2023-02-22Cygwin: __wscollate_range_cmp: workaround wcscoll's case-insensitivityCorinna Vinschen1-0/+6
Most locales using latin characters ignore case while sorting. This is what wcscoll does (correctly so). However, there's an internal order of collating sequences compared to the base character, which is case-sensitive, at least in GLibc. There's no way to express this in Windows, because CompareString and LCMapString *always* use case-insensitivity in those locales, even if none of the *IGNORECASE sorting flags are used. We want to follow glibc's behaviour more closely, so we add an extra check for the case and make sure upper and lower cased letters don't comapre as identical. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-22Cygwin: glob: perform ignore_case_with_glob on inputCorinna Vinschen1-4/+19
Rather than converting single chars on the fly to lowercase in case ignore_case_with_glob is set, perform the conversion on the entire input (pattern and filenames).
2023-02-22Cygwin: glob: perform correct utf-32 -> multibyte conversionCorinna Vinschen3-1/+24
g_Ctoc, converting the UTF-32 filenames to multibyte, still used UTF-16 to multibyte conversion. Introduce a wirtomb helper and fix that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-22Cygwin: glob: fix includesCorinna Vinschen1-7/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20Cygwin: linux-locale-helpers: helper tools to generate locale data from LinuxCorinna Vinschen4-0/+477
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20Cygwin: glob: implement collating symbol supportCorinna Vinschen3-37/+98
Allow the [.<sym>.] expression This requires a string comparision rather than a character comparison. Introduce and use __wscollate_range_cmp. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20Cygwin: glob: convert internal character datatype to wint_tCorinna Vinschen1-5/+6
uint_fast64_t doesn't allow easy string handling, so convert the internal "Char" type to wint_t. Given that UTF-32 only needs 21 bits, we're well off with 28 usable character bits. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20Cygwin: nlsfuncs.cc: introduce collating elements and helper functionsCorinna Vinschen3-0/+3019
lc_collelem.h: autogenerated table of collating element, taken from glibc is_unicode_coll_elem: Check if a UTF-32 string is a collating element next_unicode_char: return length of prefix from a string constituting a complete character in the current locale, taking collating elements into acocunt.