aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-02Cygwin: sysconf: don't set errno for unsupported optionsCorinna Vinschen1-9/+7
We return -1 with errno set to EINVAL for sysconf options for values required by POSIX, but not implemented on Cygwin. This is incorrect. Return -1, but don't set errno for these options. Drop the "nsup" enum to indicate unsupported values, it's not required anymore. Fixes: 59e3b6ca7dc10 (CVS import) Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-02Cygwin: sysconf: belatedly add correct return value for _SC_DELAYTIMER_MAXCorinna Vinschen1-1/+1
When adding the timer_getoverrun function, DELAYTIMER_MAX was added to limits.h, but the return value of sysconf(_SC_DELAYTIMER_MAX) wasn't changed accordingly. Fix that now. Fixes: 9e295a8d193e ("Cygwin: posix timers: implement timer_getoverrun") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-03Cygwin: pty: Add still missing acquire/release_attach_mutex.Takashi Yano1-8/+40
- transfer_input() function uses console api, so it should be guarded by attach_mutex. However, in most cases, it is missing. This patch fixes the issue.
2022-03-02Cygwin: pty: Communalize the code for temporary attach to console.Takashi Yano3-91/+66
- This patch communalizes the code for attaching another console temporarily and resuming to the original attach state, because there were a plurality of similar codes throughout.
2022-03-02Cygwin: console, pty: Revamp the acquire/release_attach_mutex timing.Takashi Yano5-44/+155
- This patch revises the acquiring/releasing timing for attach_mutex to make the period in which it is being acquired shorter. Further, acquiring/releasing are added to where they are missing but needed.
2022-03-02Cygwin: _pinfo::siginfo: fix sig_send callCorinna Vinschen1-1/+1
Request __SIGPENDINGALL, not __SIGPENDING, when fetching signal info for the calling process. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-02Cygwin: console: Fix a bug from comparison between int and DWORD.Takashi Yano1-1/+1
2022-03-01newlib: convert INTERNAL_NEWLIB to _LIBCMike Frysinger4-41/+38
Since we already set up _LIBC to indicate source files are building for newlib, we don't need this malloc-specific symbol. Convert it over to simplify the build a bit.
2022-03-01newlib: drop redundant AM_MAINTAINER_MODE callMike Frysinger2-31/+1
This is already called earlier in this file, so no need to do it again.
2022-03-01libgloss: merge lm32 into top-level MakefileMike Frysinger6-126/+82
Avoid a recursive make to speed things up a bit. This drops the header install logic because the lm32/ subdir doesn't actually have any header files to install.
2022-03-01libgloss: use m4_foreach_w to simplify the logic a bitMike Frysinger2-22/+24
It's functionally the same, but the configure.ac code is simpler and less boiler plate duplicated.
2022-03-02Cygwin: console: Prevent special keys processing from drop.Takashi Yano2-9/+15
- There was a potential risk to drop special key processing when process_input_messsage() is called intermittently. This patch fixes the issue.
2022-03-02Cygwin: console: Stop to create struct instance which is not needed.Takashi Yano1-9/+9
- In fhandler_console::cons_master_thread(), a struct which has only a static function is used. In this case, struct instance is not necessary. So with this patch, the static function is invoked without creating instance.
2022-03-01Cygwin: update 3.4 release textCorinna Vinschen2-0/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: /proc/<PID>/status: Fill SigPnd, SigBlk and SigIgn values with lifeCorinna Vinschen4-12/+70
So far the values of SigPnd and SigBlk were always 0 and SigIgn was incorrectly set to the block mask of the current thread of the calling process. Fix that by adding a _pinfo::siginfo method and a PICOM_SIGINFO message to allow to request actual signal info of any running process. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: wait_sig: allow to compute process-wide mask of pending signalsCorinna Vinschen2-1/+22
Add a signal __SIGPENDINGALL to allow computing the mask of all currently pending signals. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: add init_cygheap::compute_sigblkmask methodCorinna Vinschen2-0/+19
Add method to compute process-wide signal block mask Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: Makefile: fix ctags --extras optionCorinna Vinschen1-1/+1
--extra is deprectated, use --extras Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: handle_sigprocmask: If new signal set is NULL, ignore "how"Corinna Vinschen1-3/+3
The "how" value only makes sense if a new set is given. If we only read the current signal set, ignore the value of "how" per POSIX: "If set is a null pointer, the value of the argument how is not significant" Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: /proc/<PID>/status: fix format specifierCorinna Vinschen1-3/+3
The format specifier used for the signal masks is incorrectly assuming 32 bit values. Fix it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: pty: Rename some functions/variables with the name *pcon*.Takashi Yano5-179/+203
- With this patch, some pty functions/variables have been renamed so that the name *pcon* is not used for those that are called even when the pseudo console is not active.
2022-03-01Cygwin: sysconf: _SC_TZNAME_MAX: return -1 as valid valueCorinna Vinschen1-1/+1
sysconf incorrectly sets errno to EINVAL for _SC_TZNAME_MAX. Don't do that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-03-01Cygwin: pty: Reorganize the code path of setting up and closing pcon.Takashi Yano3-142/+153
- This patch reorganizes the code path of setting-up and cleaning-up of the pseudo console to improve readability and maintainability of pty code.
2022-03-01Cygwin: pty: Avoid cutting the branch the pty master is sitting on.Takashi Yano5-50/+65
- When Ctrl-C terminates a non-cygwin process on a pseudo console, pty master attaches to the pseudo console first, and send CTRL_C_EVENT. If the non-cygwin process closes the pseudo console before the pty master calls FreeConsole(), the pty master process will crash. With this patch, pty master process takes over the ownership of the pseudo console, and closes it by myself.
2022-03-01newlib: xstormy16: add missing string.h includeMike Frysinger1-0/+5
Some of these functions are using memcpy & memset from string.h but not including the header leading to implicit declaration warnings.
2022-02-28newlib: speed up targ-include setup & add error checkingMike Frysinger2-130/+47
The current targ-include setup runs `cp` every header file it installs, in serial. This can be a little noticeable on systems, so cleanup the logic to rely on cp's ability to copy multiple files to a directory in a single call. We still need a check for empty directories with no headers (i.e. the glob doesn't match anything), so add a helper variable to contain that logic to reduce the boiler plate a little.
2022-02-28libgloss: add a little build system generation documentationMike Frysinger1-1/+49
This is a bit of an abbreviated form of what's in the Newlib subdir, but with emphasis on Libgloss-specific parts, and anything unique to it. I haven't put too much effort in.
2022-02-28newlib: libc: move stdio multiplex logic from build to source filesMike Frysinger16-502/+249
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. Some of these rules were already unnecessary as they were compiling a single source file into the same named object w/out custom flags, and Automake handles that for us completely. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides. Also take the opportunity to clean up the unnecessary header deps in here. Automake provides dependency generation for free now.
2022-02-28newlib: simplify header setup rulesMike Frysinger2-42/+30
Since POSIX cp requires copying a file to a directory without having to specify the name explicitly, rely on that to avoid calling basename on every source file. We can also drop the stub `true` call if the -f test failed. The use of `if` already takes care of that in POSIX shell.
2022-02-28Cygwin: pty: Isolate CTRL_C_EVENTs between ptys.Takashi Yano2-4/+21
- With this patch, unique invisible consoles are created for each pty to isolate CTRL_C_EVENTs between ptys. This is necessary by Ctrl-C handling in fhandler_termios::process_sigs() for non-cygwin apps started in pty if the pseudo console is disabled.
2022-02-28Cygwin: console: Improve the code to avoid typeahead key swapping.Takashi Yano1-33/+42
- The commit "Cygwin: console: Prevent the order of typeahead input from swapped." did not fully resolve the issue. If keys are typed during input buffer fix, the order of key event may be swapped. This patch fixes the issue again.
2022-02-28Cygwin: pinfo: Fix exit code for non-cygwin apps which reads console.Takashi Yano3-3/+20
- The recent commit "Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C." did not fix enough the issue. If a non-cygwin app is reading the console, it will not return STATUS_CONTROL_C_EXIT even if it is terminated by Ctrl-C. As a result, the previous patch does not take effect. This patch solves this issue by setting sigExeced to SIGINT in ctrl_c_handler(). In addition, sigExeced will be cleared if the app does not terminated within predetermined time period. The reason is that the app does not seem to be terminated by the signal sigExeced.
2022-02-28Cygwin: termios: Ensure detection of GDB inferior in process_sigs().Takashi Yano3-6/+9
- In some situations, some cygwin processes might wrongly identified as GDB inferior. This patch ensures the detection of GDB inferior.
2022-02-27Cygwin: termios: Add comments to the code refactored recently.Takashi Yano2-21/+52
- This patch adds some comments to the source code whose intent may not be clear enough from the code which is refactored recently.
2022-02-27Cygwin: console: Correct the past fix for apps which open pty.Takashi Yano1-2/+2
- The commit "Cygwin: console: Fix issues of apps which open pty." did not fix the second problem correctly. That commit looked to fix the issue, but the actual problem was that ctrl_c_handler() should be reregistered *AFTER* FreeConsole()/AttachConsole(). This patch correct that.
2022-02-27Cygwin: console: Revert experimental code mixed accidentally.Takashi Yano1-1/+7
- The commit "Cygwin: console: Restore CTRL_BREAK_EVENT handling." was accidentally mixed with experimental code in exceptions.cc. Due to this, non-cygwin app receives CTRL_C_EVENT twice in the following scenario. 1) Run 'sleep 10 | <non-cygwin app>' 2) Hit Ctrl-C. 3) The non-cygwin app receives CTRL_C_EVENT twice. This patch reverts the code with the problem.
2022-02-26Cygwin: console: Prevent the order of typeahead input from swapped.Takashi Yano1-2/+51
- If a lot of keys are typed very quickly in the app which does not read console, the order of input keys in console input buffer occasionally swapped. Although this extremely rarely happens, is obviously a bug of cons_master_thread. This patch fixes the issue.
2022-02-26Cygwin: pty: Stop to send CTRL_C_EVENT if pcon activated.Takashi Yano3-7/+17
- The commit "Cygwin: console: Redesign handling of special keys." removes special treatment for pty in with pseudo console activated, however, it is necessary on second thought. This is because sending CTRL_C_EVENT to non-cygwin apps will be done in pseudo console, therefore, sending it in fhandler_pty_master::write() duplicates that event for non-cygwin apps.
2022-02-26Cygwin: console: Fix issues of apps which open pty.Takashi Yano4-17/+21
- After some recent changes for special keys handling break the apps which open pty (such as script command). If the app which opens pty is executed in console, the following issues occur. 1) If the script command was started from non-cygwin shell (such as cmd.exe), another cygwin app started in pty slave cannot receive Ctrl-C. 2) If non-cygwin app is executed in pty slave, the app which opened the pty (e.g. script command) crashes by Ctrl-C. This patch fixes these issues.
2022-02-25libgloss: iq2000: fix prototypeMike Frysinger1-1/+1
2022-02-25libgloss: switch to AM_PROG_ARMike Frysinger10-15/+776
Now that we require Automake 1.15, we can use this macro rather than set the tool up ourselves. The current code doesn't properly search for a prefixed ar tool as-is.
2022-02-25newlib: libc: move configure into top-levelMike Frysinger117-9115/+4268
This kills off the last configure script under libc/ and folds it into the top newlib configure script. The a lot of the logic was already in the top configure script, so move what's left into a libc/acinclude.m4 file.
2022-02-25Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C.Takashi Yano1-0/+3
- Previously, if non-cygwin app exits by Ctrl-C, exit code was 0x00007f00. With this patch, the exit code will be 0x00000002, which means process exited by SIGINT.
2022-02-24newlib: add silent rules support to top-level rulesMike Frysinger2-64/+64
2022-02-24libgloss: document & localize custom multi-do ruleMike Frysinger3-9/+14
The multi-build.in file in libgloss duplicates common multilib logic in the root source tree. Document it a bit, and rename the rule so it doesn't clash with the common multi-do rule. This will let us use them in the same makefile so we can merge aarch64/ & arm/ up (as the only targets that use this local multi-build.in atm).
2022-02-24libgloss: finish migration to AM_PROG_ASMike Frysinger11-179/+1633
When merging iq2000 up a level, it included a partial conversion to AM_PROG_AS in the common directory. Finish it for all directories to kill off the custom LIB_AM_PROG_AS which we no longer need since we require Automake 1.15 now.
2022-02-24libgloss: switch to standard AC_PROG_CCMike Frysinger9-2032/+1584
Now that we use AC_NO_EXECUTABLES, and we require a recent version of autoconf, we don't need to define our own copies of these macros. So switch to the standard AC_PROG_CC.
2022-02-24Cygwin: console: Restore CTRL_BREAK_EVENT handling.Takashi Yano3-17/+10
- The recent change by the commit "Cygwin: console: Redesign handling of special keys." breaks the handling of CTRL_BREAK_EVENT. The login shell in console exits on Ctrl-Break key. This patch fixes the issue.
2022-02-23newlib: fix multilib libg.a parallel buildsMike Frysinger2-6/+10
I split libg.a out into a sep target from libc.a for the main dir in commit f2b053f49ed2bd7b4da8cf4ed3a608dc2f425c2b ("newlib: separate out libg from libc"), but missed the multilib dirs. That leads to an uncommon parallel build failure: - libc.a rule runs & finishes - $(BUILD_MULTISUBDIR)/libc.a rule runs -> failure due to libg.a not yet existing - libg.a rule runs & finishes Split the multilib libg rule out from libc too so it can depend on the main libg directly and avoid this race.
2022-02-23newlib: libm: workaround ar duplicate member behaviorMike Frysinger2-5/+47
GNU ar has undocumented behavior where it doesn't dedupe its inputs if they're all on the same command line, so we have to dedupe ourselves.